Loading apex/jobscheduler/framework/java/android/os/PowerExemptionManager.java +9 −0 Original line number Diff line number Diff line Loading @@ -385,6 +385,12 @@ public class PowerExemptionManager { */ public static final int REASON_ACTIVE_DEVICE_ADMIN = 324; /** * Media notification re-generate during transferring. * @hide */ public static final int REASON_MEDIA_NOTIFICATION_TRANSFER = 325; /** @hide The app requests out-out. */ public static final int REASON_OPT_OUT_REQUESTED = 1000; Loading Loading @@ -465,6 +471,7 @@ public class PowerExemptionManager { REASON_DPO_PROTECTED_APP, REASON_DISALLOW_APPS_CONTROL, REASON_ACTIVE_DEVICE_ADMIN, REASON_MEDIA_NOTIFICATION_TRANSFER, }) @Retention(RetentionPolicy.SOURCE) public @interface ReasonCode {} Loading Loading @@ -830,6 +837,8 @@ public class PowerExemptionManager { return "ACTIVE_DEVICE_ADMIN"; case REASON_OPT_OUT_REQUESTED: return "REASON_OPT_OUT_REQUESTED"; case REASON_MEDIA_NOTIFICATION_TRANSFER: return "REASON_MEDIA_NOTIFICATION_TRANSFER"; default: return "(unknown:" + reasonCode + ")"; } Loading boot/Android.bp +2 −2 Original line number Diff line number Diff line Loading @@ -60,8 +60,8 @@ platform_bootclasspath { module: "art-bootclasspath-fragment", }, { apex: "com.android.bluetooth", module: "com.android.bluetooth-bootclasspath-fragment", apex: "com.android.btservices", module: "com.android.btservices-bootclasspath-fragment", }, { apex: "com.android.conscrypt", Loading core/java/android/app/ActivityThread.java +1 −32 Original line number Diff line number Diff line Loading @@ -273,11 +273,6 @@ public final class ActivityThread extends ClientTransactionHandler private static final boolean DEBUG_PROVIDER = false; public static final boolean DEBUG_ORDER = false; private static final long MIN_TIME_BETWEEN_GCS = 5*1000; /** * If the activity doesn't become idle in time, the timeout will ensure to apply the pending top * process state. */ private static final long PENDING_TOP_PROCESS_STATE_TIMEOUT = 1000; /** * The delay to release the provider when it has no more references. It reduces the number of * transactions for acquiring and releasing provider if the client accesses the provider Loading Loading @@ -367,8 +362,6 @@ public final class ActivityThread extends ClientTransactionHandler private final AtomicInteger mNumLaunchingActivities = new AtomicInteger(); @GuardedBy("mAppThread") private int mLastProcessState = PROCESS_STATE_UNKNOWN; @GuardedBy("mAppThread") private int mPendingProcessState = PROCESS_STATE_UNKNOWN; ArrayList<WeakReference<AssistStructure>> mLastAssistStructures = new ArrayList<>(); private int mLastSessionId; final ArrayMap<IBinder, CreateServiceData> mServicesData = new ArrayMap<>(); Loading Loading @@ -2384,7 +2377,6 @@ public final class ActivityThread extends ClientTransactionHandler if (stopProfiling) { mProfiler.stopProfiling(); } applyPendingProcessState(); return false; } } Loading Loading @@ -3452,16 +3444,7 @@ public final class ActivityThread extends ClientTransactionHandler } wasCached = isCachedProcessState(); mLastProcessState = processState; // Defer the top state for VM to avoid aggressive JIT compilation affecting activity // launch time. if (processState == ActivityManager.PROCESS_STATE_TOP && mNumLaunchingActivities.get() > 0) { mPendingProcessState = processState; mH.postDelayed(this::applyPendingProcessState, PENDING_TOP_PROCESS_STATE_TIMEOUT); } else { mPendingProcessState = PROCESS_STATE_UNKNOWN; updateVmProcessState(processState); } if (localLOGV) { Slog.i(TAG, "******************* PROCESS STATE CHANGED TO: " + processState + (fromIpc ? " (from ipc" : "")); Loading Loading @@ -3495,20 +3478,6 @@ public final class ActivityThread extends ClientTransactionHandler VMRuntime.getRuntime().updateProcessState(state); } private void applyPendingProcessState() { synchronized (mAppThread) { if (mPendingProcessState == PROCESS_STATE_UNKNOWN) { return; } final int pendingState = mPendingProcessState; mPendingProcessState = PROCESS_STATE_UNKNOWN; // Only apply the pending state if the last state doesn't change. if (pendingState == mLastProcessState) { updateVmProcessState(pendingState); } } } @Override public void countLaunchingActivities(int num) { mNumLaunchingActivities.getAndAdd(num); Loading libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/SplitController.java +9 −0 Original line number Diff line number Diff line Loading @@ -642,6 +642,11 @@ public class SplitController implements JetpackTaskFragmentOrganizer.TaskFragmen } private void onActivityConfigurationChanged(@NonNull Activity activity) { if (activity.isFinishing()) { // Do nothing if the activity is currently finishing. return; } if (isInPictureInPicture(activity)) { // We don't embed activity when it is in PIP. return; Loading Loading @@ -1115,6 +1120,10 @@ public class SplitController implements JetpackTaskFragmentOrganizer.TaskFragmen } boolean launchPlaceholderIfNecessary(@NonNull Activity activity, boolean isOnCreated) { if (activity.isFinishing()) { return false; } final TaskFragmentContainer container = getContainerWithActivity(activity); // Don't launch placeholder if the container is occluded. if (container != null && container != getTopActiveContainer(container.getTaskId())) { Loading packages/SystemUI/src/com/android/keyguard/KeyguardPasswordViewController.java +7 −0 Original line number Diff line number Diff line Loading @@ -59,6 +59,7 @@ public class KeyguardPasswordViewController private final boolean mShowImeAtScreenOn; private EditText mPasswordEntry; private ImageView mSwitchImeButton; private boolean mPaused; private final OnEditorActionListener mOnEditorActionListener = (v, actionId, event) -> { // Check if this was the result of hitting the enter key Loading Loading @@ -202,6 +203,7 @@ public class KeyguardPasswordViewController @Override public void onResume(int reason) { super.onResume(reason); mPaused = false; if (reason != KeyguardSecurityView.SCREEN_ON || mShowImeAtScreenOn) { showInput(); } Loading @@ -222,6 +224,11 @@ public class KeyguardPasswordViewController @Override public void onPause() { if (mPaused) { return; } mPaused = true; if (!mPasswordEntry.isVisibleToUser()) { // Reset all states directly and then hide IME when the screen turned off. super.onPause(); Loading Loading
apex/jobscheduler/framework/java/android/os/PowerExemptionManager.java +9 −0 Original line number Diff line number Diff line Loading @@ -385,6 +385,12 @@ public class PowerExemptionManager { */ public static final int REASON_ACTIVE_DEVICE_ADMIN = 324; /** * Media notification re-generate during transferring. * @hide */ public static final int REASON_MEDIA_NOTIFICATION_TRANSFER = 325; /** @hide The app requests out-out. */ public static final int REASON_OPT_OUT_REQUESTED = 1000; Loading Loading @@ -465,6 +471,7 @@ public class PowerExemptionManager { REASON_DPO_PROTECTED_APP, REASON_DISALLOW_APPS_CONTROL, REASON_ACTIVE_DEVICE_ADMIN, REASON_MEDIA_NOTIFICATION_TRANSFER, }) @Retention(RetentionPolicy.SOURCE) public @interface ReasonCode {} Loading Loading @@ -830,6 +837,8 @@ public class PowerExemptionManager { return "ACTIVE_DEVICE_ADMIN"; case REASON_OPT_OUT_REQUESTED: return "REASON_OPT_OUT_REQUESTED"; case REASON_MEDIA_NOTIFICATION_TRANSFER: return "REASON_MEDIA_NOTIFICATION_TRANSFER"; default: return "(unknown:" + reasonCode + ")"; } Loading
boot/Android.bp +2 −2 Original line number Diff line number Diff line Loading @@ -60,8 +60,8 @@ platform_bootclasspath { module: "art-bootclasspath-fragment", }, { apex: "com.android.bluetooth", module: "com.android.bluetooth-bootclasspath-fragment", apex: "com.android.btservices", module: "com.android.btservices-bootclasspath-fragment", }, { apex: "com.android.conscrypt", Loading
core/java/android/app/ActivityThread.java +1 −32 Original line number Diff line number Diff line Loading @@ -273,11 +273,6 @@ public final class ActivityThread extends ClientTransactionHandler private static final boolean DEBUG_PROVIDER = false; public static final boolean DEBUG_ORDER = false; private static final long MIN_TIME_BETWEEN_GCS = 5*1000; /** * If the activity doesn't become idle in time, the timeout will ensure to apply the pending top * process state. */ private static final long PENDING_TOP_PROCESS_STATE_TIMEOUT = 1000; /** * The delay to release the provider when it has no more references. It reduces the number of * transactions for acquiring and releasing provider if the client accesses the provider Loading Loading @@ -367,8 +362,6 @@ public final class ActivityThread extends ClientTransactionHandler private final AtomicInteger mNumLaunchingActivities = new AtomicInteger(); @GuardedBy("mAppThread") private int mLastProcessState = PROCESS_STATE_UNKNOWN; @GuardedBy("mAppThread") private int mPendingProcessState = PROCESS_STATE_UNKNOWN; ArrayList<WeakReference<AssistStructure>> mLastAssistStructures = new ArrayList<>(); private int mLastSessionId; final ArrayMap<IBinder, CreateServiceData> mServicesData = new ArrayMap<>(); Loading Loading @@ -2384,7 +2377,6 @@ public final class ActivityThread extends ClientTransactionHandler if (stopProfiling) { mProfiler.stopProfiling(); } applyPendingProcessState(); return false; } } Loading Loading @@ -3452,16 +3444,7 @@ public final class ActivityThread extends ClientTransactionHandler } wasCached = isCachedProcessState(); mLastProcessState = processState; // Defer the top state for VM to avoid aggressive JIT compilation affecting activity // launch time. if (processState == ActivityManager.PROCESS_STATE_TOP && mNumLaunchingActivities.get() > 0) { mPendingProcessState = processState; mH.postDelayed(this::applyPendingProcessState, PENDING_TOP_PROCESS_STATE_TIMEOUT); } else { mPendingProcessState = PROCESS_STATE_UNKNOWN; updateVmProcessState(processState); } if (localLOGV) { Slog.i(TAG, "******************* PROCESS STATE CHANGED TO: " + processState + (fromIpc ? " (from ipc" : "")); Loading Loading @@ -3495,20 +3478,6 @@ public final class ActivityThread extends ClientTransactionHandler VMRuntime.getRuntime().updateProcessState(state); } private void applyPendingProcessState() { synchronized (mAppThread) { if (mPendingProcessState == PROCESS_STATE_UNKNOWN) { return; } final int pendingState = mPendingProcessState; mPendingProcessState = PROCESS_STATE_UNKNOWN; // Only apply the pending state if the last state doesn't change. if (pendingState == mLastProcessState) { updateVmProcessState(pendingState); } } } @Override public void countLaunchingActivities(int num) { mNumLaunchingActivities.getAndAdd(num); Loading
libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/SplitController.java +9 −0 Original line number Diff line number Diff line Loading @@ -642,6 +642,11 @@ public class SplitController implements JetpackTaskFragmentOrganizer.TaskFragmen } private void onActivityConfigurationChanged(@NonNull Activity activity) { if (activity.isFinishing()) { // Do nothing if the activity is currently finishing. return; } if (isInPictureInPicture(activity)) { // We don't embed activity when it is in PIP. return; Loading Loading @@ -1115,6 +1120,10 @@ public class SplitController implements JetpackTaskFragmentOrganizer.TaskFragmen } boolean launchPlaceholderIfNecessary(@NonNull Activity activity, boolean isOnCreated) { if (activity.isFinishing()) { return false; } final TaskFragmentContainer container = getContainerWithActivity(activity); // Don't launch placeholder if the container is occluded. if (container != null && container != getTopActiveContainer(container.getTaskId())) { Loading
packages/SystemUI/src/com/android/keyguard/KeyguardPasswordViewController.java +7 −0 Original line number Diff line number Diff line Loading @@ -59,6 +59,7 @@ public class KeyguardPasswordViewController private final boolean mShowImeAtScreenOn; private EditText mPasswordEntry; private ImageView mSwitchImeButton; private boolean mPaused; private final OnEditorActionListener mOnEditorActionListener = (v, actionId, event) -> { // Check if this was the result of hitting the enter key Loading Loading @@ -202,6 +203,7 @@ public class KeyguardPasswordViewController @Override public void onResume(int reason) { super.onResume(reason); mPaused = false; if (reason != KeyguardSecurityView.SCREEN_ON || mShowImeAtScreenOn) { showInput(); } Loading @@ -222,6 +224,11 @@ public class KeyguardPasswordViewController @Override public void onPause() { if (mPaused) { return; } mPaused = true; if (!mPasswordEntry.isVisibleToUser()) { // Reset all states directly and then hide IME when the screen turned off. super.onPause(); Loading