summaryrefslogtreecommitdiff
path: root/libs/androidfw/ZipFileRO.cpp
diff options
context:
space:
mode:
author Chris Göllner <chrisgollner@google.com> 2023-09-05 14:50:36 +0100
committer Chris Göllner <chrisgollner@google.com> 2023-09-05 14:56:55 +0100
commit1f77cf96b297487e4937d75f396c9b24ef5aee8b (patch)
tree6d4a38f2b49f1bd2995ef005c94b37f5204d8c81 /libs/androidfw/ZipFileRO.cpp
parent61e1769c1bf040318d3c004b2c38185a4c12ad97 (diff)
Lazily inject NotifPresenter & NotifActivStarter into CentralSurfaces.
This is needed to not crash after completing the partial screen sharing dialog in a secondary user. When the partial screen sharing dialog is launched from an application that is *not* in the primary user (e.g. it's launched from work profile), that dialog is started in a *secondary* SysUI process. This secondary SysUI process has a separate Dagger graph, and most of the Dagger graph is not instantiated on startup because it's not referenced, because only the CoreStartables labelled with `@PerUser` are started (and almost all of our CoreStartables are *not* per user). Once this very small Dagger graph is instantiated, InitController runs any post init tasks (of which there are none). Later, once the user completes the partial screen sharing dialog, MediaProjectionPermissionActivity launches an activity using ActivityStarterImpl. That class eventually triggers OpaEnabledDispatcher#dispatchUnchecked. That method requests CentralSurfaces, which means the CentralSurfaces part of the Dagger graph suddently gets instantiated after initial process startup. StatusBarNotificationPresenter is injected into CentralSurfaces, so the notification presenter is created. On the presenter's creation, it adds some post init tasks, but those tasks have been completed long ago, leading to the crash. This change updates the notif presenter to be injected *lazily* into CentralSurfaces, so that creating CentralSurfaces doesn't also create the notif presenter. Because this dialog doesn't use any notif presenter code directly, the presenter is never created and never requests post init tasks after init has finished. This change also makes the NotificationActivityStarter lazily injected because the activity starter also injects the presenter. Bug: 298099682 Test: Launch partial screen share dialog from work profile -> complete dialog -> verify no crash and verify via logging that StatusBarNotificationPresenter is never instantiated (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:2efc5dc7673f62a3dd47649adac1658095415d28) Merged-In: I3647d583623d6c4a6ddef60301d4a3da8dd9207a Change-Id: I001c89a772a35913c37bd3d47dc7988d8400a47f
Diffstat (limited to 'libs/androidfw/ZipFileRO.cpp')
0 files changed, 0 insertions, 0 deletions