frameworks/base
Revisión | bdbf96c117553153589086cf29a848accf075a01 (tree) |
---|---|
Tiempo | 2020-12-21 03:13:27 |
Autor | wilsonshih <wilsonshih@goog...> |
Commiter | Kevin Haggerty |
Make WallpaperMS bind wallpaper component PendingIntent immutable.
Require that the PendingIntent be immutable so that a malicious app is
not able to hijack and mutate any of the details.
Fixes: 154915372
Test: build & flash, change wallpaper manually.
Change-Id: I59b48811b26736bf0575769107dd940ca33ccf8d
(cherry picked from commit d4bd69cef05d379555418a8fe748ec94ff6bd6d0)
(cherry picked from commit b392903052b3c35b5b9706d6d1f19762d943f58e)
@@ -1747,7 +1747,7 @@ public class WallpaperManagerService extends IWallpaperManager.Stub { | ||
1747 | 1747 | mContext, 0, |
1748 | 1748 | Intent.createChooser(new Intent(Intent.ACTION_SET_WALLPAPER), |
1749 | 1749 | mContext.getText(com.android.internal.R.string.chooser_wallpaper)), |
1750 | - 0, null, new UserHandle(serviceUserId))); | |
1750 | + PendingIntent.FLAG_IMMUTABLE, null, new UserHandle(serviceUserId))); | |
1751 | 1751 | if (!mContext.bindServiceAsUser(intent, newConn, |
1752 | 1752 | Context.BIND_AUTO_CREATE | Context.BIND_SHOWING_UI |
1753 | 1753 | | Context.BIND_FOREGROUND_SERVICE_WHILE_AWAKE, |