Prevent multiple calls of ActivityThread.systemMain()

Bug: 170591440
Test: manually
Change-Id: Iba6d10e5203fa1c1f96c85e39a57483ee26e8111
(cherry picked from commit 8f2c59c0cb)
This commit is contained in:
Sungsoo Lim
2021-01-06 02:59:37 +00:00
parent 73ba11e97b
commit 9c4853d363

View File

@@ -64,7 +64,7 @@ public class MediaShellCommand extends ShellCommand {
}
if (sThread == null) {
Looper.prepare();
sThread = ActivityThread.systemMain();
sThread = ActivityThread.currentActivityThread();
Context context = sThread.getSystemContext();
sMediaSessionManager =
(MediaSessionManager) context.getSystemService(Context.MEDIA_SESSION_SERVICE);