summaryrefslogtreecommitdiff
path: root/service/java/com/android/server/bluetooth/BluetoothManagerService.java
diff options
context:
space:
mode:
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()