AW: handle developer mode with a dummy component
This separates developer mode state from the mechanism for plumbing developer mode information. These were previously tied together (we examined the enabled state of the ContentProvider which provided flags over IPC), but we observed an issue on Android Q related to disabling and re-enabling a ContentProvider in the same process. Instead, DeveloperModeContentProvider is always enabled and exported, and we examine the state of DeveloperModeState, which is a dummy component we never launch. While this creates slightly more complex code, this significantly simplifies the runtime behavior, because we no longer need to worry about functional code falling into a non-recoverable disabled state. We use an <activity-alias> as the dummy component because it requires the least amount of boilerplate, and there's little harm if the user somehow successfully launches this component. This also includes temporary workaround code: because the previous versions explicitly disabled the ContentProvider, and PackageManager persists this across upgrades, we need to explicitly reset the component state. To make potential future migrations easier, this updates the disableDeveloperMode() to set the component to DEFAULT rather than DISABLED. Bug: 1041943 Test: Manual - try enabling and disabling developer mode on Android Q Test: Repro the bug with buggy APK, upgrade to this APK, UI works Test: Disable dev mode with buggy APK, upgrade to this APK, UI works Change-Id: I410f36fa590026ddc53837f076e6b5912fa075f4 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2005973Reviewed-by:Richard Coles <torne@chromium.org> Commit-Queue: Nate Fischer <ntfschr@chromium.org> Cr-Commit-Position: refs/heads/master@{#734546}
Showing
Please register or sign in to comment