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

Commit 286f0692 authored by Jeff Sharkey's avatar Jeff Sharkey Committed by Android (Google) Code Review
Browse files

Merge "Only bind to RESOLVE_EPHEMERAL_PACKAGE once." into nyc-mr1-dev

parents 43905cc9 7765d732
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -56,6 +56,7 @@ final class EphemeralResolverConnection {
    /** Intent used to bind to the service */
    private final Intent mIntent;

    private volatile boolean mBindRequested;
    private IEphemeralResolver mRemoteInstance;

    public EphemeralResolverConnection(Context context, ComponentName componentName) {
@@ -111,8 +112,11 @@ final class EphemeralResolverConnection {
            return;
        }

        if (!mBindRequested) {
            mBindRequested = true;
            mContext.bindServiceAsUser(mIntent, mServiceConnection,
                    Context.BIND_AUTO_CREATE | Context.BIND_FOREGROUND_SERVICE, UserHandle.SYSTEM);
        }

        final long startMillis = SystemClock.uptimeMillis();
        while (true) {