Loading packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java +0 −52 Original line number Original line Diff line number Diff line Loading @@ -29,7 +29,6 @@ import android.bluetooth.BluetoothLeBroadcastReceiveState; import android.bluetooth.BluetoothProfile; import android.bluetooth.BluetoothProfile; import android.bluetooth.BluetoothUuid; import android.bluetooth.BluetoothUuid; import android.content.Context; import android.content.Context; import android.content.SharedPreferences; import android.content.res.Resources; import android.content.res.Resources; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable; Loading Loading @@ -689,9 +688,6 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice> void fillData() { void fillData() { updateProfiles(); updateProfiles(); fetchActiveDevices(); fetchActiveDevices(); migratePhonebookPermissionChoice(); migrateMessagePermissionChoice(); dispatchAttributesChanged(); dispatchAttributesChanged(); } } Loading Loading @@ -1362,54 +1358,6 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice> void onDeviceAttributesChanged(); void onDeviceAttributesChanged(); } } // Migrates data from old data store (in Settings app's shared preferences) to new (in Bluetooth // app's shared preferences). private void migratePhonebookPermissionChoice() { SharedPreferences preferences = mContext.getSharedPreferences( "bluetooth_phonebook_permission", Context.MODE_PRIVATE); if (!preferences.contains(mDevice.getAddress())) { return; } if (mDevice.getPhonebookAccessPermission() == BluetoothDevice.ACCESS_UNKNOWN) { int oldPermission = preferences.getInt(mDevice.getAddress(), BluetoothDevice.ACCESS_UNKNOWN); if (oldPermission == BluetoothDevice.ACCESS_ALLOWED) { mDevice.setPhonebookAccessPermission(BluetoothDevice.ACCESS_ALLOWED); } else if (oldPermission == BluetoothDevice.ACCESS_REJECTED) { mDevice.setPhonebookAccessPermission(BluetoothDevice.ACCESS_REJECTED); } } SharedPreferences.Editor editor = preferences.edit(); editor.remove(mDevice.getAddress()); editor.commit(); } // Migrates data from old data store (in Settings app's shared preferences) to new (in Bluetooth // app's shared preferences). private void migrateMessagePermissionChoice() { SharedPreferences preferences = mContext.getSharedPreferences( "bluetooth_message_permission", Context.MODE_PRIVATE); if (!preferences.contains(mDevice.getAddress())) { return; } if (mDevice.getMessageAccessPermission() == BluetoothDevice.ACCESS_UNKNOWN) { int oldPermission = preferences.getInt(mDevice.getAddress(), BluetoothDevice.ACCESS_UNKNOWN); if (oldPermission == BluetoothDevice.ACCESS_ALLOWED) { mDevice.setMessageAccessPermission(BluetoothDevice.ACCESS_ALLOWED); } else if (oldPermission == BluetoothDevice.ACCESS_REJECTED) { mDevice.setMessageAccessPermission(BluetoothDevice.ACCESS_REJECTED); } } SharedPreferences.Editor editor = preferences.edit(); editor.remove(mDevice.getAddress()); editor.commit(); } private void processPhonebookAccess() { private void processPhonebookAccess() { if (mDevice.getBondState() != BluetoothDevice.BOND_BONDED) return; if (mDevice.getBondState() != BluetoothDevice.BOND_BONDED) return; Loading Loading
packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java +0 −52 Original line number Original line Diff line number Diff line Loading @@ -29,7 +29,6 @@ import android.bluetooth.BluetoothLeBroadcastReceiveState; import android.bluetooth.BluetoothProfile; import android.bluetooth.BluetoothProfile; import android.bluetooth.BluetoothUuid; import android.bluetooth.BluetoothUuid; import android.content.Context; import android.content.Context; import android.content.SharedPreferences; import android.content.res.Resources; import android.content.res.Resources; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable; Loading Loading @@ -689,9 +688,6 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice> void fillData() { void fillData() { updateProfiles(); updateProfiles(); fetchActiveDevices(); fetchActiveDevices(); migratePhonebookPermissionChoice(); migrateMessagePermissionChoice(); dispatchAttributesChanged(); dispatchAttributesChanged(); } } Loading Loading @@ -1362,54 +1358,6 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice> void onDeviceAttributesChanged(); void onDeviceAttributesChanged(); } } // Migrates data from old data store (in Settings app's shared preferences) to new (in Bluetooth // app's shared preferences). private void migratePhonebookPermissionChoice() { SharedPreferences preferences = mContext.getSharedPreferences( "bluetooth_phonebook_permission", Context.MODE_PRIVATE); if (!preferences.contains(mDevice.getAddress())) { return; } if (mDevice.getPhonebookAccessPermission() == BluetoothDevice.ACCESS_UNKNOWN) { int oldPermission = preferences.getInt(mDevice.getAddress(), BluetoothDevice.ACCESS_UNKNOWN); if (oldPermission == BluetoothDevice.ACCESS_ALLOWED) { mDevice.setPhonebookAccessPermission(BluetoothDevice.ACCESS_ALLOWED); } else if (oldPermission == BluetoothDevice.ACCESS_REJECTED) { mDevice.setPhonebookAccessPermission(BluetoothDevice.ACCESS_REJECTED); } } SharedPreferences.Editor editor = preferences.edit(); editor.remove(mDevice.getAddress()); editor.commit(); } // Migrates data from old data store (in Settings app's shared preferences) to new (in Bluetooth // app's shared preferences). private void migrateMessagePermissionChoice() { SharedPreferences preferences = mContext.getSharedPreferences( "bluetooth_message_permission", Context.MODE_PRIVATE); if (!preferences.contains(mDevice.getAddress())) { return; } if (mDevice.getMessageAccessPermission() == BluetoothDevice.ACCESS_UNKNOWN) { int oldPermission = preferences.getInt(mDevice.getAddress(), BluetoothDevice.ACCESS_UNKNOWN); if (oldPermission == BluetoothDevice.ACCESS_ALLOWED) { mDevice.setMessageAccessPermission(BluetoothDevice.ACCESS_ALLOWED); } else if (oldPermission == BluetoothDevice.ACCESS_REJECTED) { mDevice.setMessageAccessPermission(BluetoothDevice.ACCESS_REJECTED); } } SharedPreferences.Editor editor = preferences.edit(); editor.remove(mDevice.getAddress()); editor.commit(); } private void processPhonebookAccess() { private void processPhonebookAccess() { if (mDevice.getBondState() != BluetoothDevice.BOND_BONDED) return; if (mDevice.getBondState() != BluetoothDevice.BOND_BONDED) return; Loading