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

Commit 004a29a3 authored by wilsonshih's avatar wilsonshih Committed by Anis Assi
Browse files

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 d4bd69ce)
(cherry picked from commit d337ac7a)
parent 9d69c14f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2688,7 +2688,7 @@ public class WallpaperManagerService extends IWallpaperManager.Stub
                    mContext, 0,
                    Intent.createChooser(new Intent(Intent.ACTION_SET_WALLPAPER),
                            mContext.getText(com.android.internal.R.string.chooser_wallpaper)),
                    0, null, new UserHandle(serviceUserId)));
                    PendingIntent.FLAG_IMMUTABLE, null, new UserHandle(serviceUserId)));
            if (!mContext.bindServiceAsUser(intent, newConn,
                    Context.BIND_AUTO_CREATE | Context.BIND_SHOWING_UI
                            | Context.BIND_FOREGROUND_SERVICE_WHILE_AWAKE