From d6f0a5c2430803d6b8642b1395a4c837867411ba Mon Sep 17 00:00:00 2001 From: Jorim Jaggi Date: Mon, 8 Jul 2019 16:53:08 +0200 Subject: Launch recents from main thread Such that binder response inherits our nice scheduling characteristics. The old logic isn't really needed anymore, as we don't do anything interesting on the main thread. Test: Open app from recents Fixes: 136111411 Change-Id: Ibfb0f60113bc0d9d94844ea4cde0e78723183eb2 --- .../shared/system/ActivityManagerWrapper.java | 36 +++++++++------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/system/ActivityManagerWrapper.java b/packages/SystemUI/shared/src/com/android/systemui/shared/system/ActivityManagerWrapper.java index a2abb4b1695c..506813beadf6 100644 --- a/packages/SystemUI/shared/src/com/android/systemui/shared/system/ActivityManagerWrapper.java +++ b/packages/SystemUI/shared/src/com/android/systemui/shared/system/ActivityManagerWrapper.java @@ -307,28 +307,22 @@ public class ActivityManagerWrapper { } final ActivityOptions finalOptions = options; - // Execute this from another thread such that we can do other things (like caching the - // bitmap for the thumbnail) while AM is busy starting our activity. - mBackgroundExecutor.submit(new Runnable() { - @Override - public void run() { - boolean result = false; - try { - result = startActivityFromRecents(taskKey.id, finalOptions); - } catch (Exception e) { - // Fall through - } - final boolean finalResult = result; - if (resultCallback != null) { - resultCallbackHandler.post(new Runnable() { - @Override - public void run() { - resultCallback.accept(finalResult); - } - }); + + boolean result = false; + try { + result = startActivityFromRecents(taskKey.id, finalOptions); + } catch (Exception e) { + // Fall through + } + final boolean finalResult = result; + if (resultCallback != null) { + resultCallbackHandler.post(new Runnable() { + @Override + public void run() { + resultCallback.accept(finalResult); } - } - }); + }); + } } /** -- cgit v1.2.3-59-g8ed1b