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

Commit 1b4fee70 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:5b076641fc517b37f1689697130de3cbc22a4c92)
Merged-In: I12fccb572e159a73785aa33a4f5204e094ccd1b7
Change-Id: I12fccb572e159a73785aa33a4f5204e094ccd1b7
parent a2937435
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
@@ -1776,6 +1776,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
@@ -1916,6 +1921,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