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

Commit 1c5d9b5b authored by Christofer Åkersten's avatar Christofer Åkersten Committed by android-build-merger
Browse files

Merge "Ensure members are non-null in callback" into pi-dev

am: f0927b07

Change-Id: I15359e1ee1f5e79d29bd4408f8eb56dcf93cfd39
parents 9824f774 f0927b07
Loading
Loading
Loading
Loading
+11 −6
Original line number Diff line number Diff line
@@ -775,8 +775,7 @@ public final class MediaSessionManager {
                        public void run() {
                            final Context context = mContext;
                            if (context != null) {
                                ArrayList<MediaController> controllers
                                        = new ArrayList<MediaController>();
                                ArrayList<MediaController> controllers = new ArrayList<>();
                                int size = tokens.size();
                                for (int i = 0; i < size; i++) {
                                    controllers.add(new MediaController(context, tokens.get(i)));
@@ -814,11 +813,17 @@ public final class MediaSessionManager {
        private final ISessionTokensListener.Stub mStub = new ISessionTokensListener.Stub() {
            @Override
            public void onSessionTokensChanged(final List<Bundle> bundles) {
                mExecutor.execute(() -> {
                    List<SessionToken2> tokens = toTokenList(mContext, bundles);
                    mListener.onSessionTokensChanged(tokens);
                final Executor executor = mExecutor;
                if (executor != null) {
                    executor.execute(() -> {
                        final Context context = mContext;
                        final OnSessionTokensChangedListener listener = mListener;
                        if (context != null && listener != null) {
                            listener.onSessionTokensChanged(toTokenList(context, bundles));
                        }
                    });
                }
            }
        };

        private void release() {