Merge "Copy resume callbacks list prior to making callbacks" into ub-launcher3-qt-dev

am: 094e5638a5

Change-Id: Ia3e9088f6341ebc37fd1286e12191cdd8776c64f
This commit is contained in:
Winson Chung 2019-07-10 13:59:06 -07:00 committed by android-build-merger
commit 24fbe81e99
1 changed files with 7 additions and 3 deletions

View File

@ -952,10 +952,14 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns,
mHandler.removeCallbacks(mHandleDeferredResume);
Utilities.postAsyncCallback(mHandler, mHandleDeferredResume);
for (OnResumeCallback cb : mOnResumeCallbacks) {
cb.onLauncherResume();
}
if (!mOnResumeCallbacks.isEmpty()) {
final ArrayList<OnResumeCallback> resumeCallbacks = new ArrayList<>(mOnResumeCallbacks);
mOnResumeCallbacks.clear();
for (int i = resumeCallbacks.size() - 1; i >= 0; i--) {
resumeCallbacks.get(i).onLauncherResume();
}
resumeCallbacks.clear();
}
if (mLauncherCallbacks != null) {
mLauncherCallbacks.onResume();