Merge "Clean up post in WM package"
diff --git a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
index 2affa97..ea6f4cc 100644
--- a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
+++ b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
@@ -6222,30 +6222,27 @@
}
return;
}
- mH.post(() -> {
- synchronized (mGlobalLock) {
- final ActivityDisplay activityDisplay =
- mRootActivityContainer.getActivityDisplay(displayId);
- if (activityDisplay == null) {
- // Call might come when display is not yet added or has been removed.
- if (DEBUG_CONFIGURATION) {
- Slog.w(TAG, "Trying to update display configuration for non-existing "
- + "displayId=" + displayId);
- }
- return;
+ synchronized (mGlobalLock) {
+ final ActivityDisplay activityDisplay =
+ mRootActivityContainer.getActivityDisplay(displayId);
+ if (activityDisplay == null) {
+ // Call might come when display is not yet added or has been removed.
+ if (DEBUG_CONFIGURATION) {
+ Slog.w(TAG, "Trying to update display configuration for non-existing "
+ + "displayId=" + displayId);
}
- final WindowProcessController process = mPidMap.get(pid);
- if (process == null) {
- if (DEBUG_CONFIGURATION) {
- Slog.w(TAG, "Trying to update display configuration for invalid "
- + "process, pid=" + pid);
- }
- return;
- }
- process.registerDisplayConfigurationListenerLocked(activityDisplay);
+ return;
}
- });
-
+ final WindowProcessController process = mPidMap.get(pid);
+ if (process == null) {
+ if (DEBUG_CONFIGURATION) {
+ Slog.w(TAG, "Trying to update display configuration for invalid "
+ + "process, pid=" + pid);
+ }
+ return;
+ }
+ process.registerDisplayConfigurationListenerLocked(activityDisplay);
+ }
}
@Override
diff --git a/services/core/java/com/android/server/wm/AppTransitionController.java b/services/core/java/com/android/server/wm/AppTransitionController.java
index bf00ffb..775dfa42 100644
--- a/services/core/java/com/android/server/wm/AppTransitionController.java
+++ b/services/core/java/com/android/server/wm/AppTransitionController.java
@@ -49,8 +49,8 @@
import static com.android.server.wm.WindowManagerDebugConfig.SHOW_LIGHT_TRANSACTIONS;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM;
-import static com.android.server.wm.WindowManagerService.H.NOTIFY_APP_TRANSITION_STARTING;
+import android.os.SystemClock;
import android.os.Trace;
import android.util.ArraySet;
import android.util.Slog;
@@ -191,8 +191,8 @@
mDisplayContent.computeImeTarget(true /* updateImeTarget */);
- mService.mH.obtainMessage(NOTIFY_APP_TRANSITION_STARTING,
- mTempTransitionReasons.clone()).sendToTarget();
+ mService.mAtmInternal.notifyAppTransitionStarting(mTempTransitionReasons.clone(),
+ SystemClock.uptimeMillis());
Trace.traceEnd(Trace.TRACE_TAG_WINDOW_MANAGER);
diff --git a/services/core/java/com/android/server/wm/DockedStackDividerController.java b/services/core/java/com/android/server/wm/DockedStackDividerController.java
index 7ea88bb..ea65dd9 100644
--- a/services/core/java/com/android/server/wm/DockedStackDividerController.java
+++ b/services/core/java/com/android/server/wm/DockedStackDividerController.java
@@ -36,7 +36,6 @@
import static com.android.server.wm.DockedStackDividerControllerProto.MINIMIZED_DOCK;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM;
-import static com.android.server.wm.WindowManagerService.H.NOTIFY_DOCKED_STACK_MINIMIZED_CHANGED;
import static com.android.server.wm.WindowManagerService.LAYER_OFFSET_DIM;
import android.content.Context;
@@ -566,9 +565,7 @@
mMaximizeMeetFraction = getClipRevealMeetFraction(stack);
animDuration = (long) (mAnimationDuration * mMaximizeMeetFraction);
}
- mService.mH.removeMessages(NOTIFY_DOCKED_STACK_MINIMIZED_CHANGED);
- mService.mH.obtainMessage(NOTIFY_DOCKED_STACK_MINIMIZED_CHANGED,
- minimizedDock ? 1 : 0, 0).sendToTarget();
+ mService.mAtmInternal.notifyDockedStackMinimizedChanged(minimizedDock);
final int size = mDockedStackListeners.beginBroadcast();
for (int i = 0; i < size; ++i) {
final IDockedStackListener listener = mDockedStackListeners.getBroadcastItem(i);
diff --git a/services/core/java/com/android/server/wm/RecentsAnimationController.java b/services/core/java/com/android/server/wm/RecentsAnimationController.java
index 83ba384..fb82cb0 100644
--- a/services/core/java/com/android/server/wm/RecentsAnimationController.java
+++ b/services/core/java/com/android/server/wm/RecentsAnimationController.java
@@ -29,7 +29,6 @@
import static com.android.server.wm.AnimationAdapterProto.REMOTE;
import static com.android.server.wm.RemoteAnimationAdapterWrapperProto.TARGET;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_RECENTS_ANIMATIONS;
-import static com.android.server.wm.WindowManagerService.H.NOTIFY_APP_TRANSITION_STARTING;
import android.annotation.IntDef;
import android.app.ActivityManager.TaskSnapshot;
@@ -413,8 +412,7 @@
}
final SparseIntArray reasons = new SparseIntArray();
reasons.put(WINDOWING_MODE_FULLSCREEN, APP_TRANSITION_RECENTS_ANIM);
- mService.mH.obtainMessage(NOTIFY_APP_TRANSITION_STARTING,
- reasons).sendToTarget();
+ mService.mAtmInternal.notifyAppTransitionStarting(reasons, SystemClock.uptimeMillis());
}
void cancelAnimation(@ReorderMode int reorderMode, String reason) {
diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java
index c6679a9..5eff7d8 100644
--- a/services/core/java/com/android/server/wm/WindowManagerService.java
+++ b/services/core/java/com/android/server/wm/WindowManagerService.java
@@ -184,7 +184,6 @@
import android.util.Slog;
import android.util.SparseArray;
import android.util.SparseBooleanArray;
-import android.util.SparseIntArray;
import android.util.TimeUtils;
import android.util.TypedValue;
import android.util.proto.ProtoOutputStream;
@@ -857,12 +856,12 @@
@Override
public void onAppTransitionCancelledLocked(int transit) {
- mH.sendEmptyMessage(H.NOTIFY_APP_TRANSITION_CANCELLED);
+ mAtmInternal.notifyAppTransitionCancelled();
}
@Override
public void onAppTransitionFinishedLocked(IBinder token) {
- mH.sendEmptyMessage(H.NOTIFY_APP_TRANSITION_FINISHED);
+ mAtmInternal.notifyAppTransitionFinished();
final AppWindowToken atoken = mRoot.getAppWindowToken(token);
if (atoken == null) {
return;
@@ -2602,7 +2601,7 @@
@Override
public void notifyKeyguardTrustedChanged() {
- mH.sendEmptyMessage(H.NOTIFY_KEYGUARD_TRUSTED_CHANGED);
+ mAtmInternal.notifyKeyguardTrustedChanged();
}
@Override
@@ -2667,11 +2666,7 @@
* @param callback Runnable to be called when activity manager is done reevaluating visibilities
*/
void notifyKeyguardFlagsChanged(@Nullable Runnable callback, int displayId) {
- final Runnable wrappedCallback = callback != null
- ? () -> { synchronized (mGlobalLock) { callback.run(); } }
- : null;
- mH.obtainMessage(H.NOTIFY_KEYGUARD_FLAGS_CHANGED, displayId, 0,
- wrappedCallback).sendToTarget();
+ mAtmInternal.notifyKeyguardFlagsChanged(callback, displayId);
}
public boolean isKeyguardTrusted() {
@@ -4363,16 +4358,10 @@
public static final int WINDOW_REPLACEMENT_TIMEOUT = 46;
- public static final int NOTIFY_APP_TRANSITION_STARTING = 47;
- public static final int NOTIFY_APP_TRANSITION_CANCELLED = 48;
- public static final int NOTIFY_APP_TRANSITION_FINISHED = 49;
public static final int UPDATE_ANIMATION_SCALE = 51;
public static final int WINDOW_HIDE_TIMEOUT = 52;
- public static final int NOTIFY_DOCKED_STACK_MINIMIZED_CHANGED = 53;
public static final int SEAMLESS_ROTATION_TIMEOUT = 54;
public static final int RESTORE_POINTER_ICON = 55;
- public static final int NOTIFY_KEYGUARD_FLAGS_CHANGED = 56;
- public static final int NOTIFY_KEYGUARD_TRUSTED_CHANGED = 57;
public static final int SET_HAS_OVERLAY_UI = 58;
public static final int SET_RUNNING_REMOTE_ANIMATION = 59;
public static final int ANIMATION_FAILSAFE = 60;
@@ -4708,19 +4697,6 @@
}
}
break;
- case NOTIFY_APP_TRANSITION_STARTING: {
- mAtmInternal.notifyAppTransitionStarting((SparseIntArray) msg.obj,
- msg.getWhen());
- }
- break;
- case NOTIFY_APP_TRANSITION_CANCELLED: {
- mAtmInternal.notifyAppTransitionCancelled();
- }
- break;
- case NOTIFY_APP_TRANSITION_FINISHED: {
- mAtmInternal.notifyAppTransitionFinished();
- }
- break;
case WINDOW_HIDE_TIMEOUT: {
final WindowState window = (WindowState) msg.obj;
synchronized (mGlobalLock) {
@@ -4742,10 +4718,6 @@
}
}
break;
- case NOTIFY_DOCKED_STACK_MINIMIZED_CHANGED: {
- mAtmInternal.notifyDockedStackMinimizedChanged(msg.arg1 == 1);
- }
- break;
case RESTORE_POINTER_ICON: {
synchronized (mGlobalLock) {
restorePointerIconLocked((DisplayContent)msg.obj, msg.arg1, msg.arg2);
@@ -4759,14 +4731,6 @@
}
}
break;
- case NOTIFY_KEYGUARD_FLAGS_CHANGED: {
- mAtmInternal.notifyKeyguardFlagsChanged((Runnable) msg.obj, msg.arg1);
- }
- break;
- case NOTIFY_KEYGUARD_TRUSTED_CHANGED: {
- mAtmInternal.notifyKeyguardTrustedChanged();
- }
- break;
case SET_HAS_OVERLAY_UI: {
mAmInternal.setHasOverlayUi(msg.arg1, msg.arg2 == 1);
}