diff options
| author | 2016-12-06 11:46:56 -0800 | |
|---|---|---|
| committer | 2016-12-08 17:49:09 -0800 | |
| commit | 2fe1990ba779ef3fdb77cc596ff9eefeaeef613d (patch) | |
| tree | 094c4733879d99923355ff240f949ab9aaf2f3f7 | |
| parent | 31f2e918923112812f073c318487fd82282d0fd2 (diff) | |
[DO NOT MERGE] Increased user switch timeout to 3s
Also report the actual delay if sendResult is eventually called.
Test: Manual - device boots, no timeouts
Bug: 30813554
Change-Id: I1271181ab9d2653fad1167049c84a6780ad46ff0
| -rw-r--r-- | services/core/java/com/android/server/am/UserController.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/am/UserController.java b/services/core/java/com/android/server/am/UserController.java index 4bc148bef290..1ef3728c6444 100644 --- a/services/core/java/com/android/server/am/UserController.java +++ b/services/core/java/com/android/server/am/UserController.java @@ -112,7 +112,7 @@ final class UserController { // Amount of time we wait for observers to handle a user switch before // giving up on them and unfreezing the screen. - static final int USER_SWITCH_TIMEOUT = 2 * 1000; + static final int USER_SWITCH_TIMEOUT = 3 * 1000; private final ActivityManagerService mService; private final Handler mHandler; @@ -1085,6 +1085,7 @@ final class UserController { mCurWaitingUserSwitchCallbacks = curWaitingUserSwitchCallbacks; } final AtomicInteger waitingCallbacksCount = new AtomicInteger(observerCount); + final long dispatchStartedTime = SystemClock.elapsedRealtime(); for (int i = 0; i < observerCount; i++) { try { // Prepend with unique prefix to guarantee that keys are unique @@ -1096,6 +1097,11 @@ final class UserController { @Override public void sendResult(Bundle data) throws RemoteException { synchronized (mService) { + long delay = SystemClock.elapsedRealtime() - dispatchStartedTime; + if (delay > USER_SWITCH_TIMEOUT) { + Slog.wtf(TAG, "User switch timeout: observer " + name + + " sent result after " + delay + " ms"); + } // Early return if this session is no longer valid if (curWaitingUserSwitchCallbacks != mCurWaitingUserSwitchCallbacks) { |