From 30c0a02075dd7608caca74c356ebd426cb7aa2b7 Mon Sep 17 00:00:00 2001 From: Matthew Ng Date: Fri, 10 Nov 2017 14:06:29 -0800 Subject: [PATCH] Listen for launcher package added to connect to it faster When launcher is reinstalled, it may take time for it to get ready and to reconnect to. If not available immediately it would try to connect it later after a timeout. Instead of waiting, receive a broadcast when it gets installed to connect immediately. Test: manual - reinstall launcher Bug: 67957962 Change-Id: I1e531db9646d11a1eae99abe46d5e6f852c5eeda --- .../systemui/OverviewProxyService.java | 34 ++++++++++++++----- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/OverviewProxyService.java b/packages/SystemUI/src/com/android/systemui/OverviewProxyService.java index 039e13c41e9a6..fc1c84a7b219a 100644 --- a/packages/SystemUI/src/com/android/systemui/OverviewProxyService.java +++ b/packages/SystemUI/src/com/android/systemui/OverviewProxyService.java @@ -16,16 +16,21 @@ package com.android.systemui; +import android.content.BroadcastReceiver; import android.content.ComponentName; import android.content.Context; import android.content.Intent; +import android.content.IntentFilter; import android.content.ServiceConnection; import android.graphics.Bitmap; import android.graphics.Rect; +import android.net.Uri; import android.os.Binder; +import android.os.Build; import android.os.Handler; import android.os.IBinder; import android.os.Looper; +import android.os.PatternMatcher; import android.os.RemoteException; import android.os.UserHandle; import android.util.Log; @@ -51,6 +56,7 @@ public class OverviewProxyService implements CallbackController mConnectionCallbacks = new ArrayList<>(); @@ -71,6 +77,14 @@ public class OverviewProxyService implements CallbackController