OSDN Git Service

Set default phonebook access to ACCESS_REJECTED when user didn't choose
authorZongheng Wang <wangzongheng@google.com>
Thu, 5 Sep 2019 20:44:28 +0000 (13:44 -0700)
committerMax Spector <mspector@google.com>
Thu, 19 Sep 2019 00:13:40 +0000 (17:13 -0700)
one

When there's no users' choice to tell us whether to share their
phonebook information to the Bluetooth device, set the phonebook access
permission to ACCESS_REJECTED.

Bug: 138529441
Test: Manual test
Change-Id: Iefabeb731b941f09fe1272ac7b7cd2feba75c8df
Merged-In: Iefabeb731b941f09fe1272ac7b7cd2feba75c8df
(cherry picked from commit 02046b4f2ce82f6a3b6fd733c4b45f47acf51296)

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

index 109446d..60c42d0 100644 (file)
@@ -25,6 +25,7 @@ import android.content.SharedPreferences;
 import android.os.ParcelUuid;
 import android.os.SystemClock;
 import android.text.TextUtils;
+import android.util.EventLog;
 import android.util.Log;
 import android.bluetooth.BluetoothAdapter;
 
@@ -831,10 +832,9 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice>
                         == BluetoothClass.Device.AUDIO_VIDEO_HANDSFREE ||
                     mDevice.getBluetoothClass().getDeviceClass()
                         == BluetoothClass.Device.AUDIO_VIDEO_WEARABLE_HEADSET) {
-                    setPhonebookPermissionChoice(CachedBluetoothDevice.ACCESS_ALLOWED);
-                } else {
-                    setPhonebookPermissionChoice(CachedBluetoothDevice.ACCESS_REJECTED);
+                    EventLog.writeEvent(0x534e4554, "138529441", -1, "");
                 }
+                setPhonebookPermissionChoice(CachedBluetoothDevice.ACCESS_REJECTED);
             }
         }
     }