Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 42219fb3 authored by Lucas Dupin's avatar Lucas Dupin
Browse files

Delete media feature flag

The feature will always be available, even for users who disabled it
on Beta 1.

Bug: 160826507
Test: manual
Test: MediaControlsParentPreferenceControllerTest
Test: MediaControlsPreferenceControllerTest
Change-Id: Ia2835e7c8156d753a8f8fbf248f2509003309fd2
parent f002dd72
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -18,8 +18,6 @@ package com.android.settings.sound;

import static android.provider.Settings.Secure.MEDIA_CONTROLS_RESUME;

import static com.android.settings.sound.MediaControlsPreferenceController.useQsMediaPlayer;

import android.content.Context;
import android.provider.Settings;

@@ -37,7 +35,7 @@ public class MediaControlsParentPreferenceController extends BasePreferenceContr

    @Override
    public int getAvailabilityStatus() {
        return useQsMediaPlayer(mContext) ? AVAILABLE : UNSUPPORTED_ON_DEVICE;
        return AVAILABLE;
    }

    @Override
+1 −7
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@

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 android.content.Context;
@@ -47,11 +46,6 @@ public class MediaControlsPreferenceController extends TogglePreferenceControlle

    @Override
    public int getAvailabilityStatus() {
        return useQsMediaPlayer(mContext) ? AVAILABLE : UNSUPPORTED_ON_DEVICE;
    }

    protected static boolean useQsMediaPlayer(Context context) {
        return Settings.Global.getInt(context.getContentResolver(),
                SHOW_MEDIA_ON_QUICK_SETTINGS, 1) > 0;
        return AVAILABLE;
    }
}
+1 −15
Original line number Diff line number Diff line
@@ -17,7 +17,6 @@
package com.android.settings.sound;

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;

@@ -67,20 +66,7 @@ public class MediaControlsParentPreferenceControllerTest {
    }

    @Test
    public void getAvailability_flagNotEnabled_returnUnsupportedOnDevice() {
        // 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
    public void getAvailability_returnAvailable() {
        assertThat(mController.getAvailabilityStatus()).isEqualTo(AVAILABLE);
    }

+1 −15
Original line number Diff line number Diff line
@@ -17,7 +17,6 @@
package com.android.settings.sound;

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;

@@ -65,20 +64,7 @@ public class MediaControlsPreferenceControllerTest {
    }

    @Test
    public void getAvailability_flagNotEnabled_returnUnsupportedOnDevice() {
        // 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
    public void getAvailability_returnAvailable() {
        assertThat(mController.getAvailabilityStatus()).isEqualTo(AVAILABLE);
    }