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

Commit 5f380f46 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Reduce duplicate kill UID calls when granting multiple permissions with GIDs" into main

parents 09eb5eca 73b6e120
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -2722,7 +2722,16 @@ class PermissionService(private val service: AccessCheckingService) :
            runtimePermissionRevokedUids.clear()

            gidsChangedUids.forEachIndexed { _, uid ->
                handler.post { killUid(uid, PermissionManager.KILL_APP_REASON_GIDS_CHANGED) }
                // We must pass a non-null object to avoid matching the true/false being used by
                // the code for runtimePermissionRevokedUids above.
                if (!handler.hasMessages(uid, 0)) {
                    handler
                        .obtainMessage(uid, 0)
                        .setCallback {
                            killUid(uid, PermissionManager.KILL_APP_REASON_GIDS_CHANGED)
                        }
                        .sendToTarget()
                }
            }
            gidsChangedUids.clear()