Loading src/com/android/settings/bluetooth/BluetoothPairingDialog.java +0 −17 Original line number Diff line number Diff line Loading @@ -113,7 +113,6 @@ public final class BluetoothPairingDialog extends AlertActivity implements mDevice = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE); mType = intent.getIntExtra(BluetoothDevice.EXTRA_PAIRING_VARIANT, BluetoothDevice.ERROR); mDevice.fetchUuidsWithSdp(); switch (mType) { case BluetoothDevice.PAIRING_VARIANT_PIN: Loading Loading @@ -321,23 +320,7 @@ public final class BluetoothPairingDialog extends AlertActivity implements } } private void processPhonebookAccess() { CachedBluetoothDevice cachedDevice = mCachedDeviceManager.findDevice(mDevice); if (cachedDevice == null) { cachedDevice = mCachedDeviceManager.addDevice( mBluetoothManager.getBluetoothAdapter(), mBluetoothManager.getProfileManager(), mDevice); } ParcelUuid[] uuids = mDevice.getUuids(); if (BluetoothUuid.containsAnyUuid(uuids, PbapServerProfile.PBAB_CLIENT_UUIDS)) { cachedDevice.setPhonebookPermissionChoice(CachedBluetoothDevice.ACCESS_ALLOWED); } } private void onPair(String value) { processPhonebookAccess(); switch (mType) { case BluetoothDevice.PAIRING_VARIANT_PIN: byte[] pinBytes = BluetoothDevice.convertPinToBytes(value); Loading src/com/android/settings/bluetooth/CachedBluetoothDevice.java +17 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.settings.bluetooth; import android.bluetooth.BluetoothClass; import android.bluetooth.BluetoothDevice; import android.bluetooth.BluetoothProfile; import android.bluetooth.BluetoothUuid; import android.content.Context; import android.content.SharedPreferences; import android.os.ParcelUuid; Loading Loading @@ -487,6 +488,11 @@ final class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice> { ParcelUuid[] localUuids = mLocalAdapter.getUuids(); if (localUuids == null) return false; /** * Now we know if the device supports PBAP, update permissions... */ processPhonebookAccess(); mProfileManager.updateProfiles(uuids, localUuids, mProfiles, mRemovedProfiles, mLocalNapRoleConnected, mDevice); Loading Loading @@ -767,4 +773,15 @@ final class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice> { } editor.commit(); } private void processPhonebookAccess() { if (mDevice.getBondState() != BluetoothDevice.BOND_BONDED) return; ParcelUuid[] uuids = mDevice.getUuids(); if (BluetoothUuid.containsAnyUuid(uuids, PbapServerProfile.PBAB_CLIENT_UUIDS)) { // The pairing dialog now warns of phone-book access for paired devices. // No separate prompt is displayed after pairing. setPhonebookPermissionChoice(CachedBluetoothDevice.ACCESS_ALLOWED); } } } Loading
src/com/android/settings/bluetooth/BluetoothPairingDialog.java +0 −17 Original line number Diff line number Diff line Loading @@ -113,7 +113,6 @@ public final class BluetoothPairingDialog extends AlertActivity implements mDevice = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE); mType = intent.getIntExtra(BluetoothDevice.EXTRA_PAIRING_VARIANT, BluetoothDevice.ERROR); mDevice.fetchUuidsWithSdp(); switch (mType) { case BluetoothDevice.PAIRING_VARIANT_PIN: Loading Loading @@ -321,23 +320,7 @@ public final class BluetoothPairingDialog extends AlertActivity implements } } private void processPhonebookAccess() { CachedBluetoothDevice cachedDevice = mCachedDeviceManager.findDevice(mDevice); if (cachedDevice == null) { cachedDevice = mCachedDeviceManager.addDevice( mBluetoothManager.getBluetoothAdapter(), mBluetoothManager.getProfileManager(), mDevice); } ParcelUuid[] uuids = mDevice.getUuids(); if (BluetoothUuid.containsAnyUuid(uuids, PbapServerProfile.PBAB_CLIENT_UUIDS)) { cachedDevice.setPhonebookPermissionChoice(CachedBluetoothDevice.ACCESS_ALLOWED); } } private void onPair(String value) { processPhonebookAccess(); switch (mType) { case BluetoothDevice.PAIRING_VARIANT_PIN: byte[] pinBytes = BluetoothDevice.convertPinToBytes(value); Loading
src/com/android/settings/bluetooth/CachedBluetoothDevice.java +17 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.settings.bluetooth; import android.bluetooth.BluetoothClass; import android.bluetooth.BluetoothDevice; import android.bluetooth.BluetoothProfile; import android.bluetooth.BluetoothUuid; import android.content.Context; import android.content.SharedPreferences; import android.os.ParcelUuid; Loading Loading @@ -487,6 +488,11 @@ final class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice> { ParcelUuid[] localUuids = mLocalAdapter.getUuids(); if (localUuids == null) return false; /** * Now we know if the device supports PBAP, update permissions... */ processPhonebookAccess(); mProfileManager.updateProfiles(uuids, localUuids, mProfiles, mRemovedProfiles, mLocalNapRoleConnected, mDevice); Loading Loading @@ -767,4 +773,15 @@ final class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice> { } editor.commit(); } private void processPhonebookAccess() { if (mDevice.getBondState() != BluetoothDevice.BOND_BONDED) return; ParcelUuid[] uuids = mDevice.getUuids(); if (BluetoothUuid.containsAnyUuid(uuids, PbapServerProfile.PBAB_CLIENT_UUIDS)) { // The pairing dialog now warns of phone-book access for paired devices. // No separate prompt is displayed after pairing. setPhonebookPermissionChoice(CachedBluetoothDevice.ACCESS_ALLOWED); } } }