Loading apex/jobscheduler/service/java/com/android/server/job/controllers/BackgroundJobsController.java +1 −2 Original line number Diff line number Diff line Loading @@ -184,7 +184,6 @@ public final class BackgroundJobsController extends StateController { } boolean updateSingleJobRestrictionLocked(JobStatus jobStatus, int activeState) { final int uid = jobStatus.getSourceUid(); final String packageName = jobStatus.getSourcePackageName(); Loading @@ -199,7 +198,7 @@ public final class BackgroundJobsController extends StateController { isActive = (activeState == KNOWN_ACTIVE); } if (isActive && jobStatus.getStandbyBucket() == NEVER_INDEX) { Slog.wtf(TAG, "App became active but still in NEVER bucket"); Slog.wtf(TAG, "App " + packageName + " became active but still in NEVER bucket"); } boolean didChange = jobStatus.setBackgroundNotRestrictedConstraintSatisfied(canRun); didChange |= jobStatus.setUidActive(isActive); Loading api/test-current.txt +6 −6 Original line number Diff line number Diff line Loading @@ -5232,14 +5232,14 @@ package android.window { method @Nullable @RequiresPermission(android.Manifest.permission.MANAGE_ACTIVITY_STACKS) public static java.util.List<android.app.ActivityManager.RunningTaskInfo> getChildTasks(@NonNull android.window.WindowContainerToken, @NonNull int[]); method @Nullable @RequiresPermission(android.Manifest.permission.MANAGE_ACTIVITY_STACKS) public static android.window.WindowContainerToken getImeTarget(int); method @Nullable @RequiresPermission(android.Manifest.permission.MANAGE_ACTIVITY_STACKS) public static java.util.List<android.app.ActivityManager.RunningTaskInfo> getRootTasks(int, @NonNull int[]); method public void onBackPressedOnTaskRoot(@NonNull android.app.ActivityManager.RunningTaskInfo); method public void onTaskAppeared(@NonNull android.app.ActivityManager.RunningTaskInfo); method public void onTaskInfoChanged(@NonNull android.app.ActivityManager.RunningTaskInfo); method public void onTaskVanished(@NonNull android.app.ActivityManager.RunningTaskInfo); method @RequiresPermission(android.Manifest.permission.MANAGE_ACTIVITY_STACKS) public void registerOrganizer(int); method @BinderThread public void onBackPressedOnTaskRoot(@NonNull android.app.ActivityManager.RunningTaskInfo); method @BinderThread public void onTaskAppeared(@NonNull android.app.ActivityManager.RunningTaskInfo); method @BinderThread public void onTaskInfoChanged(@NonNull android.app.ActivityManager.RunningTaskInfo); method @BinderThread public void onTaskVanished(@NonNull android.app.ActivityManager.RunningTaskInfo); method @RequiresPermission(android.Manifest.permission.MANAGE_ACTIVITY_STACKS) public final void registerOrganizer(int); method @RequiresPermission(android.Manifest.permission.MANAGE_ACTIVITY_STACKS) public void setInterceptBackPressedOnTaskRoot(boolean); method @RequiresPermission(android.Manifest.permission.MANAGE_ACTIVITY_STACKS) public static void setLaunchRoot(int, @NonNull android.window.WindowContainerToken); method @RequiresPermission(android.Manifest.permission.MANAGE_ACTIVITY_STACKS) public void unregisterOrganizer(); method @RequiresPermission(android.Manifest.permission.MANAGE_ACTIVITY_STACKS) public final void unregisterOrganizer(); } public final class WindowContainerToken implements android.os.Parcelable { Loading core/java/android/app/ActivityManager.java +34 −0 Original line number Diff line number Diff line Loading @@ -69,6 +69,7 @@ import android.os.SystemProperties; import android.os.UserHandle; import android.os.UserManager; import android.os.WorkSource; import android.text.TextUtils; import android.util.ArrayMap; import android.util.DisplayMetrics; import android.util.Singleton; Loading Loading @@ -1597,6 +1598,39 @@ public class ActivityManager { + " resizeMode: " + ActivityInfo.resizeModeToString(mResizeMode) + " minWidth: " + mMinWidth + " minHeight: " + mMinHeight; } @Override public boolean equals(Object obj) { if (!(obj instanceof TaskDescription)) { return false; } TaskDescription other = (TaskDescription) obj; return TextUtils.equals(mLabel, other.mLabel) && TextUtils.equals(mIconFilename, other.mIconFilename) && mIcon == other.mIcon && mColorPrimary == other.mColorPrimary && mColorBackground == other.mColorBackground && mStatusBarColor == other.mStatusBarColor && mNavigationBarColor == other.mNavigationBarColor && mEnsureStatusBarContrastWhenTransparent == other.mEnsureStatusBarContrastWhenTransparent && mEnsureNavigationBarContrastWhenTransparent == other.mEnsureNavigationBarContrastWhenTransparent && mResizeMode == other.mResizeMode && mMinWidth == other.mMinWidth && mMinHeight == other.mMinHeight; } /** @hide */ public static boolean equals(TaskDescription td1, TaskDescription td2) { if (td1 == null && td2 == null) { return true; } else if (td1 != null && td2 != null) { return td1.equals(td2); } return false; } } /** Loading core/java/android/app/Notification.java +29 −7 Original line number Diff line number Diff line Loading @@ -3594,20 +3594,42 @@ public class Notification implements Parcelable } /** * If this notification is duplicative of a Launcher shortcut, sets the * {@link ShortcutInfo#getId() id} of the shortcut, in case the Launcher wants to hide * the shortcut. * * This field will be ignored by Launchers that don't support badging, don't show * notification content, or don't show {@link android.content.pm.ShortcutManager shortcuts}. * From Android 11, messaging notifications (those that use {@link MessagingStyle}) that * use this method to link to a published long-lived sharing shortcut may appear in a * dedicated Conversation section of the shade and may show configuration options that * are unique to conversations. This behavior should be reserved for person to person(s) * conversations where there is a likely social obligation for an individual to respond. * <p> * For example, the following are some examples of notifications that belong in the * conversation space: * <ul> * <li>1:1 conversations between two individuals</li> * <li>Group conversations between individuals where everyone can contribute</li> * </ul> * And the following are some examples of notifications that do not belong in the * conversation space: * <ul> * <li>Advertisements from a bot (even if personal and contextualized)</li> * <li>Engagement notifications from a bot</li> * <li>Directional conversations where there is an active speaker and many passive * individuals</li> * <li>Stream / posting updates from other individuals</li> * </ul> * </p> * * <p> * Additionally, this method can be used for all types of notifications to mark this * notification as duplicative of a Launcher shortcut. Launchers that show badges or * notification content may then suppress the shortcut in favor of the content of this * notification. * <p> * If this notification has {@link BubbleMetadata} attached that was created with * a shortcutId a check will be performed to ensure the shortcutId supplied to bubble * metadata matches the shortcutId set here, if one was set. If the shortcutId's were * specified but do not match, an exception is thrown. * * @param shortcutId the {@link ShortcutInfo#getId() id} of the shortcut this notification * supersedes * is linked to * * @see Notification.BubbleMetadata.Builder#Builder(String) */ Loading core/java/android/app/servertransaction/LaunchActivityItem.java +16 −22 Original line number Diff line number Diff line Loading @@ -186,8 +186,8 @@ public class LaunchActivityItem extends ClientTransactionItem { && Objects.equals(mOverrideConfig, other.mOverrideConfig) && Objects.equals(mCompatInfo, other.mCompatInfo) && Objects.equals(mReferrer, other.mReferrer) && mProcState == other.mProcState && areBundlesEqual(mState, other.mState) && areBundlesEqual(mPersistentState, other.mPersistentState) && mProcState == other.mProcState && areBundlesEqualRoughly(mState, other.mState) && areBundlesEqualRoughly(mPersistentState, other.mPersistentState) && Objects.equals(mPendingResults, other.mPendingResults) && Objects.equals(mPendingNewIntents, other.mPendingNewIntents) && mIsForward == other.mIsForward Loading @@ -205,8 +205,8 @@ public class LaunchActivityItem extends ClientTransactionItem { result = 31 * result + Objects.hashCode(mCompatInfo); result = 31 * result + Objects.hashCode(mReferrer); result = 31 * result + Objects.hashCode(mProcState); result = 31 * result + (mState != null ? mState.size() : 0); result = 31 * result + (mPersistentState != null ? mPersistentState.size() : 0); result = 31 * result + getRoughBundleHashCode(mState); result = 31 * result + getRoughBundleHashCode(mPersistentState); result = 31 * result + Objects.hashCode(mPendingResults); result = 31 * result + Objects.hashCode(mPendingNewIntents); result = 31 * result + (mIsForward ? 1 : 0); Loading @@ -225,25 +225,19 @@ public class LaunchActivityItem extends ClientTransactionItem { && Objects.equals(mInfo.getComponentName(), other.getComponentName()); } private static boolean areBundlesEqual(BaseBundle extras, BaseBundle newExtras) { if (extras == null || newExtras == null) { return extras == newExtras; } if (extras.size() != newExtras.size()) { return false; /** * This method may be used to compare a parceled item with another unparceled item, and the * parceled bundle may contain customized class that will raise BadParcelableException when * unparceling if a customized class loader is not set to the bundle. So the hash code is * simply determined by the bundle is empty or not. */ private static int getRoughBundleHashCode(BaseBundle bundle) { return (bundle == null || bundle.isDefinitelyEmpty()) ? 0 : 1; } for (String key : extras.keySet()) { if (key != null) { final Object value = extras.get(key); final Object newValue = newExtras.get(key); if (!Objects.equals(value, newValue)) { return false; } } } return true; /** Compares the bundles without unparceling them (avoid BadParcelableException). */ private static boolean areBundlesEqualRoughly(BaseBundle a, BaseBundle b) { return getRoughBundleHashCode(a) == getRoughBundleHashCode(b); } @Override Loading Loading
apex/jobscheduler/service/java/com/android/server/job/controllers/BackgroundJobsController.java +1 −2 Original line number Diff line number Diff line Loading @@ -184,7 +184,6 @@ public final class BackgroundJobsController extends StateController { } boolean updateSingleJobRestrictionLocked(JobStatus jobStatus, int activeState) { final int uid = jobStatus.getSourceUid(); final String packageName = jobStatus.getSourcePackageName(); Loading @@ -199,7 +198,7 @@ public final class BackgroundJobsController extends StateController { isActive = (activeState == KNOWN_ACTIVE); } if (isActive && jobStatus.getStandbyBucket() == NEVER_INDEX) { Slog.wtf(TAG, "App became active but still in NEVER bucket"); Slog.wtf(TAG, "App " + packageName + " became active but still in NEVER bucket"); } boolean didChange = jobStatus.setBackgroundNotRestrictedConstraintSatisfied(canRun); didChange |= jobStatus.setUidActive(isActive); Loading
api/test-current.txt +6 −6 Original line number Diff line number Diff line Loading @@ -5232,14 +5232,14 @@ package android.window { method @Nullable @RequiresPermission(android.Manifest.permission.MANAGE_ACTIVITY_STACKS) public static java.util.List<android.app.ActivityManager.RunningTaskInfo> getChildTasks(@NonNull android.window.WindowContainerToken, @NonNull int[]); method @Nullable @RequiresPermission(android.Manifest.permission.MANAGE_ACTIVITY_STACKS) public static android.window.WindowContainerToken getImeTarget(int); method @Nullable @RequiresPermission(android.Manifest.permission.MANAGE_ACTIVITY_STACKS) public static java.util.List<android.app.ActivityManager.RunningTaskInfo> getRootTasks(int, @NonNull int[]); method public void onBackPressedOnTaskRoot(@NonNull android.app.ActivityManager.RunningTaskInfo); method public void onTaskAppeared(@NonNull android.app.ActivityManager.RunningTaskInfo); method public void onTaskInfoChanged(@NonNull android.app.ActivityManager.RunningTaskInfo); method public void onTaskVanished(@NonNull android.app.ActivityManager.RunningTaskInfo); method @RequiresPermission(android.Manifest.permission.MANAGE_ACTIVITY_STACKS) public void registerOrganizer(int); method @BinderThread public void onBackPressedOnTaskRoot(@NonNull android.app.ActivityManager.RunningTaskInfo); method @BinderThread public void onTaskAppeared(@NonNull android.app.ActivityManager.RunningTaskInfo); method @BinderThread public void onTaskInfoChanged(@NonNull android.app.ActivityManager.RunningTaskInfo); method @BinderThread public void onTaskVanished(@NonNull android.app.ActivityManager.RunningTaskInfo); method @RequiresPermission(android.Manifest.permission.MANAGE_ACTIVITY_STACKS) public final void registerOrganizer(int); method @RequiresPermission(android.Manifest.permission.MANAGE_ACTIVITY_STACKS) public void setInterceptBackPressedOnTaskRoot(boolean); method @RequiresPermission(android.Manifest.permission.MANAGE_ACTIVITY_STACKS) public static void setLaunchRoot(int, @NonNull android.window.WindowContainerToken); method @RequiresPermission(android.Manifest.permission.MANAGE_ACTIVITY_STACKS) public void unregisterOrganizer(); method @RequiresPermission(android.Manifest.permission.MANAGE_ACTIVITY_STACKS) public final void unregisterOrganizer(); } public final class WindowContainerToken implements android.os.Parcelable { Loading
core/java/android/app/ActivityManager.java +34 −0 Original line number Diff line number Diff line Loading @@ -69,6 +69,7 @@ import android.os.SystemProperties; import android.os.UserHandle; import android.os.UserManager; import android.os.WorkSource; import android.text.TextUtils; import android.util.ArrayMap; import android.util.DisplayMetrics; import android.util.Singleton; Loading Loading @@ -1597,6 +1598,39 @@ public class ActivityManager { + " resizeMode: " + ActivityInfo.resizeModeToString(mResizeMode) + " minWidth: " + mMinWidth + " minHeight: " + mMinHeight; } @Override public boolean equals(Object obj) { if (!(obj instanceof TaskDescription)) { return false; } TaskDescription other = (TaskDescription) obj; return TextUtils.equals(mLabel, other.mLabel) && TextUtils.equals(mIconFilename, other.mIconFilename) && mIcon == other.mIcon && mColorPrimary == other.mColorPrimary && mColorBackground == other.mColorBackground && mStatusBarColor == other.mStatusBarColor && mNavigationBarColor == other.mNavigationBarColor && mEnsureStatusBarContrastWhenTransparent == other.mEnsureStatusBarContrastWhenTransparent && mEnsureNavigationBarContrastWhenTransparent == other.mEnsureNavigationBarContrastWhenTransparent && mResizeMode == other.mResizeMode && mMinWidth == other.mMinWidth && mMinHeight == other.mMinHeight; } /** @hide */ public static boolean equals(TaskDescription td1, TaskDescription td2) { if (td1 == null && td2 == null) { return true; } else if (td1 != null && td2 != null) { return td1.equals(td2); } return false; } } /** Loading
core/java/android/app/Notification.java +29 −7 Original line number Diff line number Diff line Loading @@ -3594,20 +3594,42 @@ public class Notification implements Parcelable } /** * If this notification is duplicative of a Launcher shortcut, sets the * {@link ShortcutInfo#getId() id} of the shortcut, in case the Launcher wants to hide * the shortcut. * * This field will be ignored by Launchers that don't support badging, don't show * notification content, or don't show {@link android.content.pm.ShortcutManager shortcuts}. * From Android 11, messaging notifications (those that use {@link MessagingStyle}) that * use this method to link to a published long-lived sharing shortcut may appear in a * dedicated Conversation section of the shade and may show configuration options that * are unique to conversations. This behavior should be reserved for person to person(s) * conversations where there is a likely social obligation for an individual to respond. * <p> * For example, the following are some examples of notifications that belong in the * conversation space: * <ul> * <li>1:1 conversations between two individuals</li> * <li>Group conversations between individuals where everyone can contribute</li> * </ul> * And the following are some examples of notifications that do not belong in the * conversation space: * <ul> * <li>Advertisements from a bot (even if personal and contextualized)</li> * <li>Engagement notifications from a bot</li> * <li>Directional conversations where there is an active speaker and many passive * individuals</li> * <li>Stream / posting updates from other individuals</li> * </ul> * </p> * * <p> * Additionally, this method can be used for all types of notifications to mark this * notification as duplicative of a Launcher shortcut. Launchers that show badges or * notification content may then suppress the shortcut in favor of the content of this * notification. * <p> * If this notification has {@link BubbleMetadata} attached that was created with * a shortcutId a check will be performed to ensure the shortcutId supplied to bubble * metadata matches the shortcutId set here, if one was set. If the shortcutId's were * specified but do not match, an exception is thrown. * * @param shortcutId the {@link ShortcutInfo#getId() id} of the shortcut this notification * supersedes * is linked to * * @see Notification.BubbleMetadata.Builder#Builder(String) */ Loading
core/java/android/app/servertransaction/LaunchActivityItem.java +16 −22 Original line number Diff line number Diff line Loading @@ -186,8 +186,8 @@ public class LaunchActivityItem extends ClientTransactionItem { && Objects.equals(mOverrideConfig, other.mOverrideConfig) && Objects.equals(mCompatInfo, other.mCompatInfo) && Objects.equals(mReferrer, other.mReferrer) && mProcState == other.mProcState && areBundlesEqual(mState, other.mState) && areBundlesEqual(mPersistentState, other.mPersistentState) && mProcState == other.mProcState && areBundlesEqualRoughly(mState, other.mState) && areBundlesEqualRoughly(mPersistentState, other.mPersistentState) && Objects.equals(mPendingResults, other.mPendingResults) && Objects.equals(mPendingNewIntents, other.mPendingNewIntents) && mIsForward == other.mIsForward Loading @@ -205,8 +205,8 @@ public class LaunchActivityItem extends ClientTransactionItem { result = 31 * result + Objects.hashCode(mCompatInfo); result = 31 * result + Objects.hashCode(mReferrer); result = 31 * result + Objects.hashCode(mProcState); result = 31 * result + (mState != null ? mState.size() : 0); result = 31 * result + (mPersistentState != null ? mPersistentState.size() : 0); result = 31 * result + getRoughBundleHashCode(mState); result = 31 * result + getRoughBundleHashCode(mPersistentState); result = 31 * result + Objects.hashCode(mPendingResults); result = 31 * result + Objects.hashCode(mPendingNewIntents); result = 31 * result + (mIsForward ? 1 : 0); Loading @@ -225,25 +225,19 @@ public class LaunchActivityItem extends ClientTransactionItem { && Objects.equals(mInfo.getComponentName(), other.getComponentName()); } private static boolean areBundlesEqual(BaseBundle extras, BaseBundle newExtras) { if (extras == null || newExtras == null) { return extras == newExtras; } if (extras.size() != newExtras.size()) { return false; /** * This method may be used to compare a parceled item with another unparceled item, and the * parceled bundle may contain customized class that will raise BadParcelableException when * unparceling if a customized class loader is not set to the bundle. So the hash code is * simply determined by the bundle is empty or not. */ private static int getRoughBundleHashCode(BaseBundle bundle) { return (bundle == null || bundle.isDefinitelyEmpty()) ? 0 : 1; } for (String key : extras.keySet()) { if (key != null) { final Object value = extras.get(key); final Object newValue = newExtras.get(key); if (!Objects.equals(value, newValue)) { return false; } } } return true; /** Compares the bundles without unparceling them (avoid BadParcelableException). */ private static boolean areBundlesEqualRoughly(BaseBundle a, BaseBundle b) { return getRoughBundleHashCode(a) == getRoughBundleHashCode(b); } @Override Loading