)]}'
{
  "commit": "1f77cf96b297487e4937d75f396c9b24ef5aee8b",
  "tree": "6d4a38f2b49f1bd2995ef005c94b37f5204d8c81",
  "parents": [
    "61e1769c1bf040318d3c004b2c38185a4c12ad97"
  ],
  "author": {
    "name": "Chris Göllner",
    "email": "chrisgollner@google.com",
    "time": "Tue Sep 05 14:50:36 2023 +0100"
  },
  "committer": {
    "name": "Chris Göllner",
    "email": "chrisgollner@google.com",
    "time": "Tue Sep 05 14:56:55 2023 +0100"
  },
  "message": "Lazily inject NotifPresenter \u0026 NotifActivStarter into CentralSurfaces.\n\nThis is needed to not crash after completing the partial screen sharing\ndialog in a secondary user.\n\nWhen the partial screen sharing dialog is launched from an application\nthat is *not* in the primary user (e.g. it\u0027s launched from work\nprofile), that dialog is started in a *secondary* SysUI process. This\nsecondary SysUI process has a separate Dagger graph, and most of the\nDagger graph is not instantiated on startup because it\u0027s not referenced,\nbecause only the CoreStartables labelled with `@PerUser` are started\n(and almost all of our CoreStartables are *not* per user). Once this\nvery small Dagger graph is instantiated, InitController runs any post\ninit tasks (of which there are none).\n\nLater, once the user completes the partial screen sharing dialog,\nMediaProjectionPermissionActivity launches an activity using\nActivityStarterImpl. That class eventually triggers\nOpaEnabledDispatcher#dispatchUnchecked. That method requests\nCentralSurfaces, which means the CentralSurfaces part of the Dagger\ngraph suddently gets instantiated after initial process startup.\nStatusBarNotificationPresenter is injected into CentralSurfaces, so the\nnotification presenter is created. On the presenter\u0027s creation, it\nadds some post init tasks, but those tasks have been completed long ago,\nleading to the crash.\n\nThis change updates the notif presenter to be injected *lazily* into\nCentralSurfaces, so that creating CentralSurfaces doesn\u0027t also create\nthe notif presenter. Because this dialog doesn\u0027t use any notif presenter\ncode directly, the presenter is never created and never requests post\ninit tasks after init has finished. This change also makes the\nNotificationActivityStarter lazily injected because the activity starter\nalso injects the presenter.\n\nBug: 298099682\nTest: Launch partial screen share dialog from work profile -\u003e complete\ndialog -\u003e verify no crash and verify via logging that\nStatusBarNotificationPresenter is never instantiated\n(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:2efc5dc7673f62a3dd47649adac1658095415d28)\n\nMerged-In: I3647d583623d6c4a6ddef60301d4a3da8dd9207a\nChange-Id: I001c89a772a35913c37bd3d47dc7988d8400a47f\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "ccb87bf44dc8a3981454ca014802af75409889a3",
      "old_mode": 33188,
      "old_path": "packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java",
      "new_id": "a243356c869026435ca9ad124cacb30ae729d0b0",
      "new_mode": 33188,
      "new_path": "packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java"
    },
    {
      "type": "modify",
      "old_id": "39b2948794508cb67e332d0e28b8a4131c426f94",
      "old_mode": 33188,
      "old_path": "packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesImplTest.java",
      "new_id": "de00747df4e2ec01cd31646c61dc4bc474ec02e9",
      "new_mode": 33188,
      "new_path": "packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesImplTest.java"
    }
  ]
}
