Loading core/java/android/app/Service.java +7 −0 Original line number Diff line number Diff line Loading @@ -387,6 +387,13 @@ public abstract class Service extends ContextWrapper implements ComponentCallbac * <p>This mode makes sense for things that will be explicitly started * and stopped to run for arbitrary periods of time, such as a service * performing background music playback. * * <p>Since Android version {@link Build.VERSION_CODES#S}, apps * targeting {@link Build.VERSION_CODES#S} or above are disallowed * to start a foreground service from the background, but the restriction * doesn't impact <em>restarts</em> of a sticky foreground service. However, * when apps start a sticky foreground service from the background, * the same restriction still applies. */ public static final int START_STICKY = 1; Loading location/java/android/location/Location.java +17 −1 Original line number Diff line number Diff line Loading @@ -1084,6 +1084,12 @@ public class Location implements Parcelable { mExtras = (extras == null) ? null : new Bundle(extras); } /** * Location equality is provided primarily for test purposes. Comparing locations for equality * in production may indicate incorrect assumptions, and should be avoided whenever possible. * * <p>{@inheritDoc} */ @Override public boolean equals(Object o) { if (this == o) { Loading Loading @@ -1121,7 +1127,17 @@ public class Location implements Parcelable { && (!hasBearingAccuracy() || Float.compare(location.mBearingAccuracyDegrees, mBearingAccuracyDegrees) == 0) && Objects.equals(mProvider, location.mProvider) && Objects.equals(mExtras, location.mExtras); && areExtrasEqual(mExtras, location.mExtras); } private static boolean areExtrasEqual(@Nullable Bundle extras1, @Nullable Bundle extras2) { if ((extras1 == null || extras1.isEmpty()) && (extras2 == null || extras2.isEmpty())) { return true; } else if (extras1 == null || extras2 == null) { return false; } else { return extras1.kindofEquals(extras2); } } @Override Loading packages/SettingsLib/src/com/android/settingslib/media/InfoMediaManager.java +1 −29 Original line number Diff line number Diff line Loading @@ -15,7 +15,6 @@ */ package com.android.settingslib.media; import static android.media.MediaRoute2Info.FEATURE_REMOTE_GROUP_PLAYBACK; import static android.media.MediaRoute2Info.TYPE_BLUETOOTH_A2DP; import static android.media.MediaRoute2Info.TYPE_BUILTIN_SPEAKER; import static android.media.MediaRoute2Info.TYPE_DOCK; Loading Loading @@ -388,35 +387,8 @@ public class InfoMediaManager extends MediaManager { @TargetApi(Build.VERSION_CODES.R) boolean shouldEnableVolumeSeekBar(RoutingSessionInfo sessionInfo) { if (sessionInfo == null) { Log.w(TAG, "shouldEnableVolumeSeekBar() package name is null or empty!"); return false; } final List<MediaRoute2Info> mediaRoute2Infos = mRouterManager.getSelectedRoutes(sessionInfo); // More than one selected route if (mediaRoute2Infos.size() > 1) { if (DEBUG) { Log.d(TAG, "shouldEnableVolumeSeekBar() package name : " + sessionInfo.getClientPackageName() + ", mediaRoute2Infos.size() " + mediaRoute2Infos.size()); } return false; } // Route contains group feature for (MediaRoute2Info mediaRoute2Info : mediaRoute2Infos) { final List<String> features = mediaRoute2Info.getFeatures(); if (features.contains(FEATURE_REMOTE_GROUP_PLAYBACK)) { if (DEBUG) { Log.d(TAG, "shouldEnableVolumeSeekBar() package name : " + mediaRoute2Info.getClientPackageName() + "contain group playback "); } return false; } } return true; } private void refreshDevices() { mMediaDevices.clear(); Loading packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java +3 −1 Original line number Diff line number Diff line Loading @@ -146,7 +146,9 @@ public class KeyguardSecurityContainerController extends ViewController<Keyguard try { Thread.sleep(5000); } catch (InterruptedException ignored) { } Runtime.getRuntime().gc(); System.gc(); System.runFinalization(); System.gc(); }); } else { SysUiStatsLog.write(SysUiStatsLog.KEYGUARD_BOUNCER_PASSWORD_ENTERED, Loading packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputController.java +1 −1 Original line number Diff line number Diff line Loading @@ -466,7 +466,7 @@ public class MediaOutputController implements LocalMediaManager.DeviceCallback { } boolean isVolumeControlEnabled(@NonNull MediaDevice device) { return !device.getFeatures().contains(MediaRoute2Info.FEATURE_REMOTE_GROUP_PLAYBACK); return !isActiveRemoteDevice(device); } private final MediaController.Callback mCb = new MediaController.Callback() { Loading Loading
core/java/android/app/Service.java +7 −0 Original line number Diff line number Diff line Loading @@ -387,6 +387,13 @@ public abstract class Service extends ContextWrapper implements ComponentCallbac * <p>This mode makes sense for things that will be explicitly started * and stopped to run for arbitrary periods of time, such as a service * performing background music playback. * * <p>Since Android version {@link Build.VERSION_CODES#S}, apps * targeting {@link Build.VERSION_CODES#S} or above are disallowed * to start a foreground service from the background, but the restriction * doesn't impact <em>restarts</em> of a sticky foreground service. However, * when apps start a sticky foreground service from the background, * the same restriction still applies. */ public static final int START_STICKY = 1; Loading
location/java/android/location/Location.java +17 −1 Original line number Diff line number Diff line Loading @@ -1084,6 +1084,12 @@ public class Location implements Parcelable { mExtras = (extras == null) ? null : new Bundle(extras); } /** * Location equality is provided primarily for test purposes. Comparing locations for equality * in production may indicate incorrect assumptions, and should be avoided whenever possible. * * <p>{@inheritDoc} */ @Override public boolean equals(Object o) { if (this == o) { Loading Loading @@ -1121,7 +1127,17 @@ public class Location implements Parcelable { && (!hasBearingAccuracy() || Float.compare(location.mBearingAccuracyDegrees, mBearingAccuracyDegrees) == 0) && Objects.equals(mProvider, location.mProvider) && Objects.equals(mExtras, location.mExtras); && areExtrasEqual(mExtras, location.mExtras); } private static boolean areExtrasEqual(@Nullable Bundle extras1, @Nullable Bundle extras2) { if ((extras1 == null || extras1.isEmpty()) && (extras2 == null || extras2.isEmpty())) { return true; } else if (extras1 == null || extras2 == null) { return false; } else { return extras1.kindofEquals(extras2); } } @Override Loading
packages/SettingsLib/src/com/android/settingslib/media/InfoMediaManager.java +1 −29 Original line number Diff line number Diff line Loading @@ -15,7 +15,6 @@ */ package com.android.settingslib.media; import static android.media.MediaRoute2Info.FEATURE_REMOTE_GROUP_PLAYBACK; import static android.media.MediaRoute2Info.TYPE_BLUETOOTH_A2DP; import static android.media.MediaRoute2Info.TYPE_BUILTIN_SPEAKER; import static android.media.MediaRoute2Info.TYPE_DOCK; Loading Loading @@ -388,35 +387,8 @@ public class InfoMediaManager extends MediaManager { @TargetApi(Build.VERSION_CODES.R) boolean shouldEnableVolumeSeekBar(RoutingSessionInfo sessionInfo) { if (sessionInfo == null) { Log.w(TAG, "shouldEnableVolumeSeekBar() package name is null or empty!"); return false; } final List<MediaRoute2Info> mediaRoute2Infos = mRouterManager.getSelectedRoutes(sessionInfo); // More than one selected route if (mediaRoute2Infos.size() > 1) { if (DEBUG) { Log.d(TAG, "shouldEnableVolumeSeekBar() package name : " + sessionInfo.getClientPackageName() + ", mediaRoute2Infos.size() " + mediaRoute2Infos.size()); } return false; } // Route contains group feature for (MediaRoute2Info mediaRoute2Info : mediaRoute2Infos) { final List<String> features = mediaRoute2Info.getFeatures(); if (features.contains(FEATURE_REMOTE_GROUP_PLAYBACK)) { if (DEBUG) { Log.d(TAG, "shouldEnableVolumeSeekBar() package name : " + mediaRoute2Info.getClientPackageName() + "contain group playback "); } return false; } } return true; } private void refreshDevices() { mMediaDevices.clear(); Loading
packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java +3 −1 Original line number Diff line number Diff line Loading @@ -146,7 +146,9 @@ public class KeyguardSecurityContainerController extends ViewController<Keyguard try { Thread.sleep(5000); } catch (InterruptedException ignored) { } Runtime.getRuntime().gc(); System.gc(); System.runFinalization(); System.gc(); }); } else { SysUiStatsLog.write(SysUiStatsLog.KEYGUARD_BOUNCER_PASSWORD_ENTERED, Loading
packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputController.java +1 −1 Original line number Diff line number Diff line Loading @@ -466,7 +466,7 @@ public class MediaOutputController implements LocalMediaManager.DeviceCallback { } boolean isVolumeControlEnabled(@NonNull MediaDevice device) { return !device.getFeatures().contains(MediaRoute2Info.FEATURE_REMOTE_GROUP_PLAYBACK); return !isActiveRemoteDevice(device); } private final MediaController.Callback mCb = new MediaController.Callback() { Loading