Skip to content

Commit

Permalink
Properly handle onNullBinding() in appwidget service.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
pinyaoting authored and aoleary committed Dec 30, 2024
1 parent 8e54079 commit e98c9da
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions core/java/android/widget/RemoteViewsAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,11 @@ public void onServiceDisconnected(ComponentName name) {
}
}

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

@Override
public void handleMessage(Message msg) {
RemoteViewsAdapter adapter = mAdapter.get();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1863,6 +1863,11 @@ public void onServiceConnected(ComponentName name, IBinder service) {
mContext.unbindService(this);
}

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

@Override
public void onServiceDisconnected(ComponentName name) {
// Do nothing
Expand Down Expand Up @@ -2003,6 +2008,11 @@ public void onServiceConnected(ComponentName name, IBinder service) {
mContext.unbindService(this);
}

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

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

0 comments on commit e98c9da

Please sign in to comment.