Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 10b6c41a authored by Matthew Ng's avatar Matthew Ng
Browse files

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
parent b1adae54
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -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,
        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);