Revert "Bug: 23003511 CTS: AudioManagerTest#testSoundEffects failing"
This reverts commit c1c1a48e5544e2524c7477021fa6cb40ceb01939.
Change-Id: I6640803541f38874975b40bbe17831da112fbacf
diff --git a/tests/tests/media/src/android/media/cts/AudioManagerTest.java b/tests/tests/media/src/android/media/cts/AudioManagerTest.java
index 5870005..ded0539 100644
--- a/tests/tests/media/src/android/media/cts/AudioManagerTest.java
+++ b/tests/tests/media/src/android/media/cts/AudioManagerTest.java
@@ -45,27 +45,24 @@
import android.os.Vibrator;
import android.provider.Settings;
import android.provider.Settings.System;
-import android.test.InstrumentationTestCase;
+import android.test.AndroidTestCase;
import android.view.SoundEffectConstants;
import java.util.TreeMap;
-public class AudioManagerTest extends InstrumentationTestCase {
+public class AudioManagerTest extends AndroidTestCase {
private final static int MP3_TO_PLAY = R.raw.testmp3;
private final static long TIME_TO_PLAY = 2000;
- private final static String APPOPS_OP_STR = "android:write_settings";
private AudioManager mAudioManager;
private boolean mHasVibrator;
private boolean mUseFixedVolume;
private boolean mIsTelevision;
- private Context mContext;
@Override
protected void setUp() throws Exception {
super.setUp();
- mContext = getInstrumentation().getContext();
- Utils.enableAppOps(mContext.getPackageName(), APPOPS_OP_STR, getInstrumentation());
+ mAudioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE);
Vibrator vibrator = (Vibrator) mContext.getSystemService(Context.VIBRATOR_SERVICE);
mHasVibrator = (vibrator != null) && vibrator.hasVibrator();
mUseFixedVolume = mContext.getResources().getBoolean(
@@ -76,11 +73,6 @@
|| packageManager.hasSystemFeature(PackageManager.FEATURE_TELEVISION));
}
- @Override
- protected void tearDown() throws Exception {
- Utils.disableAppOps(mContext.getPackageName(), APPOPS_OP_STR, getInstrumentation());
- }
-
public void testMicrophoneMute() throws Exception {
mAudioManager.setMicrophoneMute(true);
assertTrue(mAudioManager.isMicrophoneMute());