diff options
author | Matthew Ng <ngmatthew@google.com> | 2018-03-26 18:01:37 -0700 |
---|---|---|
committer | Matthew Ng <ngmatthew@google.com> | 2018-03-28 16:27:28 -0700 |
commit | 10b6c41a763ff29243b1e4fcc2598432c404322c (patch) | |
tree | 83cb882d287bb99c048629569f24956c85917626 /packages/SystemUI/src/com/android/systemui/OverviewProxyService.java | |
parent | b1adae546c85a136135ee20334c1db2035457c86 (diff) |
Fixes OpaLayoutTest to pass by adding SysuiTestCase (1/2)
Copied SysuiTestCase to systemui Google to be able to inflate
KeyButtonView that is dependent on StatusBar. Also fixed the connection
failure catch exception when proxy cannot connect to service in tests.
Test: atest com.google.android.systemui.OpaLayoutTest
Change-Id: Ica2a894ce92e06af30c208afcc6a22adeac3a843
Fixes: 76416916
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui/OverviewProxyService.java')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/OverviewProxyService.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/OverviewProxyService.java b/packages/SystemUI/src/com/android/systemui/OverviewProxyService.java index 2983df6ec937..90d1d948d44d 100644 --- a/packages/SystemUI/src/com/android/systemui/OverviewProxyService.java +++ b/packages/SystemUI/src/com/android/systemui/OverviewProxyService.java @@ -227,9 +227,14 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis mHandler.removeCallbacks(mConnectionRunnable); Intent launcherServiceIntent = new Intent(ACTION_QUICKSTEP) .setPackage(mRecentsComponentName.getPackageName()); - boolean bound = mContext.bindServiceAsUser(launcherServiceIntent, - mOverviewServiceConnection, Context.BIND_AUTO_CREATE, - UserHandle.of(mDeviceProvisionedController.getCurrentUser())); + boolean bound = false; + try { + bound = mContext.bindServiceAsUser(launcherServiceIntent, + mOverviewServiceConnection, Context.BIND_AUTO_CREATE, + UserHandle.of(mDeviceProvisionedController.getCurrentUser())); + } catch (SecurityException e) { + Log.e(TAG_OPS, "Unable to bind because of security error", e); + } if (!bound) { // Retry after exponential backoff timeout final long timeoutMs = (long) Math.scalb(BACKOFF_MILLIS, mConnectionBackoffAttempts); |