Loading services/core/java/com/android/server/am/ActivityRecord.java +9 −12 Original line number Original line Diff line number Diff line Loading @@ -982,24 +982,21 @@ final class ActivityRecord { } } private ActivityRecord getWaitingHistoryRecordLocked() { private ActivityRecord getWaitingHistoryRecordLocked() { // First find the real culprit... if we are waiting // First find the real culprit... if this activity is waiting for // for another app to start, then we have paused dispatching // another activity to start or has stopped, then the key dispatching // for this activity. // timeout should not be caused by this. ActivityRecord r = this; if (waitingVisible || stopped) { if (r.waitingVisible) { final ActivityStack stack = mStackSupervisor.getFocusedStack(); final ActivityStack stack = mStackSupervisor.getFocusedStack(); // Hmmm, who might we be waiting for? // Try to use the one which is closest to top. r = stack.mResumedActivity; ActivityRecord r = stack.mResumedActivity; if (r == null) { if (r == null) { r = stack.mPausingActivity; r = stack.mPausingActivity; } } // Both of those null? Fall back to 'this' again if (r != null) { if (r == null) { return r; r = this; } } } } return this; return r; } } public boolean keyDispatchingTimedOut(String reason) { public boolean keyDispatchingTimedOut(String reason) { Loading services/core/java/com/android/server/am/ActivityStackSupervisor.java +7 −3 Original line number Original line Diff line number Diff line Loading @@ -607,17 +607,21 @@ public final class ActivityStackSupervisor implements DisplayListener { } } boolean allResumedActivitiesVisible() { boolean allResumedActivitiesVisible() { boolean foundResumed = false; for (int displayNdx = mActivityDisplays.size() - 1; displayNdx >= 0; --displayNdx) { for (int displayNdx = mActivityDisplays.size() - 1; displayNdx >= 0; --displayNdx) { ArrayList<ActivityStack> stacks = mActivityDisplays.valueAt(displayNdx).mStacks; ArrayList<ActivityStack> stacks = mActivityDisplays.valueAt(displayNdx).mStacks; for (int stackNdx = stacks.size() - 1; stackNdx >= 0; --stackNdx) { for (int stackNdx = stacks.size() - 1; stackNdx >= 0; --stackNdx) { final ActivityStack stack = stacks.get(stackNdx); final ActivityStack stack = stacks.get(stackNdx); final ActivityRecord r = stack.mResumedActivity; final ActivityRecord r = stack.mResumedActivity; if (r != null && (!r.nowVisible || r.waitingVisible)) { if (r != null) { if (!r.nowVisible || r.waitingVisible) { return false; return false; } } foundResumed = true; } } } } return true; } return foundResumed; } } /** /** Loading Loading
services/core/java/com/android/server/am/ActivityRecord.java +9 −12 Original line number Original line Diff line number Diff line Loading @@ -982,24 +982,21 @@ final class ActivityRecord { } } private ActivityRecord getWaitingHistoryRecordLocked() { private ActivityRecord getWaitingHistoryRecordLocked() { // First find the real culprit... if we are waiting // First find the real culprit... if this activity is waiting for // for another app to start, then we have paused dispatching // another activity to start or has stopped, then the key dispatching // for this activity. // timeout should not be caused by this. ActivityRecord r = this; if (waitingVisible || stopped) { if (r.waitingVisible) { final ActivityStack stack = mStackSupervisor.getFocusedStack(); final ActivityStack stack = mStackSupervisor.getFocusedStack(); // Hmmm, who might we be waiting for? // Try to use the one which is closest to top. r = stack.mResumedActivity; ActivityRecord r = stack.mResumedActivity; if (r == null) { if (r == null) { r = stack.mPausingActivity; r = stack.mPausingActivity; } } // Both of those null? Fall back to 'this' again if (r != null) { if (r == null) { return r; r = this; } } } } return this; return r; } } public boolean keyDispatchingTimedOut(String reason) { public boolean keyDispatchingTimedOut(String reason) { Loading
services/core/java/com/android/server/am/ActivityStackSupervisor.java +7 −3 Original line number Original line Diff line number Diff line Loading @@ -607,17 +607,21 @@ public final class ActivityStackSupervisor implements DisplayListener { } } boolean allResumedActivitiesVisible() { boolean allResumedActivitiesVisible() { boolean foundResumed = false; for (int displayNdx = mActivityDisplays.size() - 1; displayNdx >= 0; --displayNdx) { for (int displayNdx = mActivityDisplays.size() - 1; displayNdx >= 0; --displayNdx) { ArrayList<ActivityStack> stacks = mActivityDisplays.valueAt(displayNdx).mStacks; ArrayList<ActivityStack> stacks = mActivityDisplays.valueAt(displayNdx).mStacks; for (int stackNdx = stacks.size() - 1; stackNdx >= 0; --stackNdx) { for (int stackNdx = stacks.size() - 1; stackNdx >= 0; --stackNdx) { final ActivityStack stack = stacks.get(stackNdx); final ActivityStack stack = stacks.get(stackNdx); final ActivityRecord r = stack.mResumedActivity; final ActivityRecord r = stack.mResumedActivity; if (r != null && (!r.nowVisible || r.waitingVisible)) { if (r != null) { if (!r.nowVisible || r.waitingVisible) { return false; return false; } } foundResumed = true; } } } } return true; } return foundResumed; } } /** /** Loading