OSDN Git Service

Don't allow contact sharing by default for device not recognized as carkit.
authorSanket Padawe <sanketpadawe@google.com>
Wed, 11 Nov 2015 23:01:35 +0000 (15:01 -0800)
committerSanket Padawe <sanketpadawe@google.com>
Thu, 12 Nov 2015 23:53:42 +0000 (23:53 +0000)
+ Don't allow contact sharing by default for devices not recognized
as carkit at pair time.

Bug: 23607427
Change-Id: If6babb10117ba7ee5008a4a29450a7cb981bea4a
(cherry picked from commit 07533dbffff5551ad4c58852b5856f57d7da6801)

packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java

index b0429ef..17fe24a 100644 (file)
@@ -808,7 +808,12 @@ public final class CachedBluetoothDevice implements Comparable<CachedBluetoothDe
             // The pairing dialog now warns of phone-book access for paired devices.
             // No separate prompt is displayed after pairing.
             if (getPhonebookPermissionChoice() == CachedBluetoothDevice.ACCESS_UNKNOWN) {
-                setPhonebookPermissionChoice(CachedBluetoothDevice.ACCESS_ALLOWED);
+                if (mDevice.getBluetoothClass().getDeviceClass()
+                        == BluetoothClass.Device.AUDIO_VIDEO_HANDSFREE) {
+                    setPhonebookPermissionChoice(CachedBluetoothDevice.ACCESS_ALLOWED);
+                } else {
+                    setPhonebookPermissionChoice(CachedBluetoothDevice.ACCESS_REJECTED);
+                }
             }
         }
     }