Snap for 7633965 from ccdb324274 to sc-release

Change-Id: I59d1aa9bf89cf29d59e72207d4e8e5900c4d5666
This commit is contained in:
Android Build Coastguard Worker
2021-08-12 01:07:22 +00:00
7 changed files with 36 additions and 34 deletions

View File

@@ -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;

View File

@@ -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) {
@@ -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

View File

@@ -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;
@@ -388,34 +387,7 @@ 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;
return false;
}
private void refreshDevices() {

View File

@@ -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,

View File

@@ -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() {

View File

@@ -1593,8 +1593,10 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
// If the transition has not started yet, the activity must be the top.
return false;
}
if (mLastWallpaperVisible && r.windowsCanBeWallpaperTarget()) {
// Use normal rotation animation for orientation change of visible wallpaper.
if (mLastWallpaperVisible && r.windowsCanBeWallpaperTarget()
&& mFixedRotationTransitionListener.mAnimatingRecents == null) {
// Use normal rotation animation for orientation change of visible wallpaper if recents
// animation is not running (it may be swiping to home).
return false;
}
final int rotation = rotationForActivityInDifferentOrientation(r);

View File

@@ -549,6 +549,9 @@ class WallpaperController {
final WindowState prevWallpaperTarget = mWallpaperTarget;
mWallpaperTarget = wallpaperTarget;
if (prevWallpaperTarget == null && wallpaperTarget != null) {
updateWallpaperOffsetLocked(mWallpaperTarget, false);
}
if (wallpaperTarget == null || prevWallpaperTarget == null) {
return;
}