Loading services/core/java/com/android/server/BluetoothService.java +15 −2 Original line number Diff line number Diff line Loading @@ -18,15 +18,26 @@ package com.android.server; import android.bluetooth.BluetoothAdapter; import android.content.Context; import android.os.SystemProperties; class BluetoothService extends SystemService { private static final String HEADLESS_SYSTEM_USER = "android.car.systemuser.headless"; private BluetoothManagerService mBluetoothManagerService; private boolean mInitialized = false; public BluetoothService(Context context) { super(context); mBluetoothManagerService = new BluetoothManagerService(context); } private void initialize() { if (!mInitialized) { mBluetoothManagerService.handleOnBootPhase(); mInitialized = true; } } @Override public void onStart() { } Loading @@ -36,13 +47,15 @@ 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) { mBluetoothManagerService.handleOnBootPhase(); } else if (phase == SystemService.PHASE_ACTIVITY_MANAGER_READY && !SystemProperties.getBoolean(HEADLESS_SYSTEM_USER, false)) { initialize(); } } @Override public void onSwitchUser(int userHandle) { initialize(); mBluetoothManagerService.handleOnSwitchUser(userHandle); } Loading Loading
services/core/java/com/android/server/BluetoothService.java +15 −2 Original line number Diff line number Diff line Loading @@ -18,15 +18,26 @@ package com.android.server; import android.bluetooth.BluetoothAdapter; import android.content.Context; import android.os.SystemProperties; class BluetoothService extends SystemService { private static final String HEADLESS_SYSTEM_USER = "android.car.systemuser.headless"; private BluetoothManagerService mBluetoothManagerService; private boolean mInitialized = false; public BluetoothService(Context context) { super(context); mBluetoothManagerService = new BluetoothManagerService(context); } private void initialize() { if (!mInitialized) { mBluetoothManagerService.handleOnBootPhase(); mInitialized = true; } } @Override public void onStart() { } Loading @@ -36,13 +47,15 @@ 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) { mBluetoothManagerService.handleOnBootPhase(); } else if (phase == SystemService.PHASE_ACTIVITY_MANAGER_READY && !SystemProperties.getBoolean(HEADLESS_SYSTEM_USER, false)) { initialize(); } } @Override public void onSwitchUser(int userHandle) { initialize(); mBluetoothManagerService.handleOnSwitchUser(userHandle); } Loading