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

Commit 20209e9c authored by Pinyao Ting's avatar Pinyao Ting Committed by Android Build Coastguard Worker
Browse files

Properly handle onNullBinding() in appwidget service.


Bug: 340239088
Test: manually verified with the PoC app
Flag: EXEMPT CVE
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:9e1c31ba46178a8cfc68a2dd9984b8223f694c81)
Merged-In: I12fccb572e159a73785aa33a4f5204e094ccd1b7
Change-Id: I12fccb572e159a73785aa33a4f5204e094ccd1b7
parent 8b1a0f9a
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -240,6 +240,11 @@ public class RemoteViewsAdapter extends BaseAdapter implements Handler.Callback
            }
        }

        @Override
        public void onNullBinding(ComponentName name) {
            enqueueDeferredUnbindServiceMessage();
        }

        @Override
        public void handleMessage(Message msg) {
            RemoteViewsAdapter adapter = mAdapter.get();
+10 −0
Original line number Diff line number Diff line
@@ -1798,6 +1798,11 @@ class AppWidgetServiceImpl extends IAppWidgetService.Stub implements WidgetBacku
                mContext.unbindService(this);
            }

            @Override
            public void onNullBinding(ComponentName name) {
                mContext.unbindService(this);
            }

            @Override
            public void onServiceDisconnected(ComponentName name) {
                // Do nothing
@@ -1938,6 +1943,11 @@ class AppWidgetServiceImpl extends IAppWidgetService.Stub implements WidgetBacku
                                mContext.unbindService(this);
                            }

                            @Override
                            public void onNullBinding(ComponentName name) {
                                mContext.unbindService(this);
                            }

                            @Override
                            public void onServiceDisconnected(android.content.ComponentName name) {
                                // Do nothing