Merge "Delete media feature flag" into rvc-dev
This commit is contained in:
@@ -18,8 +18,6 @@ package com.android.settings.sound;
|
|||||||
|
|
||||||
import static android.provider.Settings.Secure.MEDIA_CONTROLS_RESUME;
|
import static android.provider.Settings.Secure.MEDIA_CONTROLS_RESUME;
|
||||||
|
|
||||||
import static com.android.settings.sound.MediaControlsPreferenceController.useQsMediaPlayer;
|
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
|
|
||||||
@@ -37,7 +35,7 @@ public class MediaControlsParentPreferenceController extends BasePreferenceContr
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getAvailabilityStatus() {
|
public int getAvailabilityStatus() {
|
||||||
return useQsMediaPlayer(mContext) ? AVAILABLE : UNSUPPORTED_ON_DEVICE;
|
return AVAILABLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -16,7 +16,6 @@
|
|||||||
|
|
||||||
package com.android.settings.sound;
|
package com.android.settings.sound;
|
||||||
|
|
||||||
import static android.provider.Settings.Global.SHOW_MEDIA_ON_QUICK_SETTINGS;
|
|
||||||
import static android.provider.Settings.Secure.MEDIA_CONTROLS_RESUME;
|
import static android.provider.Settings.Secure.MEDIA_CONTROLS_RESUME;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
@@ -47,11 +46,6 @@ public class MediaControlsPreferenceController extends TogglePreferenceControlle
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getAvailabilityStatus() {
|
public int getAvailabilityStatus() {
|
||||||
return useQsMediaPlayer(mContext) ? AVAILABLE : UNSUPPORTED_ON_DEVICE;
|
return AVAILABLE;
|
||||||
}
|
|
||||||
|
|
||||||
protected static boolean useQsMediaPlayer(Context context) {
|
|
||||||
return Settings.Global.getInt(context.getContentResolver(),
|
|
||||||
SHOW_MEDIA_ON_QUICK_SETTINGS, 1) > 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -17,7 +17,6 @@
|
|||||||
package com.android.settings.sound;
|
package com.android.settings.sound;
|
||||||
|
|
||||||
import static com.android.settings.core.BasePreferenceController.AVAILABLE;
|
import static com.android.settings.core.BasePreferenceController.AVAILABLE;
|
||||||
import static com.android.settings.core.BasePreferenceController.UNSUPPORTED_ON_DEVICE;
|
|
||||||
|
|
||||||
import static com.google.common.truth.Truth.assertThat;
|
import static com.google.common.truth.Truth.assertThat;
|
||||||
|
|
||||||
@@ -67,20 +66,7 @@ public class MediaControlsParentPreferenceControllerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getAvailability_flagNotEnabled_returnUnsupportedOnDevice() {
|
public void getAvailability_returnAvailable() {
|
||||||
// When the qs_media flag is not enabled
|
|
||||||
Settings.Global.putInt(mContentResolver, Settings.Global.SHOW_MEDIA_ON_QUICK_SETTINGS, 0);
|
|
||||||
|
|
||||||
// Then the media resume option should not appear
|
|
||||||
assertThat(mController.getAvailabilityStatus()).isEqualTo(UNSUPPORTED_ON_DEVICE);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void getAvailability_flagEnabled_returnAvailable() {
|
|
||||||
// When the qs_media flag is enabled
|
|
||||||
Settings.Global.putInt(mContentResolver, Settings.Global.SHOW_MEDIA_ON_QUICK_SETTINGS, 1);
|
|
||||||
|
|
||||||
// Then the media resume option should appear
|
|
||||||
assertThat(mController.getAvailabilityStatus()).isEqualTo(AVAILABLE);
|
assertThat(mController.getAvailabilityStatus()).isEqualTo(AVAILABLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -17,7 +17,6 @@
|
|||||||
package com.android.settings.sound;
|
package com.android.settings.sound;
|
||||||
|
|
||||||
import static com.android.settings.core.BasePreferenceController.AVAILABLE;
|
import static com.android.settings.core.BasePreferenceController.AVAILABLE;
|
||||||
import static com.android.settings.core.BasePreferenceController.UNSUPPORTED_ON_DEVICE;
|
|
||||||
|
|
||||||
import static com.google.common.truth.Truth.assertThat;
|
import static com.google.common.truth.Truth.assertThat;
|
||||||
|
|
||||||
@@ -65,20 +64,7 @@ public class MediaControlsPreferenceControllerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getAvailability_flagNotEnabled_returnUnsupportedOnDevice() {
|
public void getAvailability_returnAvailable() {
|
||||||
// When the qs_media flag is not enabled
|
|
||||||
Settings.Global.putInt(mContentResolver, Settings.Global.SHOW_MEDIA_ON_QUICK_SETTINGS, 0);
|
|
||||||
|
|
||||||
// Then the media resume option should not appear
|
|
||||||
assertThat(mController.getAvailabilityStatus()).isEqualTo(UNSUPPORTED_ON_DEVICE);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void getAvailability_flagEnabled_returnAvailable() {
|
|
||||||
// When the qs_media flag is enabled
|
|
||||||
Settings.Global.putInt(mContentResolver, Settings.Global.SHOW_MEDIA_ON_QUICK_SETTINGS, 1);
|
|
||||||
|
|
||||||
// Then the media resume option should appear
|
|
||||||
assertThat(mController.getAvailabilityStatus()).isEqualTo(AVAILABLE);
|
assertThat(mController.getAvailabilityStatus()).isEqualTo(AVAILABLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user