summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/bluetooth
diff options
context:
space:
mode:
authorBenjamin Franz <bfranz@google.com>2015-01-02 12:52:03 +0000
committerBenjamin Franz <bfranz@google.com>2015-01-02 12:54:01 +0000
commit0fe3ed5ab5e1cac248d3f2d58f1bb0118871821b (patch)
tree1819faacba95c4e2f82d39c058f4cae168bd1e02 /src/com/android/settings/bluetooth
parentc3068f078887f3357b498a0851591c324d3c55d5 (diff)
downloadpackages_apps_Settings-0fe3ed5ab5e1cac248d3f2d58f1bb0118871821b.zip
packages_apps_Settings-0fe3ed5ab5e1cac248d3f2d58f1bb0118871821b.tar.gz
packages_apps_Settings-0fe3ed5ab5e1cac248d3f2d58f1bb0118871821b.tar.bz2
Block BluetoothPermissionRequest notification on managed profiles.
This notification is triggered when a bluetooth device that supports the PBAP protocol. On managed profiles this functionality is not yet available and therefore the notification and resulting acvitivity have no function. Bug: 18782769 Change-Id: Iaea12eee8ec4727d9448f690861f8344e2296028
Diffstat (limited to 'src/com/android/settings/bluetooth')
-rw-r--r--src/com/android/settings/bluetooth/BluetoothPermissionRequest.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/com/android/settings/bluetooth/BluetoothPermissionRequest.java b/src/com/android/settings/bluetooth/BluetoothPermissionRequest.java
index bcd4d77..12c1d77 100644
--- a/src/com/android/settings/bluetooth/BluetoothPermissionRequest.java
+++ b/src/com/android/settings/bluetooth/BluetoothPermissionRequest.java
@@ -24,6 +24,7 @@ import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.PowerManager;
+import android.os.UserManager;
import android.util.Log;
import com.android.settings.R;
@@ -56,6 +57,12 @@ public final class BluetoothPermissionRequest extends BroadcastReceiver {
if (DEBUG) Log.d(TAG, "onReceive" + action);
if (action.equals(BluetoothDevice.ACTION_CONNECTION_ACCESS_REQUEST)) {
+ UserManager um = (UserManager) context.getSystemService(Context.USER_SERVICE);
+ // skip the notification for managed profiles.
+ if (com.android.settings.Utils.isManagedProfile(um)) {
+ if (DEBUG) Log.d(TAG, "Blocking notification for managed profile.");
+ return;
+ }
// convert broadcast intent into activity intent (same action string)
mDevice = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
mRequestType = intent.getIntExtra(BluetoothDevice.EXTRA_ACCESS_REQUEST_TYPE,