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

Commit f922271d authored by Eugene Susla's avatar Eugene Susla Committed by android-build-merger
Browse files

Merge "[Companion] Prevent NPE in CallbackProxy" into oc-dr1-dev am: 9e419d30

am: 58582f7a

Change-Id: I7d7faa17db64be9f01735e2fe0ec216a689042d1
parents 1f01222b 58582f7a
Loading
Loading
Loading
Loading
+14 −2
Original line number Diff line number Diff line
@@ -280,12 +280,24 @@ public final class CompanionDeviceManager {

        @Override
        public void onSuccess(PendingIntent launcher) {
            mHandler.post(() -> mCallback.onDeviceFound(launcher.getIntentSender()));
            Handler handler = mHandler;
            if (handler == null) return;
            handler.post(() -> {
                Callback callback = mCallback;
                if (callback == null) return;
                callback.onDeviceFound(launcher.getIntentSender());
            });
        }

        @Override
        public void onFailure(CharSequence reason) {
            mHandler.post(() -> mCallback.onFailure(reason));
            Handler handler = mHandler;
            if (handler == null) return;
            handler.post(() -> {
                Callback callback = mCallback;
                if (callback == null) return;
                callback.onFailure(reason);
            });
        }

        @Override