Fixing lock during RecentsModel initialization

HandlerThread.getLooper blocks the current thread until.
the final thread is initialized. Updating RecentsModel to
use an executor instead of a handler thread to avoid this.

Change-Id: I3b2e82a375ea65bea1526af4a32c6a2488102541
This commit is contained in:
Sunny Goyal
2020-09-25 16:42:58 -07:00
parent 011452a4ce
commit 10759887c2
7 changed files with 142 additions and 80 deletions

View File

@@ -47,7 +47,6 @@ public class OverviewCommandHelper {
private final Context mContext;
private final RecentsAnimationDeviceState mDeviceState;
private final RecentsModel mRecentsModel;
private final OverviewComponentObserver mOverviewComponentObserver;
private long mLastToggleTime;
@@ -56,7 +55,6 @@ public class OverviewCommandHelper {
OverviewComponentObserver observer) {
mContext = context;
mDeviceState = deviceState;
mRecentsModel = RecentsModel.INSTANCE.get(mContext);
mOverviewComponentObserver = observer;
}
@@ -160,7 +158,7 @@ public class OverviewCommandHelper {
ActivityManagerWrapper.getInstance().getRunningTask(), mDeviceState);
// Preload the plan
mRecentsModel.getTasks(null);
RecentsModel.INSTANCE.get(mContext).getTasks(null);
}
@Override