diff options
author | William Escande <wescande@google.com> | 2022-06-10 14:38:55 -0700 |
---|---|---|
committer | William Escande <wescande@google.com> | 2022-06-10 14:41:22 -0700 |
commit | 0599c7752d3a81d23be9df82d9e1793b05bfcb10 (patch) | |
tree | a5dad1916065d64d44466f3c7dc49a2c45372b66 /service/java/com/android/server/bluetooth/BluetoothService.java | |
parent | c8b27571c8caf529a5c4b1c8bcdcdae2449e6edd (diff) |
Delay Bluetooth Start
If bluetooth is started too early, it will need to be restarted to
change its gid.
By delaying the bluetooth start after the OnUserStarting we ensure the
permissions are already set
Fix: 232740613
Test: build & flash with wipe. Check log at first startup
Tag: #refactor
Ignore-AOSP-First: will be push on aosp next
Change-Id: Ifde1348baad5802276679ecc24bc8ae458d02fe6
Diffstat (limited to 'service/java/com/android/server/bluetooth/BluetoothService.java')
-rw-r--r-- | service/java/com/android/server/bluetooth/BluetoothService.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/service/java/com/android/server/bluetooth/BluetoothService.java b/service/java/com/android/server/bluetooth/BluetoothService.java index ff6938e5f6..a729f8213a 100644 --- a/service/java/com/android/server/bluetooth/BluetoothService.java +++ b/service/java/com/android/server/bluetooth/BluetoothService.java @@ -50,8 +50,12 @@ public class BluetoothService extends SystemService { if (phase == SystemService.PHASE_SYSTEM_SERVICES_READY) { publishBinderService(BluetoothAdapter.BLUETOOTH_MANAGER_SERVICE, mBluetoothManagerService); - } else if (phase == SystemService.PHASE_ACTIVITY_MANAGER_READY && - !UserManager.isHeadlessSystemUserMode()) { + } + } + + @Override + public void onUserStarting(@NonNull TargetUser user) { + if (!UserManager.isHeadlessSystemUserMode()) { initialize(); } } |