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

Commit 91ba0776 authored by Lucas Dupin's avatar Lucas Dupin Committed by Automerger Merge Worker
Browse files

Merge "Delete media feature flag" into rvc-dev am: 9b01b851

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/12108974

Change-Id: Ie6859a17ba1f1d420f231ba6d9385a48ce442923
parents 24cc569d 9b01b851
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);
    }