Loading src/com/android/bluetooth/btservice/AdapterService.java +2 −3 Original line number Diff line number Diff line Loading @@ -1768,8 +1768,7 @@ public class AdapterService extends Service { if (!pref.contains(device.getAddress())) { return BluetoothDevice.ACCESS_UNKNOWN; } return pref.getBoolean(device.getAddress(), false) ? BluetoothDevice.ACCESS_ALLOWED : BluetoothDevice.ACCESS_REJECTED; return pref.getInt(device.getAddress(), BluetoothDevice.ACCESS_UNKNOWN); } boolean setPhonebookAccessPermission(BluetoothDevice device, int value) { Loading @@ -1781,7 +1780,7 @@ public class AdapterService extends Service { if (value == BluetoothDevice.ACCESS_UNKNOWN) { editor.remove(device.getAddress()); } else { editor.putBoolean(device.getAddress(), value == BluetoothDevice.ACCESS_ALLOWED); editor.putInt(device.getAddress(), value); } return editor.commit(); } Loading src/com/android/bluetooth/map/BluetoothMapService.java +1 −1 Original line number Diff line number Diff line Loading @@ -1029,7 +1029,7 @@ public class BluetoothMapService extends ProfileService { } } else if (action.equals(BluetoothDevice.ACTION_CONNECTION_ACCESS_REPLY)) { int requestType = intent.getIntExtra(BluetoothDevice.EXTRA_ACCESS_REQUEST_TYPE, BluetoothDevice.REQUEST_TYPE_PHONEBOOK_ACCESS); BluetoothDevice.REQUEST_TYPE_MESSAGE_ACCESS); if (DEBUG) Log.d(TAG, "Received ACTION_CONNECTION_ACCESS_REPLY:" + requestType + "isWaitingAuthorization:" + isWaitingAuthorization); if ((!isWaitingAuthorization) || Loading src/com/android/bluetooth/pbap/BluetoothPbapService.java +11 −5 Original line number Diff line number Diff line Loading @@ -178,6 +178,9 @@ public class BluetoothPbapService extends Service { private int mStartId = -1; // PBAP Client has sent pbap connection request private final static int PBAP_CONNECT_RECEIVED = 3; //private IBluetooth mBluetoothService; private boolean mIsWaitingAuthorization = false; Loading Loading @@ -295,9 +298,9 @@ public class BluetoothPbapService extends Service { if (intent.getBooleanExtra(BluetoothDevice.EXTRA_ALWAYS_ALLOWED, false)) { boolean result = mRemoteDevice.setPhonebookAccessPermission( BluetoothDevice.ACCESS_ALLOWED); PBAP_CONNECT_RECEIVED); if (VERBOSE) { Log.v(TAG, "setPhonebookAccessPermission(ACCESS_ALLOWED) result=" Log.v(TAG, "setPhonebookAccessPermission(PBAP_CONNECT_RECEIVED) result=" + result); } } Loading Loading @@ -614,12 +617,15 @@ public class BluetoothPbapService extends Service { int permission = mRemoteDevice.getPhonebookAccessPermission(); if (VERBOSE) Log.v(TAG, "getPhonebookAccessPermission() = " + permission); if (permission == BluetoothDevice.ACCESS_ALLOWED) { if (permission == BluetoothDevice.ACCESS_ALLOWED || permission == PBAP_CONNECT_RECEIVED) { try { if (VERBOSE) { Log.v(TAG, "incoming connection accepted from: " + sRemoteDeviceName + " automatically as already allowed device"); } // update permission access request mRemoteDevice.setPhonebookAccessPermission(PBAP_CONNECT_RECEIVED); startObexServerSession(); } catch (IOException ex) { Log.e(TAG, "Caught exception starting obex server session" Loading Loading @@ -756,8 +762,8 @@ public class BluetoothPbapService extends Service { int prevState = mState; mState = state; Intent intent = new Intent(BluetoothPbap.PBAP_STATE_CHANGED_ACTION); intent.putExtra(BluetoothPbap.PBAP_PREVIOUS_STATE, prevState); intent.putExtra(BluetoothPbap.PBAP_STATE, mState); intent.putExtra(BluetoothProfile.EXTRA_PREVIOUS_STATE, prevState); intent.putExtra(BluetoothProfile.EXTRA_STATE, mState); intent.putExtra(BluetoothDevice.EXTRA_DEVICE, mRemoteDevice); sendBroadcast(intent, BLUETOOTH_PERM); AdapterService s = AdapterService.getAdapterService(); Loading Loading
src/com/android/bluetooth/btservice/AdapterService.java +2 −3 Original line number Diff line number Diff line Loading @@ -1768,8 +1768,7 @@ public class AdapterService extends Service { if (!pref.contains(device.getAddress())) { return BluetoothDevice.ACCESS_UNKNOWN; } return pref.getBoolean(device.getAddress(), false) ? BluetoothDevice.ACCESS_ALLOWED : BluetoothDevice.ACCESS_REJECTED; return pref.getInt(device.getAddress(), BluetoothDevice.ACCESS_UNKNOWN); } boolean setPhonebookAccessPermission(BluetoothDevice device, int value) { Loading @@ -1781,7 +1780,7 @@ public class AdapterService extends Service { if (value == BluetoothDevice.ACCESS_UNKNOWN) { editor.remove(device.getAddress()); } else { editor.putBoolean(device.getAddress(), value == BluetoothDevice.ACCESS_ALLOWED); editor.putInt(device.getAddress(), value); } return editor.commit(); } Loading
src/com/android/bluetooth/map/BluetoothMapService.java +1 −1 Original line number Diff line number Diff line Loading @@ -1029,7 +1029,7 @@ public class BluetoothMapService extends ProfileService { } } else if (action.equals(BluetoothDevice.ACTION_CONNECTION_ACCESS_REPLY)) { int requestType = intent.getIntExtra(BluetoothDevice.EXTRA_ACCESS_REQUEST_TYPE, BluetoothDevice.REQUEST_TYPE_PHONEBOOK_ACCESS); BluetoothDevice.REQUEST_TYPE_MESSAGE_ACCESS); if (DEBUG) Log.d(TAG, "Received ACTION_CONNECTION_ACCESS_REPLY:" + requestType + "isWaitingAuthorization:" + isWaitingAuthorization); if ((!isWaitingAuthorization) || Loading
src/com/android/bluetooth/pbap/BluetoothPbapService.java +11 −5 Original line number Diff line number Diff line Loading @@ -178,6 +178,9 @@ public class BluetoothPbapService extends Service { private int mStartId = -1; // PBAP Client has sent pbap connection request private final static int PBAP_CONNECT_RECEIVED = 3; //private IBluetooth mBluetoothService; private boolean mIsWaitingAuthorization = false; Loading Loading @@ -295,9 +298,9 @@ public class BluetoothPbapService extends Service { if (intent.getBooleanExtra(BluetoothDevice.EXTRA_ALWAYS_ALLOWED, false)) { boolean result = mRemoteDevice.setPhonebookAccessPermission( BluetoothDevice.ACCESS_ALLOWED); PBAP_CONNECT_RECEIVED); if (VERBOSE) { Log.v(TAG, "setPhonebookAccessPermission(ACCESS_ALLOWED) result=" Log.v(TAG, "setPhonebookAccessPermission(PBAP_CONNECT_RECEIVED) result=" + result); } } Loading Loading @@ -614,12 +617,15 @@ public class BluetoothPbapService extends Service { int permission = mRemoteDevice.getPhonebookAccessPermission(); if (VERBOSE) Log.v(TAG, "getPhonebookAccessPermission() = " + permission); if (permission == BluetoothDevice.ACCESS_ALLOWED) { if (permission == BluetoothDevice.ACCESS_ALLOWED || permission == PBAP_CONNECT_RECEIVED) { try { if (VERBOSE) { Log.v(TAG, "incoming connection accepted from: " + sRemoteDeviceName + " automatically as already allowed device"); } // update permission access request mRemoteDevice.setPhonebookAccessPermission(PBAP_CONNECT_RECEIVED); startObexServerSession(); } catch (IOException ex) { Log.e(TAG, "Caught exception starting obex server session" Loading Loading @@ -756,8 +762,8 @@ public class BluetoothPbapService extends Service { int prevState = mState; mState = state; Intent intent = new Intent(BluetoothPbap.PBAP_STATE_CHANGED_ACTION); intent.putExtra(BluetoothPbap.PBAP_PREVIOUS_STATE, prevState); intent.putExtra(BluetoothPbap.PBAP_STATE, mState); intent.putExtra(BluetoothProfile.EXTRA_PREVIOUS_STATE, prevState); intent.putExtra(BluetoothProfile.EXTRA_STATE, mState); intent.putExtra(BluetoothDevice.EXTRA_DEVICE, mRemoteDevice); sendBroadcast(intent, BLUETOOTH_PERM); AdapterService s = AdapterService.getAdapterService(); Loading