summaryrefslogtreecommitdiff
path: root/service/java/com/android/server/bluetooth/BluetoothManagerService.java
diff options
context:
space:
mode:
authorEtienne Ruffieux <eruffieux@google.com>2022-06-13 16:35:07 -0700
committerEtienne Ruffieux <eruffieux@google.com>2022-06-13 22:06:06 -0700
commit4c71eb4dd13a7acc6c0f66de1f9a0fa8e85d4c41 (patch)
treeb907c9dae84bb880ef26601ce0cc767be4717009 /service/java/com/android/server/bluetooth/BluetoothManagerService.java
parenta409e029a7e868285bb788c80326c97047c8bc3a (diff)
Restore BluetoothOppLauncherActivity default state
Bug: 228849846 Test: atest ManagedProfileTest Tag: #feature Ignore-AOSP-First: cherry-pick Change-Id: I010cf384a8b18a776d8052e87551b8af6fb348cb
Diffstat (limited to 'service/java/com/android/server/bluetooth/BluetoothManagerService.java')
-rw-r--r--service/java/com/android/server/bluetooth/BluetoothManagerService.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/service/java/com/android/server/bluetooth/BluetoothManagerService.java b/service/java/com/android/server/bluetooth/BluetoothManagerService.java
index 0d415cae45..0f2fcc9778 100644
--- a/service/java/com/android/server/bluetooth/BluetoothManagerService.java
+++ b/service/java/com/android/server/bluetooth/BluetoothManagerService.java
@@ -2885,9 +2885,14 @@ public class BluetoothManagerService extends IBluetoothManager.Stub {
final ComponentName oppLauncherComponent = new ComponentName(
mContext.getPackageManager().getPackagesForUid(Process.BLUETOOTH_UID)[0],
"com.android.bluetooth.opp.BluetoothOppLauncherActivity");
- final int newState =
- bluetoothSharingDisallowed ? PackageManager.COMPONENT_ENABLED_STATE_DISABLED
- : PackageManager.COMPONENT_ENABLED_STATE_DEFAULT;
+ int newState;
+ if (bluetoothSharingDisallowed) {
+ newState = PackageManager.COMPONENT_ENABLED_STATE_DISABLED;
+ } else if (BluetoothProperties.isProfileOppEnabled().orElse(false)) {
+ newState = PackageManager.COMPONENT_ENABLED_STATE_ENABLED;
+ } else {
+ newState = PackageManager.COMPONENT_ENABLED_STATE_DEFAULT;
+ }
try {
mContext.createContextAsUser(userHandle, 0)
.getPackageManager()