diff options
| -rw-r--r-- | packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java index 9270d13002d7..1bffff753513 100644 --- a/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java +++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java @@ -71,15 +71,8 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice> boolean mJustDiscovered; - private int mMessageRejectionCount; - private final Collection<Callback> mCallbacks = new ArrayList<>(); - // How many times user should reject the connection to make the choice persist. - private final static int MESSAGE_REJECTION_COUNT_LIMIT_TO_PERSIST = 2; - - private final static String MESSAGE_REJECTION_COUNT_PREFS_NAME = "bluetooth_message_reject"; - /** * Last time a bt profile auto-connect was attempted. * If an ACTION_UUID intent comes in within @@ -348,7 +341,6 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice> fetchActiveDevices(); migratePhonebookPermissionChoice(); migrateMessagePermissionChoice(); - fetchMessageRejectionCount(); dispatchAttributesChanged(); } @@ -642,8 +634,6 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice> mDevice.setPhonebookAccessPermission(BluetoothDevice.ACCESS_UNKNOWN); mDevice.setMessageAccessPermission(BluetoothDevice.ACCESS_UNKNOWN); mDevice.setSimAccessPermission(BluetoothDevice.ACCESS_UNKNOWN); - mMessageRejectionCount = 0; - saveMessageRejectionCount(); } refresh(); @@ -797,34 +787,6 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice> editor.commit(); } - /** - * @return Whether this rejection should persist. - */ - public boolean checkAndIncreaseMessageRejectionCount() { - if (mMessageRejectionCount < MESSAGE_REJECTION_COUNT_LIMIT_TO_PERSIST) { - mMessageRejectionCount++; - saveMessageRejectionCount(); - } - return mMessageRejectionCount >= MESSAGE_REJECTION_COUNT_LIMIT_TO_PERSIST; - } - - private void fetchMessageRejectionCount() { - SharedPreferences preference = mContext.getSharedPreferences( - MESSAGE_REJECTION_COUNT_PREFS_NAME, Context.MODE_PRIVATE); - mMessageRejectionCount = preference.getInt(mDevice.getAddress(), 0); - } - - private void saveMessageRejectionCount() { - SharedPreferences.Editor editor = mContext.getSharedPreferences( - MESSAGE_REJECTION_COUNT_PREFS_NAME, Context.MODE_PRIVATE).edit(); - if (mMessageRejectionCount == 0) { - editor.remove(mDevice.getAddress()); - } else { - editor.putInt(mDevice.getAddress(), mMessageRejectionCount); - } - editor.commit(); - } - private void processPhonebookAccess() { if (mDevice.getBondState() != BluetoothDevice.BOND_BONDED) return; |