Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 006cb45e authored by Hsin-chen Chuang's avatar Hsin-chen Chuang
Browse files

BluetoothService: Init Bluetooth if config_bootToHeadlessSystemUser

Bug: 353658877
Test: mmm packages/modules/Bluetooth
Test: build VM
Flag: EXEMPT, a change behind new config
Change-Id: Ib1dc8b5d281b5ac7091fb8103153e4163f035c9b
parent 2dd0f6ca
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@ package com.android.server.bluetooth

import android.bluetooth.BluetoothAdapter
import android.content.Context
import android.content.res.Resources
import android.os.HandlerThread
import android.os.UserManager
import com.android.server.SystemService
@@ -52,7 +53,14 @@ class BluetoothService(context: Context) : SystemService(context) {
    }

    override fun onUserStarting(user: TargetUser) {
        if (!UserManager.isHeadlessSystemUserMode()) {
        if (
            !UserManager.isHeadlessSystemUserMode() ||
                Resources.getSystem()
                    .getBoolean(
                        Resources.getSystem()
                            .getIdentifier("config_bootToHeadlessSystemUser", "bool", "android")
                    )
        ) {
            initialize(user)
        }
    }