Skip to content

pm/install: wait for dexopt to finish before prepPerformDexoptIfNeede…#230

Closed
octocorvus wants to merge 1 commit into
GrapheneOS:16from
octocorvus:npe-fix-while-broken-package-2
Closed

pm/install: wait for dexopt to finish before prepPerformDexoptIfNeede…#230
octocorvus wants to merge 1 commit into
GrapheneOS:16from
octocorvus:npe-fix-while-broken-package-2

Conversation

@octocorvus
Copy link
Copy Markdown
Member

@octocorvus octocorvus commented Jul 17, 2025

…d returns

In Android 16, dexopt was made asynchronous. This caused installPackagesTraced() to return before commitInstallPackages() ran. When multiple install sessions of the same APK were started (e.g. by double-tapping install button or running adb install in parallel), the installation steps from different sessions interleaved. This led to various issues (if device was not rebooted after install):

  • duplicate intent filters
  • duplicated app entry
  • system crash on app uninstall

This change blocks in prepPerformDexoptIfNeeded() until dexopt is finished and then runs doPostDexopt (actionsAfterReboot) synchronously. All package installation steps now complete before installPackagesTraced() returns.

Test: Run multiple adb installs of the same app.

  • Check adb shell dumpsys package : no duplicates
  • Uninstall the app: no system crash

Closes GrapheneOS/os-issue-tracker#5782

…d returns

In Android 16, dexopt was made asynchronous. This caused
installPackagesTraced() to return before commitInstallPackages() ran.
When multiple install sessions of the same APK were started (e.g. by
double-tapping install button or running adb install in parallel), the
installation steps from different sessions interleaved. This led to
various issues (if device was not rebooted after install):
- duplicate intent filters
- duplicated app entry
- system crash on app uninstall

This change blocks in prepPerformDexoptIfNeeded() until dexopt is
finished and then runs doPostDexopt (actionsAfterReboot) synchronously.
All package installation steps now complete before
installPackagesTraced() returns.

Test: Run multiple adb installs of the same app.
- Check adb shell dumpsys package <pkgname>: no duplicates
- Uninstall the app: no system crash

Closes GrapheneOS/os-issue-tracker#5782
@octocorvus octocorvus force-pushed the npe-fix-while-broken-package-2 branch from 736cb4b to a9c1b1f Compare July 18, 2025 05:51
@octocorvus octocorvus closed this Jul 18, 2025
octocorvus added a commit to octocorvus/platform_frameworks_base that referenced this pull request Jul 20, 2025
octocorvus added a commit to octocorvus/platform_frameworks_base that referenced this pull request Jul 22, 2025
octocorvus added a commit to octocorvus/platform_frameworks_base that referenced this pull request Jul 24, 2025
octocorvus added a commit to octocorvus/platform_frameworks_base that referenced this pull request Jul 24, 2025
octocorvus added a commit to octocorvus/platform_frameworks_base that referenced this pull request Jul 24, 2025
octocorvus added a commit to octocorvus/platform_frameworks_base that referenced this pull request Jul 25, 2025
octocorvus added a commit to octocorvus/platform_frameworks_base that referenced this pull request Jul 25, 2025
muhomorr added a commit to muhomorr/platform_frameworks_base that referenced this pull request Jul 27, 2025
Async dexopt was added in Android 16. It has introduced a bug in handling of concurrent installs
of the same package. Such installs started to corrupt the internal PackageManager state of the
affected packages, which led to system_server crashes when attempting to uninstall them.

As a workaround, this commit makes the package installer reject install requests for packages that
are already being installed (package updates are considered to be installs too).

For more info, see GrapheneOS#230
Based on GrapheneOS#234
muhomorr added a commit to muhomorr/platform_frameworks_base that referenced this pull request Jul 27, 2025
Async dexopt was added in Android 16. It has introduced a bug in handling of concurrent installs
of the same package. Such installs started to corrupt the internal PackageManager state of the
affected packages, which led to system_server crashes when attempting to uninstall them.

As a workaround, this commit makes the package installer reject install requests for packages that
are already being installed (package updates are considered to be installs too).

For more info, see GrapheneOS#230
Based on GrapheneOS#234
muhomorr added a commit to muhomorr/platform_frameworks_base that referenced this pull request Jul 27, 2025
Async dexopt was added in Android 16. It has introduced a bug in handling of concurrent installs
of the same package. Such installs started to corrupt the internal PackageManager state of the
affected packages, which led to system_server crashes when attempting to uninstall them.

As a workaround, this commit makes the package installer reject install requests for packages that
are already being installed (package updates are considered to be installs too).

For more info, see GrapheneOS#230
Based on GrapheneOS#234
thestinger pushed a commit that referenced this pull request Jul 27, 2025
Async dexopt was added in Android 16. It has introduced a bug in handling of concurrent installs
of the same package. Such installs started to corrupt the internal PackageManager state of the
affected packages, which led to system_server crashes when attempting to uninstall them.

As a workaround, this commit makes the package installer reject install requests for packages that
are already being installed (package updates are considered to be installs too).

For more info, see #230
Based on #234
joeyhuab pushed a commit to Evolution-X/frameworks_base_old that referenced this pull request Jul 29, 2025
Async dexopt was added in Android 16. It has introduced a bug in handling of concurrent installs
of the same package. Such installs started to corrupt the internal PackageManager state of the
affected packages, which led to system_server crashes when attempting to uninstall them.

As a workaround, this commit makes the package installer reject install requests for packages that
are already being installed (package updates are considered to be installs too).

For more info, see GrapheneOS/platform_frameworks_base#230
Based on GrapheneOS/platform_frameworks_base#234
joeyhuab pushed a commit to Evolution-X/frameworks_base_old that referenced this pull request Jul 30, 2025
Async dexopt was added in Android 16. It has introduced a bug in handling of concurrent installs
of the same package. Such installs started to corrupt the internal PackageManager state of the
affected packages, which led to system_server crashes when attempting to uninstall them.

As a workaround, this commit makes the package installer reject install requests for packages that
are already being installed (package updates are considered to be installs too).

For more info, see GrapheneOS/platform_frameworks_base#230
Based on GrapheneOS/platform_frameworks_base#234
Ghosuto pushed a commit to Lunaris-AOSP/frameworks_base_old that referenced this pull request Jul 30, 2025
Async dexopt was added in Android 16. It has introduced a bug in handling of concurrent installs
of the same package. Such installs started to corrupt the internal PackageManager state of the
affected packages, which led to system_server crashes when attempting to uninstall them.

As a workaround, this commit makes the package installer reject install requests for packages that
are already being installed (package updates are considered to be installs too).

For more info, see GrapheneOS/platform_frameworks_base#230
Based on GrapheneOS/platform_frameworks_base#234
shutter-cat pushed a commit to VoltageOS-staging/frameworks_base_new that referenced this pull request Jul 31, 2025
Async dexopt was added in Android 16. It has introduced a bug in handling of concurrent installs
of the same package. Such installs started to corrupt the internal PackageManager state of the
affected packages, which led to system_server crashes when attempting to uninstall them.

As a workaround, this commit makes the package installer reject install requests for packages that
are already being installed (package updates are considered to be installs too).

For more info, see GrapheneOS#230
Based on GrapheneOS#234

Signed-off-by: Dmitrii <bankersenator@gmail.com>
shutter-cat pushed a commit to VoltageOS-staging/frameworks_base_new that referenced this pull request Jul 31, 2025
Async dexopt was added in Android 16. It has introduced a bug in handling of concurrent installs
of the same package. Such installs started to corrupt the internal PackageManager state of the
affected packages, which led to system_server crashes when attempting to uninstall them.

As a workaround, this commit makes the package installer reject install requests for packages that
are already being installed (package updates are considered to be installs too).

For more info, see GrapheneOS#230
Based on GrapheneOS#234

Signed-off-by: Dmitrii <bankersenator@gmail.com>
Ghosuto pushed a commit to Lunaris-AOSP/frameworks_base_old that referenced this pull request Aug 1, 2025
Async dexopt was added in Android 16. It has introduced a bug in handling of concurrent installs
of the same package. Such installs started to corrupt the internal PackageManager state of the
affected packages, which led to system_server crashes when attempting to uninstall them.

As a workaround, this commit makes the package installer reject install requests for packages that
are already being installed (package updates are considered to be installs too).

For more info, see GrapheneOS/platform_frameworks_base#230
Based on GrapheneOS/platform_frameworks_base#234
Ghosuto pushed a commit to Lunaris-AOSP/frameworks_base_old that referenced this pull request Aug 1, 2025
Async dexopt was added in Android 16. It has introduced a bug in handling of concurrent installs
of the same package. Such installs started to corrupt the internal PackageManager state of the
affected packages, which led to system_server crashes when attempting to uninstall them.

As a workaround, this commit makes the package installer reject install requests for packages that
are already being installed (package updates are considered to be installs too).

For more info, see GrapheneOS/platform_frameworks_base#230
Based on GrapheneOS/platform_frameworks_base#234
neobuddy89 pushed a commit to crdroidandroid/android_frameworks_base that referenced this pull request Aug 2, 2025
Async dexopt was added in Android 16. It has introduced a bug in handling of concurrent installs
of the same package. Such installs started to corrupt the internal PackageManager state of the
affected packages, which led to system_server crashes when attempting to uninstall them.

As a workaround, this commit makes the package installer reject install requests for packages that
are already being installed (package updates are considered to be installs too).

For more info, see GrapheneOS/platform_frameworks_base#230
Based on GrapheneOS/platform_frameworks_base#234

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Ghosuto pushed a commit to Lunaris-AOSP/frameworks_base_old that referenced this pull request Aug 3, 2025
Async dexopt was added in Android 16. It has introduced a bug in handling of concurrent installs
of the same package. Such installs started to corrupt the internal PackageManager state of the
affected packages, which led to system_server crashes when attempting to uninstall them.

As a workaround, this commit makes the package installer reject install requests for packages that
are already being installed (package updates are considered to be installs too).

For more info, see GrapheneOS/platform_frameworks_base#230
Based on GrapheneOS/platform_frameworks_base#234
neobuddy89 pushed a commit to crdroidandroid/android_frameworks_base that referenced this pull request Aug 3, 2025
Async dexopt was added in Android 16. It has introduced a bug in handling of concurrent installs
of the same package. Such installs started to corrupt the internal PackageManager state of the
affected packages, which led to system_server crashes when attempting to uninstall them.

As a workaround, this commit makes the package installer reject install requests for packages that
are already being installed (package updates are considered to be installs too).

For more info, see GrapheneOS/platform_frameworks_base#230
Based on GrapheneOS/platform_frameworks_base#234

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Ghosuto pushed a commit to Lunaris-AOSP/frameworks_base_old that referenced this pull request Aug 4, 2025
Async dexopt was added in Android 16. It has introduced a bug in handling of concurrent installs
of the same package. Such installs started to corrupt the internal PackageManager state of the
affected packages, which led to system_server crashes when attempting to uninstall them.

As a workaround, this commit makes the package installer reject install requests for packages that
are already being installed (package updates are considered to be installs too).

For more info, see GrapheneOS/platform_frameworks_base#230
Based on GrapheneOS/platform_frameworks_base#234
xdevs23 pushed a commit to halogenOS/android_frameworks_base that referenced this pull request Aug 4, 2025
Async dexopt was added in Android 16. It has introduced a bug in handling of concurrent installs
of the same package. Such installs started to corrupt the internal PackageManager state of the
affected packages, which led to system_server crashes when attempting to uninstall them.

As a workaround, this commit makes the package installer reject install requests for packages that
are already being installed (package updates are considered to be installs too).

For more info, see GrapheneOS#230
Based on GrapheneOS#234

Signed-off-by: Simão Gomes Viana <devel@superboring.dev>
xdevs23 pushed a commit to halogenOS/android_frameworks_base that referenced this pull request Aug 4, 2025
Async dexopt was added in Android 16. It has introduced a bug in handling of concurrent installs
of the same package. Such installs started to corrupt the internal PackageManager state of the
affected packages, which led to system_server crashes when attempting to uninstall them.

As a workaround, this commit makes the package installer reject install requests for packages that
are already being installed (package updates are considered to be installs too).

For more info, see GrapheneOS#230
Based on GrapheneOS#234

Signed-off-by: Simão Gomes Viana <devel@superboring.dev>
shutter-cat pushed a commit to VoltageOS-staging/frameworks_base_new that referenced this pull request Aug 5, 2025
Async dexopt was added in Android 16. It has introduced a bug in handling of concurrent installs
of the same package. Such installs started to corrupt the internal PackageManager state of the
affected packages, which led to system_server crashes when attempting to uninstall them.

As a workaround, this commit makes the package installer reject install requests for packages that
are already being installed (package updates are considered to be installs too).

For more info, see GrapheneOS#230
Based on GrapheneOS#234

Signed-off-by: Dmitrii <bankersenator@gmail.com>
Ghosuto pushed a commit to Lunaris-AOSP/frameworks_base_old that referenced this pull request Aug 5, 2025
Async dexopt was added in Android 16. It has introduced a bug in handling of concurrent installs
of the same package. Such installs started to corrupt the internal PackageManager state of the
affected packages, which led to system_server crashes when attempting to uninstall them.

As a workaround, this commit makes the package installer reject install requests for packages that
are already being installed (package updates are considered to be installs too).

For more info, see GrapheneOS/platform_frameworks_base#230
Based on GrapheneOS/platform_frameworks_base#234
shutter-cat pushed a commit to VoltageOS-staging/frameworks_base_new that referenced this pull request Aug 8, 2025
Async dexopt was added in Android 16. It has introduced a bug in handling of concurrent installs
of the same package. Such installs started to corrupt the internal PackageManager state of the
affected packages, which led to system_server crashes when attempting to uninstall them.

As a workaround, this commit makes the package installer reject install requests for packages that
are already being installed (package updates are considered to be installs too).

For more info, see GrapheneOS#230
Based on GrapheneOS#234

Signed-off-by: Dmitrii <bankersenator@gmail.com>
ralf979 pushed a commit to Black-Iron-Project/frameworks_base that referenced this pull request Aug 9, 2025
Async dexopt was added in Android 16. It has introduced a bug in handling of concurrent installs
of the same package. Such installs started to corrupt the internal PackageManager state of the
affected packages, which led to system_server crashes when attempting to uninstall them.

As a workaround, this commit makes the package installer reject install requests for packages that
are already being installed (package updates are considered to be installs too).

For more info, see GrapheneOS/platform_frameworks_base#230
Based on GrapheneOS/platform_frameworks_base#234

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
ralf979 pushed a commit to Black-Iron-Project/frameworks_base that referenced this pull request Aug 9, 2025
Async dexopt was added in Android 16. It has introduced a bug in handling of concurrent installs
of the same package. Such installs started to corrupt the internal PackageManager state of the
affected packages, which led to system_server crashes when attempting to uninstall them.

As a workaround, this commit makes the package installer reject install requests for packages that
are already being installed (package updates are considered to be installs too).

For more info, see GrapheneOS/platform_frameworks_base#230
Based on GrapheneOS/platform_frameworks_base#234

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
rmp22 pushed a commit to AxionAOSP/android_frameworks_base that referenced this pull request Aug 10, 2025
Async dexopt was added in Android 16. It has introduced a bug in handling of concurrent installs
of the same package. Such installs started to corrupt the internal PackageManager state of the
affected packages, which led to system_server crashes when attempting to uninstall them.

As a workaround, this commit makes the package installer reject install requests for packages that
are already being installed (package updates are considered to be installs too).

For more info, see GrapheneOS/platform_frameworks_base#230
Based on GrapheneOS/platform_frameworks_base#234

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
shutter-cat pushed a commit to VoltageOS-staging/frameworks_base_new that referenced this pull request Aug 11, 2025
Async dexopt was added in Android 16. It has introduced a bug in handling of concurrent installs
of the same package. Such installs started to corrupt the internal PackageManager state of the
affected packages, which led to system_server crashes when attempting to uninstall them.

As a workaround, this commit makes the package installer reject install requests for packages that
are already being installed (package updates are considered to be installs too).

For more info, see GrapheneOS#230
Based on GrapheneOS#234

Signed-off-by: Dmitrii <bankersenator@gmail.com>
Klozz pushed a commit to TheXPerienceProject/platform_frameworks_base that referenced this pull request Aug 11, 2025
Async dexopt was added in Android 16. It has introduced a bug in handling of concurrent installs
of the same package. Such installs started to corrupt the internal PackageManager state of the
affected packages, which led to system_server crashes when attempting to uninstall them.

As a workaround, this commit makes the package installer reject install requests for packages that
are already being installed (package updates are considered to be installs too).

For more info, see GrapheneOS#230
Based on GrapheneOS#234

Signed-off-by: Dmitrii <bankersenator@gmail.com>
Klozz pushed a commit to TheXPerienceProject/platform_frameworks_base that referenced this pull request Aug 11, 2025
Async dexopt was added in Android 16. It has introduced a bug in handling of concurrent installs
of the same package. Such installs started to corrupt the internal PackageManager state of the
affected packages, which led to system_server crashes when attempting to uninstall them.

As a workaround, this commit makes the package installer reject install requests for packages that
are already being installed (package updates are considered to be installs too).

For more info, see GrapheneOS#230
Based on GrapheneOS#234

Signed-off-by: Dmitrii <bankersenator@gmail.com>
Klozz pushed a commit to TheXPerienceProject/platform_frameworks_base that referenced this pull request Aug 11, 2025
Async dexopt was added in Android 16. It has introduced a bug in handling of concurrent installs
of the same package. Such installs started to corrupt the internal PackageManager state of the
affected packages, which led to system_server crashes when attempting to uninstall them.

As a workaround, this commit makes the package installer reject install requests for packages that
are already being installed (package updates are considered to be installs too).

For more info, see GrapheneOS#230
Based on GrapheneOS#234

Signed-off-by: Dmitrii <bankersenator@gmail.com>
keosh1 pushed a commit to RisingOS-Revived/android_frameworks_base-new that referenced this pull request Aug 12, 2025
Async dexopt was added in Android 16. It has introduced a bug in handling of concurrent installs
of the same package. Such installs started to corrupt the internal PackageManager state of the
affected packages, which led to system_server crashes when attempting to uninstall them.

As a workaround, this commit makes the package installer reject install requests for packages that
are already being installed (package updates are considered to be installs too).

For more info, see GrapheneOS/platform_frameworks_base#230
Based on GrapheneOS/platform_frameworks_base#234
Klozz pushed a commit to TheXPerienceProject/platform_frameworks_base that referenced this pull request Aug 12, 2025
Async dexopt was added in Android 16. It has introduced a bug in handling of concurrent installs
of the same package. Such installs started to corrupt the internal PackageManager state of the
affected packages, which led to system_server crashes when attempting to uninstall them.

As a workaround, this commit makes the package installer reject install requests for packages that
are already being installed (package updates are considered to be installs too).

For more info, see GrapheneOS#230
Based on GrapheneOS#234

Signed-off-by: Dmitrii <bankersenator@gmail.com>
yusufnoor786 pushed a commit to Mist-OS-Staging/frameworks_base_los that referenced this pull request Aug 12, 2025
Async dexopt was added in Android 16. It has introduced a bug in handling of concurrent installs
of the same package. Such installs started to corrupt the internal PackageManager state of the
affected packages, which led to system_server crashes when attempting to uninstall them.

As a workaround, this commit makes the package installer reject install requests for packages that
are already being installed (package updates are considered to be installs too).

For more info, see GrapheneOS/platform_frameworks_base#230
Based on GrapheneOS/platform_frameworks_base#234
neobuddy89 pushed a commit to crdroidandroid/android_frameworks_base that referenced this pull request Aug 13, 2025
Async dexopt was added in Android 16. It has introduced a bug in handling of concurrent installs
of the same package. Such installs started to corrupt the internal PackageManager state of the
affected packages, which led to system_server crashes when attempting to uninstall them.

As a workaround, this commit makes the package installer reject install requests for packages that
are already being installed (package updates are considered to be installs too).

For more info, see GrapheneOS/platform_frameworks_base#230
Based on GrapheneOS/platform_frameworks_base#234

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
joeyhuab pushed a commit to Evolution-X/frameworks_base_old that referenced this pull request Aug 14, 2025
Async dexopt was added in Android 16. It has introduced a bug in handling of concurrent installs
of the same package. Such installs started to corrupt the internal PackageManager state of the
affected packages, which led to system_server crashes when attempting to uninstall them.

As a workaround, this commit makes the package installer reject install requests for packages that
are already being installed (package updates are considered to be installs too).

For more info, see GrapheneOS/platform_frameworks_base#230
Based on GrapheneOS/platform_frameworks_base#234
Ghosuto pushed a commit to Lunaris-AOSP/frameworks_base_old that referenced this pull request Aug 14, 2025
Async dexopt was added in Android 16. It has introduced a bug in handling of concurrent installs
of the same package. Such installs started to corrupt the internal PackageManager state of the
affected packages, which led to system_server crashes when attempting to uninstall them.

As a workaround, this commit makes the package installer reject install requests for packages that
are already being installed (package updates are considered to be installs too).

For more info, see GrapheneOS/platform_frameworks_base#230
Based on GrapheneOS/platform_frameworks_base#234
Ghosuto pushed a commit to Lunaris-AOSP/frameworks_base_old that referenced this pull request Aug 18, 2025
Async dexopt was added in Android 16. It has introduced a bug in handling of concurrent installs
of the same package. Such installs started to corrupt the internal PackageManager state of the
affected packages, which led to system_server crashes when attempting to uninstall them.

As a workaround, this commit makes the package installer reject install requests for packages that
are already being installed (package updates are considered to be installs too).

For more info, see GrapheneOS/platform_frameworks_base#230
Based on GrapheneOS/platform_frameworks_base#234
Ghosuto pushed a commit to Lunaris-AOSP/frameworks_base_old that referenced this pull request Aug 19, 2025
Async dexopt was added in Android 16. It has introduced a bug in handling of concurrent installs
of the same package. Such installs started to corrupt the internal PackageManager state of the
affected packages, which led to system_server crashes when attempting to uninstall them.

As a workaround, this commit makes the package installer reject install requests for packages that
are already being installed (package updates are considered to be installs too).

For more info, see GrapheneOS/platform_frameworks_base#230
Based on GrapheneOS/platform_frameworks_base#234
Ghosuto pushed a commit to Lunaris-AOSP/frameworks_base_old that referenced this pull request Aug 19, 2025
Async dexopt was added in Android 16. It has introduced a bug in handling of concurrent installs
of the same package. Such installs started to corrupt the internal PackageManager state of the
affected packages, which led to system_server crashes when attempting to uninstall them.

As a workaround, this commit makes the package installer reject install requests for packages that
are already being installed (package updates are considered to be installs too).

For more info, see GrapheneOS/platform_frameworks_base#230
Based on GrapheneOS/platform_frameworks_base#234
Ghosuto pushed a commit to Lunaris-AOSP/frameworks_base_old that referenced this pull request Aug 19, 2025
Async dexopt was added in Android 16. It has introduced a bug in handling of concurrent installs
of the same package. Such installs started to corrupt the internal PackageManager state of the
affected packages, which led to system_server crashes when attempting to uninstall them.

As a workaround, this commit makes the package installer reject install requests for packages that
are already being installed (package updates are considered to be installs too).

For more info, see GrapheneOS/platform_frameworks_base#230
Based on GrapheneOS/platform_frameworks_base#234
keosh1 pushed a commit to RisingOS-Revived/android_frameworks_base-new that referenced this pull request Aug 19, 2025
Async dexopt was added in Android 16. It has introduced a bug in handling of concurrent installs
of the same package. Such installs started to corrupt the internal PackageManager state of the
affected packages, which led to system_server crashes when attempting to uninstall them.

As a workaround, this commit makes the package installer reject install requests for packages that
are already being installed (package updates are considered to be installs too).

For more info, see GrapheneOS/platform_frameworks_base#230
Based on GrapheneOS/platform_frameworks_base#234
Ghosuto pushed a commit to Lunaris-AOSP/frameworks_base_old that referenced this pull request Aug 19, 2025
Async dexopt was added in Android 16. It has introduced a bug in handling of concurrent installs
of the same package. Such installs started to corrupt the internal PackageManager state of the
affected packages, which led to system_server crashes when attempting to uninstall them.

As a workaround, this commit makes the package installer reject install requests for packages that
are already being installed (package updates are considered to be installs too).

For more info, see GrapheneOS/platform_frameworks_base#230
Based on GrapheneOS/platform_frameworks_base#234
Ghosuto pushed a commit to Lunaris-AOSP/frameworks_base_old that referenced this pull request Aug 19, 2025
Async dexopt was added in Android 16. It has introduced a bug in handling of concurrent installs
of the same package. Such installs started to corrupt the internal PackageManager state of the
affected packages, which led to system_server crashes when attempting to uninstall them.

As a workaround, this commit makes the package installer reject install requests for packages that
are already being installed (package updates are considered to be installs too).

For more info, see GrapheneOS/platform_frameworks_base#230
Based on GrapheneOS/platform_frameworks_base#234
Klozz pushed a commit to TheXPerienceProject/platform_frameworks_base that referenced this pull request Aug 20, 2025
Async dexopt was added in Android 16. It has introduced a bug in handling of concurrent installs
of the same package. Such installs started to corrupt the internal PackageManager state of the
affected packages, which led to system_server crashes when attempting to uninstall them.

As a workaround, this commit makes the package installer reject install requests for packages that
are already being installed (package updates are considered to be installs too).

For more info, see GrapheneOS#230
Based on GrapheneOS#234

Signed-off-by: Dmitrii <bankersenator@gmail.com>
Signed-off-by: klozz <carlosj@klozz.dev>
neobuddy89 pushed a commit to crdroidandroid/android_frameworks_base that referenced this pull request Aug 20, 2025
Async dexopt was added in Android 16. It has introduced a bug in handling of concurrent installs
of the same package. Such installs started to corrupt the internal PackageManager state of the
affected packages, which led to system_server crashes when attempting to uninstall them.

As a workaround, this commit makes the package installer reject install requests for packages that
are already being installed (package updates are considered to be installs too).

For more info, see GrapheneOS/platform_frameworks_base#230
Based on GrapheneOS/platform_frameworks_base#234

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Ghosuto pushed a commit to Lunaris-AOSP/frameworks_base_old that referenced this pull request Aug 21, 2025
Async dexopt was added in Android 16. It has introduced a bug in handling of concurrent installs
of the same package. Such installs started to corrupt the internal PackageManager state of the
affected packages, which led to system_server crashes when attempting to uninstall them.

As a workaround, this commit makes the package installer reject install requests for packages that
are already being installed (package updates are considered to be installs too).

For more info, see GrapheneOS/platform_frameworks_base#230
Based on GrapheneOS/platform_frameworks_base#234
Ghosuto pushed a commit to Lunaris-AOSP/frameworks_base_old that referenced this pull request Aug 23, 2025
Async dexopt was added in Android 16. It has introduced a bug in handling of concurrent installs
of the same package. Such installs started to corrupt the internal PackageManager state of the
affected packages, which led to system_server crashes when attempting to uninstall them.

As a workaround, this commit makes the package installer reject install requests for packages that
are already being installed (package updates are considered to be installs too).

For more info, see GrapheneOS/platform_frameworks_base#230
Based on GrapheneOS/platform_frameworks_base#234
Ghosuto pushed a commit to Lunaris-AOSP/frameworks_base_old that referenced this pull request Aug 23, 2025
Async dexopt was added in Android 16. It has introduced a bug in handling of concurrent installs
of the same package. Such installs started to corrupt the internal PackageManager state of the
affected packages, which led to system_server crashes when attempting to uninstall them.

As a workaround, this commit makes the package installer reject install requests for packages that
are already being installed (package updates are considered to be installs too).

For more info, see GrapheneOS/platform_frameworks_base#230
Based on GrapheneOS/platform_frameworks_base#234
Ghosuto pushed a commit to Lunaris-AOSP/frameworks_base_old that referenced this pull request Aug 23, 2025
Async dexopt was added in Android 16. It has introduced a bug in handling of concurrent installs
of the same package. Such installs started to corrupt the internal PackageManager state of the
affected packages, which led to system_server crashes when attempting to uninstall them.

As a workaround, this commit makes the package installer reject install requests for packages that
are already being installed (package updates are considered to be installs too).

For more info, see GrapheneOS/platform_frameworks_base#230
Based on GrapheneOS/platform_frameworks_base#234
Ghosuto pushed a commit to Lunaris-AOSP/frameworks_base_old that referenced this pull request Aug 23, 2025
Async dexopt was added in Android 16. It has introduced a bug in handling of concurrent installs
of the same package. Such installs started to corrupt the internal PackageManager state of the
affected packages, which led to system_server crashes when attempting to uninstall them.

As a workaround, this commit makes the package installer reject install requests for packages that
are already being installed (package updates are considered to be installs too).

For more info, see GrapheneOS/platform_frameworks_base#230
Based on GrapheneOS/platform_frameworks_base#234
Ghosuto pushed a commit to Lunaris-AOSP/frameworks_base_old that referenced this pull request Aug 23, 2025
Async dexopt was added in Android 16. It has introduced a bug in handling of concurrent installs
of the same package. Such installs started to corrupt the internal PackageManager state of the
affected packages, which led to system_server crashes when attempting to uninstall them.

As a workaround, this commit makes the package installer reject install requests for packages that
are already being installed (package updates are considered to be installs too).

For more info, see GrapheneOS/platform_frameworks_base#230
Based on GrapheneOS/platform_frameworks_base#234
Ghosuto pushed a commit to Lunaris-AOSP/frameworks_base_old that referenced this pull request Aug 24, 2025
Async dexopt was added in Android 16. It has introduced a bug in handling of concurrent installs
of the same package. Such installs started to corrupt the internal PackageManager state of the
affected packages, which led to system_server crashes when attempting to uninstall them.

As a workaround, this commit makes the package installer reject install requests for packages that
are already being installed (package updates are considered to be installs too).

For more info, see GrapheneOS/platform_frameworks_base#230
Based on GrapheneOS/platform_frameworks_base#234
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

system_server crashes while uninstalling application

1 participant