Call ensureActivitiesVisibleLocked from supervisor.
- Don't call ActivityStack.ensureActivitiesVisibleLocked directly.
Instead call ActivityStackSupervisor.ensureActivitiesVisibleLocked.
- Add detecting monochrome screenshots to black screenshots.
- minor refactors.
Change-Id: I050b1cd40cacaab451f1460a77a82125a8077ff2
diff --git a/services/java/com/android/server/am/ActivityStackSupervisor.java b/services/java/com/android/server/am/ActivityStackSupervisor.java
index 60b7061..69e9f76 100644
--- a/services/java/com/android/server/am/ActivityStackSupervisor.java
+++ b/services/java/com/android/server/am/ActivityStackSupervisor.java
@@ -52,6 +52,7 @@
import android.content.res.Configuration;
import android.os.Binder;
import android.os.Bundle;
+import android.os.Debug;
import android.os.Handler;
import android.os.IBinder;
import android.os.Looper;
@@ -84,6 +85,7 @@
static final boolean DEBUG_APP = DEBUG || false;
static final boolean DEBUG_SAVED_STATE = DEBUG || false;
static final boolean DEBUG_STATES = DEBUG || false;
+ static final boolean DEBUG_IDLE = DEBUG || false;
public static final int HOME_STACK_ID = 0;
@@ -347,11 +349,12 @@
+ hr.intent.getComponent().flattenToShortString(), e);
throw e;
}
- } else {
- stack.ensureActivitiesVisibleLocked(hr, null, processName, 0, false);
}
}
}
+ if (!didSomething) {
+ ensureActivitiesVisibleLocked(null, 0);
+ }
return didSomething;
}
@@ -1637,6 +1640,8 @@
ActivityRecord r = ActivityRecord.forToken(token);
if (r != null) {
+ if (DEBUG_IDLE) Slog.d(TAG, "activityIdleInternalLocked: Callers=" +
+ Debug.getCallers(4));
mHandler.removeMessages(IDLE_TIMEOUT_MSG, r);
r.finishLaunchTickingLocked();
res = r.task.stack.activityIdleInternalLocked(token, fromTimeout, config);
@@ -1996,7 +2001,7 @@
}
mStartingUsers.add(uss);
- boolean haveActivities = mHomeStack.switchUserLocked(userId, uss);
+ boolean haveActivities = mHomeStack.switchUserLocked(userId);
resumeTopActivitiesLocked();
@@ -2211,6 +2216,7 @@
}
void scheduleIdleTimeoutLocked(ActivityRecord next) {
+ if (DEBUG_IDLE) Slog.d(TAG, "scheduleIdleTimeoutLocked: Callers=" + Debug.getCallers(4));
Message msg = mHandler.obtainMessage(IDLE_TIMEOUT_MSG, next);
mHandler.sendMessageDelayed(msg, IDLE_TIMEOUT);
}
@@ -2220,6 +2226,7 @@
}
void removeTimeoutsForActivityLocked(ActivityRecord r) {
+ if (DEBUG_IDLE) Slog.d(TAG, "removeTimeoutsForActivity: Callers=" + Debug.getCallers(4));
mHandler.removeMessages(IDLE_TIMEOUT_MSG, r);
}
@@ -2243,6 +2250,8 @@
public void handleMessage(Message msg) {
switch (msg.what) {
case IDLE_TIMEOUT_MSG: {
+ if (DEBUG_IDLE) Slog.d(TAG, "handleMessage: IDLE_TIMEOUT_MSG: Callers=" +
+ Debug.getCallers(4));
if (mService.mDidDexOpt) {
mService.mDidDexOpt = false;
Message nmsg = mHandler.obtainMessage(IDLE_TIMEOUT_MSG);