Loading apct-tests/perftests/windowmanager/src/android/wm/WindowAddRemovePerfTest.java +3 −1 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package android.wm; import static android.view.WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR; import static android.view.WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN; import android.graphics.Rect; import android.os.RemoteException; import android.os.SystemClock; import android.perftests.utils.ManualBenchmarkState; Loading Loading @@ -86,6 +87,7 @@ public class WindowAddRemovePerfTest extends WindowManagerPerfTestBase final InsetsVisibilities mRequestedVisibilities = new InsetsVisibilities(); final InsetsState mOutInsetsState = new InsetsState(); final InsetsSourceControl[] mOutControls = new InsetsSourceControl[0]; final Rect mOutAttachedFrame = new Rect(); TestWindow() { mLayoutParams.setTitle(TestWindow.class.getName()); Loading @@ -104,7 +106,7 @@ public class WindowAddRemovePerfTest extends WindowManagerPerfTestBase long startTime = SystemClock.elapsedRealtimeNanos(); session.addToDisplay(this, mLayoutParams, View.VISIBLE, Display.DEFAULT_DISPLAY, mRequestedVisibilities, inputChannel, mOutInsetsState, mOutControls); mOutInsetsState, mOutControls, mOutAttachedFrame); final long elapsedTimeNsOfAdd = SystemClock.elapsedRealtimeNanos() - startTime; state.addExtraResult("add", elapsedTimeNsOfAdd); 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 @@ -3438,16 +3430,7 @@ public final class ActivityThread extends ClientTransactionHandler return; } 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 @@ -3465,20 +3448,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 core/java/android/content/res/CompatibilityInfo.java +4 −1 Original line number Diff line number Diff line Loading @@ -420,7 +420,10 @@ public class CompatibilityInfo implements Parcelable { * Translate a Rect in screen coordinates into the app window's coordinates. */ @UnsupportedAppUsage public void translateRectInScreenToAppWindow(Rect rect) { public void translateRectInScreenToAppWindow(@Nullable Rect rect) { if (rect == null) { return; } rect.scale(applicationInvertedScale); } Loading Loading
apct-tests/perftests/windowmanager/src/android/wm/WindowAddRemovePerfTest.java +3 −1 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package android.wm; import static android.view.WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR; import static android.view.WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN; import android.graphics.Rect; import android.os.RemoteException; import android.os.SystemClock; import android.perftests.utils.ManualBenchmarkState; Loading Loading @@ -86,6 +87,7 @@ public class WindowAddRemovePerfTest extends WindowManagerPerfTestBase final InsetsVisibilities mRequestedVisibilities = new InsetsVisibilities(); final InsetsState mOutInsetsState = new InsetsState(); final InsetsSourceControl[] mOutControls = new InsetsSourceControl[0]; final Rect mOutAttachedFrame = new Rect(); TestWindow() { mLayoutParams.setTitle(TestWindow.class.getName()); Loading @@ -104,7 +106,7 @@ public class WindowAddRemovePerfTest extends WindowManagerPerfTestBase long startTime = SystemClock.elapsedRealtimeNanos(); session.addToDisplay(this, mLayoutParams, View.VISIBLE, Display.DEFAULT_DISPLAY, mRequestedVisibilities, inputChannel, mOutInsetsState, mOutControls); mOutInsetsState, mOutControls, mOutAttachedFrame); final long elapsedTimeNsOfAdd = SystemClock.elapsedRealtimeNanos() - startTime; state.addExtraResult("add", elapsedTimeNsOfAdd); 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 @@ -3438,16 +3430,7 @@ public final class ActivityThread extends ClientTransactionHandler return; } 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 @@ -3465,20 +3448,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
core/java/android/content/res/CompatibilityInfo.java +4 −1 Original line number Diff line number Diff line Loading @@ -420,7 +420,10 @@ public class CompatibilityInfo implements Parcelable { * Translate a Rect in screen coordinates into the app window's coordinates. */ @UnsupportedAppUsage public void translateRectInScreenToAppWindow(Rect rect) { public void translateRectInScreenToAppWindow(@Nullable Rect rect) { if (rect == null) { return; } rect.scale(applicationInvertedScale); } Loading