Merge "Turn on QS media player by default" into rvc-dev

This commit is contained in:
TreeHugger Robot
2020-02-27 01:56:48 +00:00
committed by Android (Google) Code Review
2 changed files with 6 additions and 1 deletions

View File

@@ -126,9 +126,10 @@ public class Utils {
/** /**
* Allow the media player to be shown in the QS area, controlled by 2 flags. * Allow the media player to be shown in the QS area, controlled by 2 flags.
* On by default, but can be disabled by setting to 0
*/ */
public static boolean useQsMediaPlayer(Context context) { public static boolean useQsMediaPlayer(Context context) {
int flag = Settings.System.getInt(context.getContentResolver(), "qs_media_player", 0); int flag = Settings.System.getInt(context.getContentResolver(), "qs_media_player", 1);
return flag > 0; return flag > 0;
} }
} }

View File

@@ -25,6 +25,7 @@ import android.app.Notification;
import android.media.MediaMetadata; import android.media.MediaMetadata;
import android.media.session.MediaSession; import android.media.session.MediaSession;
import android.media.session.PlaybackState; import android.media.session.PlaybackState;
import android.provider.Settings;
import android.testing.AndroidTestingRunner; import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper.RunWithLooper; import android.testing.TestableLooper.RunWithLooper;
import android.view.View; import android.view.View;
@@ -66,6 +67,9 @@ public class NotificationMediaTemplateViewWrapperTest extends SysuiTestCase {
allowTestableLooperAsMainThread(); allowTestableLooperAsMainThread();
mDependency.injectTestDependency(MetricsLogger.class, mMetricsLogger); mDependency.injectTestDependency(MetricsLogger.class, mMetricsLogger);
// These tests are for regular media style notifications, not controls in quick settings
Settings.System.putInt(mContext.getContentResolver(), "qs_media_player", 0);
} }
private void makeTestNotification(long duration, boolean allowSeeking) throws Exception { private void makeTestNotification(long duration, boolean allowSeeking) throws Exception {