)]}'
{
  "commit": "99a8636b41428de9967efc4cb7a8c0be4878eab1",
  "tree": "58afcae29f5fdc673dcb69ce404579577ea5714f",
  "parents": [
    "3b5a2b6707f3aade258b8a44549eb8f83db6ec81"
  ],
  "author": {
    "name": "Chris Li",
    "email": "lihongyu@google.com",
    "time": "Wed Jul 08 13:12:30 2026 +0000"
  },
  "committer": {
    "name": "Android Build Coastguard Worker",
    "email": "android-build-coastguard-worker@google.com",
    "time": "Wed Sep 02 23:41:00 2026 -0700"
  },
  "message": "Preserve calling UID for HeavyWeightSwitcherActivity\n\nWhen an activity launch from an app with cantSaveState\u003d\"true\"\nconflicts with an existing heavy-weight process, ActivityStarter\nintercepts the request in resolveToHeavyWeightSwitcherIfNeeded()\nand reroutes the intent to HeavyWeightSwitcherActivity.\n\nPreviously, resolveToHeavyWeightSwitcherIfNeeded() overwrote\nmRequest.callingUid and callingPid with Binder.getCallingUid()\nand Binder.getCallingPid() after Binder.clearCallingIdentity().\nThis caused the calling UID to be replaced with SYSTEM_UID (1000).\nBecause Background Activity Launch (BAL) evaluation in\ncheckBackgroundActivityStart() evaluates permissions against\nmRequest.callingUid, this overwrite allowed untrusted background\napps to bypass BAL restrictions (via BAL_ALLOW_ALLOWLISTED_UID)\nand launch the switcher activity over any foreground app.\n\nThis change prevents the BAL bypass while ensuring the switcher\nactivity can still be launched:\n1. Preserve the original app Calling UID and PID in mRequest when\n   rerouting to HeavyWeightSwitcherActivity so BAL and Intent\n   Firewall checks are evaluated against the true caller.\n2. Set mRequest.ignoreTargetSecurity \u003d true when rerouting to\n   HeavyWeightSwitcherActivity so that component permission and\n   exported checks in checkStartAnyActivityPermission permit\n   starting the non-exported system activity.\n3. Add unit test coverage in ActivityStarterTests to verify\n   UID/PID preservation, ignoreTargetSecurity assignment, and\n   BAL blocking behavior.\n\nBug: 527036967\nTest: atest WmTests:ActivityStarterTests#testHeavyWeightSwitcher_preservesCallingUid_setsFlag,testHeavyWeightSwitcher_blockedByBal_whenCallerInBackground\nFlag: EXEMPT CVE_FIX\nTAG\u003dagy\nCONV\u003d8361c3cf-3e81-46e5-bfae-2a1df0f05a55\n(cherry picked from commit 038570272e1bffb436ba462a17019ee1591e6ea2)\nCherrypick-From: https://googleplex-android-review.googlesource.com/q/commit:fd53cee662011b8c941ed128c46da310c01d5625\nMerged-In: I00fed9cda203a06ae47089ed8d959ee372aecec7\nChange-Id: I00fed9cda203a06ae47089ed8d959ee372aecec7\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "4463866aa60dd7324e3d9e57a1d731798ac2917e",
      "old_mode": 33188,
      "old_path": "services/core/java/com/android/server/wm/ActivityStarter.java",
      "new_id": "3b1f6847fd7dc0396a69147a5e28b2ad2e7d6f01",
      "new_mode": 33188,
      "new_path": "services/core/java/com/android/server/wm/ActivityStarter.java"
    }
  ]
}
