diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-04-14 01:10:48 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-04-14 01:10:48 +0000 |
commit | 625d6a1000afeb1c2b35425f2dcc5728069fb43d (patch) | |
tree | fb9478cf7ee6795052bd6bbe8d044ba580ae0e3b /service/java/com/android/server/bluetooth/BluetoothManagerService.java | |
parent | fddc3e5b0cfb74538b00d3039c218c72b7b7df47 (diff) | |
parent | 27edf9302d90d4653808b8752a5d37f429a54f41 (diff) |
Snap for 8451755 from 27edf9302d90d4653808b8752a5d37f429a54f41 to tm-release
Change-Id: I02aa339e30a3d6b2c85150a9ae72984cb3f2be63
Diffstat (limited to 'service/java/com/android/server/bluetooth/BluetoothManagerService.java')
-rw-r--r-- | service/java/com/android/server/bluetooth/BluetoothManagerService.java | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/service/java/com/android/server/bluetooth/BluetoothManagerService.java b/service/java/com/android/server/bluetooth/BluetoothManagerService.java index ff1d861293..4ee392f08d 100644 --- a/service/java/com/android/server/bluetooth/BluetoothManagerService.java +++ b/service/java/com/android/server/bluetooth/BluetoothManagerService.java @@ -1548,14 +1548,7 @@ public class BluetoothManagerService extends IBluetoothManager.Stub { if (DBG) { Log.d(TAG, "User " + userHandle + " switched"); } - - // Save the foreground user id and propagate to BT process after it's restarted - int toUserId = userHandle.getIdentifier(); - if (mForegroundUserId != toUserId) { - mForegroundUserId = toUserId; - } - - mHandler.obtainMessage(MESSAGE_USER_SWITCHED, toUserId, 0).sendToTarget(); + mHandler.obtainMessage(MESSAGE_USER_SWITCHED, userHandle.getIdentifier(), 0).sendToTarget(); } /** @@ -2384,6 +2377,12 @@ public class BluetoothManagerService extends IBluetoothManager.Stub { } mHandler.removeMessages(MESSAGE_USER_SWITCHED); + // Save the foreground user id and propagate to BT process after it's restarted + int toUserId = msg.arg1; + if (mForegroundUserId != toUserId) { + mForegroundUserId = toUserId; + } + /* disable and enable BT when detect a user switch */ if (mBluetooth != null && isEnabled()) { restartForReason(BluetoothProtoEnums.ENABLE_DISABLE_REASON_USER_SWITCH); |