Loading android/app/res/values/config.xml +10 −0 Original line number Diff line number Diff line Loading @@ -86,4 +86,14 @@ <integer name="a2dp_source_codec_priority_aptx_hd">4001</integer> <integer name="a2dp_source_codec_priority_ldac">5001</integer> <!-- Package that is responsible for user interaction on pairing request, success or cancel. Receives: - BluetootDevice.ACTION_PAIRING_CANCEL on bond failure - BluetoothDevice.ACTION_PAIRING_REUQEST on pin request - BluetootDevice.ACTION_BOND_STATE_CHANGED on pairing request and success - BluetoothDevice.ACTION_CONNECTION_ACCESS_REQUEST on access requests - BluetoothDevice.ACTION_CONNECTION_ACCESS_CANCEL to cancel access requests --> <string name="pairing_ui_package">com.android.settings</string> </resources> android/app/src/com/android/bluetooth/btservice/BondStateMachine.java +3 −4 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ import android.os.Message; import android.os.UserHandle; import android.util.Log; import com.android.bluetooth.R; import com.android.bluetooth.Utils; import com.android.bluetooth.btservice.RemoteDevices.DeviceProperties; import com.android.internal.util.State; Loading Loading @@ -72,8 +73,6 @@ final class BondStateMachine extends StateMachine { public static final String OOBDATA = "oobdata"; private static final String PAIRING_REQUEST_PACKAGE = "com.android.settings"; private BondStateMachine(AdapterService service, AdapterProperties prop, RemoteDevices remoteDevices) { super("BondStateMachine:"); Loading Loading @@ -326,7 +325,7 @@ final class BondStateMachine extends StateMachine { } intent.putExtra(BluetoothDevice.EXTRA_PAIRING_VARIANT, variant); intent.setFlags(Intent.FLAG_RECEIVER_FOREGROUND); intent.setPackage(PAIRING_REQUEST_PACKAGE); intent.setPackage(mAdapterService.getString(R.string.pairing_ui_package)); mAdapterService.sendOrderedBroadcast(intent, mAdapterService.BLUETOOTH_ADMIN_PERM); } Loading @@ -345,7 +344,7 @@ final class BondStateMachine extends StateMachine { intent.putExtra(BluetoothDevice.EXTRA_PREVIOUS_BOND_STATE, oldState); if (newState == BluetoothDevice.BOND_NONE) intent.putExtra(BluetoothDevice.EXTRA_REASON, reason); intent.setPackage(PAIRING_REQUEST_PACKAGE); intent.setPackage(mAdapterService.getString(R.string.pairing_ui_package)); mAdapterService.sendBroadcastAsUser(intent, UserHandle.ALL, AdapterService.BLUETOOTH_PERM); infoLog("Bond State Change Intent:" + device + " OldState: " + oldState Loading android/app/src/com/android/bluetooth/btservice/RemoteDevices.java +2 −3 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.os.Handler; import android.os.Message; import android.os.ParcelUuid; import android.util.Log; import com.android.bluetooth.R; import com.android.bluetooth.Utils; import java.util.ArrayList; import java.util.HashMap; Loading @@ -45,8 +46,6 @@ final class RemoteDevices { private static final int UUID_INTENT_DELAY = 6000; private static final int MESSAGE_UUID_INTENT = 1; private static final String PAIRING_REQUEST_PACKAGE = "com.android.settings"; private HashMap<String, DeviceProperties> mDevices; private Queue<String> mDeviceQueue; Loading Loading @@ -415,7 +414,7 @@ final class RemoteDevices { // Send PAIRING_CANCEL intent to dismiss any dialog requesting bonding. intent = new Intent(BluetoothDevice.ACTION_PAIRING_CANCEL); intent.putExtra(BluetoothDevice.EXTRA_DEVICE, device); intent.setPackage(PAIRING_REQUEST_PACKAGE); intent.setPackage(mAdapterService.getString(R.string.pairing_ui_package)); mAdapterService.sendBroadcast(intent, mAdapterService.BLUETOOTH_PERM); } if (state == BluetoothAdapter.STATE_ON || state == BluetoothAdapter.STATE_TURNING_OFF) { Loading android/app/src/com/android/bluetooth/hfp/AtPhonebook.java +4 −4 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ import android.provider.ContactsContract.PhoneLookup; import android.telephony.PhoneNumberUtils; import android.util.Log; import com.android.bluetooth.R; import com.android.bluetooth.Utils; import com.android.bluetooth.util.DevicePolicyUtils; Loading Loading @@ -86,9 +87,7 @@ public class AtPhonebook { private boolean mCheckingAccessPermission; // package and class name to which we send intent to check phone book access permission private static final String ACCESS_AUTHORITY_PACKAGE = "com.android.settings"; private static final String ACCESS_AUTHORITY_CLASS = "com.android.settings.bluetooth.BluetoothPermissionRequest"; private final String mPairingPackage; private static final String BLUETOOTH_ADMIN_PERM = android.Manifest.permission.BLUETOOTH_ADMIN; private final HashMap<String, PhonebookResult> mPhonebooks = Loading @@ -101,6 +100,7 @@ public class AtPhonebook { public AtPhonebook(Context context, HeadsetStateMachine headsetState) { mContext = context; mPairingPackage = context.getString(R.string.pairing_ui_package); mContentResolver = context.getContentResolver(); mStateMachine = headsetState; mPhonebooks.put("DC", new PhonebookResult()); // dialled calls Loading Loading @@ -604,7 +604,7 @@ public class AtPhonebook { if (permission == BluetoothDevice.ACCESS_UNKNOWN) { log("checkAccessPermission - ACTION_CONNECTION_ACCESS_REQUEST"); Intent intent = new Intent(BluetoothDevice.ACTION_CONNECTION_ACCESS_REQUEST); intent.setClassName(ACCESS_AUTHORITY_PACKAGE, ACCESS_AUTHORITY_CLASS); intent.setPackage(mPairingPackage); intent.putExtra(BluetoothDevice.EXTRA_ACCESS_REQUEST_TYPE, BluetoothDevice.REQUEST_TYPE_PHONEBOOK_ACCESS); intent.putExtra(BluetoothDevice.EXTRA_DEVICE, remoteDevice); Loading android/app/src/com/android/bluetooth/map/BluetoothMapService.java +3 −7 Original line number Diff line number Diff line Loading @@ -41,11 +41,11 @@ import android.text.TextUtils; import android.util.Log; import android.util.SparseArray; import com.android.bluetooth.R; import com.android.bluetooth.Utils; import com.android.bluetooth.btservice.AdapterService; import com.android.bluetooth.btservice.ProfileService; import com.android.bluetooth.btservice.ProfileService.IProfileServiceBinder; import com.android.bluetooth.R; import java.io.IOException; import java.util.ArrayList; Loading Loading @@ -153,9 +153,6 @@ public class BluetoothMapService extends ProfileService { private boolean mSmsCapable = true; // package and class name to which we send intent to check phone book access permission private static final String ACCESS_AUTHORITY_PACKAGE = "com.android.settings"; private static final ParcelUuid[] MAP_UUIDS = { BluetoothUuid.MAP, BluetoothUuid.MNS, Loading @@ -163,7 +160,6 @@ public class BluetoothMapService extends ProfileService { public BluetoothMapService() { mState = BluetoothMap.STATE_DISCONNECTED; } Loading Loading @@ -361,7 +357,7 @@ public class BluetoothMapService extends ProfileService { case USER_TIMEOUT: if (mIsWaitingAuthorization) { Intent intent = new Intent(BluetoothDevice.ACTION_CONNECTION_ACCESS_CANCEL); intent.setPackage(ACCESS_AUTHORITY_PACKAGE); intent.setPackage(getString(R.string.pairing_ui_package)); intent.putExtra(BluetoothDevice.EXTRA_DEVICE, mRemoteDevice); intent.putExtra(BluetoothDevice.EXTRA_ACCESS_REQUEST_TYPE, BluetoothDevice.REQUEST_TYPE_MESSAGE_ACCESS); Loading Loading @@ -871,7 +867,7 @@ public class BluetoothMapService extends ProfileService { if (sendIntent) { // This will trigger Settings app's dialog. Intent intent = new Intent(BluetoothDevice.ACTION_CONNECTION_ACCESS_REQUEST); intent.setPackage(ACCESS_AUTHORITY_PACKAGE); intent.setPackage(getString(R.string.pairing_ui_package)); intent.putExtra(BluetoothDevice.EXTRA_ACCESS_REQUEST_TYPE, BluetoothDevice.REQUEST_TYPE_MESSAGE_ACCESS); intent.putExtra(BluetoothDevice.EXTRA_DEVICE, mRemoteDevice); Loading Loading
android/app/res/values/config.xml +10 −0 Original line number Diff line number Diff line Loading @@ -86,4 +86,14 @@ <integer name="a2dp_source_codec_priority_aptx_hd">4001</integer> <integer name="a2dp_source_codec_priority_ldac">5001</integer> <!-- Package that is responsible for user interaction on pairing request, success or cancel. Receives: - BluetootDevice.ACTION_PAIRING_CANCEL on bond failure - BluetoothDevice.ACTION_PAIRING_REUQEST on pin request - BluetootDevice.ACTION_BOND_STATE_CHANGED on pairing request and success - BluetoothDevice.ACTION_CONNECTION_ACCESS_REQUEST on access requests - BluetoothDevice.ACTION_CONNECTION_ACCESS_CANCEL to cancel access requests --> <string name="pairing_ui_package">com.android.settings</string> </resources>
android/app/src/com/android/bluetooth/btservice/BondStateMachine.java +3 −4 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ import android.os.Message; import android.os.UserHandle; import android.util.Log; import com.android.bluetooth.R; import com.android.bluetooth.Utils; import com.android.bluetooth.btservice.RemoteDevices.DeviceProperties; import com.android.internal.util.State; Loading Loading @@ -72,8 +73,6 @@ final class BondStateMachine extends StateMachine { public static final String OOBDATA = "oobdata"; private static final String PAIRING_REQUEST_PACKAGE = "com.android.settings"; private BondStateMachine(AdapterService service, AdapterProperties prop, RemoteDevices remoteDevices) { super("BondStateMachine:"); Loading Loading @@ -326,7 +325,7 @@ final class BondStateMachine extends StateMachine { } intent.putExtra(BluetoothDevice.EXTRA_PAIRING_VARIANT, variant); intent.setFlags(Intent.FLAG_RECEIVER_FOREGROUND); intent.setPackage(PAIRING_REQUEST_PACKAGE); intent.setPackage(mAdapterService.getString(R.string.pairing_ui_package)); mAdapterService.sendOrderedBroadcast(intent, mAdapterService.BLUETOOTH_ADMIN_PERM); } Loading @@ -345,7 +344,7 @@ final class BondStateMachine extends StateMachine { intent.putExtra(BluetoothDevice.EXTRA_PREVIOUS_BOND_STATE, oldState); if (newState == BluetoothDevice.BOND_NONE) intent.putExtra(BluetoothDevice.EXTRA_REASON, reason); intent.setPackage(PAIRING_REQUEST_PACKAGE); intent.setPackage(mAdapterService.getString(R.string.pairing_ui_package)); mAdapterService.sendBroadcastAsUser(intent, UserHandle.ALL, AdapterService.BLUETOOTH_PERM); infoLog("Bond State Change Intent:" + device + " OldState: " + oldState Loading
android/app/src/com/android/bluetooth/btservice/RemoteDevices.java +2 −3 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.os.Handler; import android.os.Message; import android.os.ParcelUuid; import android.util.Log; import com.android.bluetooth.R; import com.android.bluetooth.Utils; import java.util.ArrayList; import java.util.HashMap; Loading @@ -45,8 +46,6 @@ final class RemoteDevices { private static final int UUID_INTENT_DELAY = 6000; private static final int MESSAGE_UUID_INTENT = 1; private static final String PAIRING_REQUEST_PACKAGE = "com.android.settings"; private HashMap<String, DeviceProperties> mDevices; private Queue<String> mDeviceQueue; Loading Loading @@ -415,7 +414,7 @@ final class RemoteDevices { // Send PAIRING_CANCEL intent to dismiss any dialog requesting bonding. intent = new Intent(BluetoothDevice.ACTION_PAIRING_CANCEL); intent.putExtra(BluetoothDevice.EXTRA_DEVICE, device); intent.setPackage(PAIRING_REQUEST_PACKAGE); intent.setPackage(mAdapterService.getString(R.string.pairing_ui_package)); mAdapterService.sendBroadcast(intent, mAdapterService.BLUETOOTH_PERM); } if (state == BluetoothAdapter.STATE_ON || state == BluetoothAdapter.STATE_TURNING_OFF) { Loading
android/app/src/com/android/bluetooth/hfp/AtPhonebook.java +4 −4 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ import android.provider.ContactsContract.PhoneLookup; import android.telephony.PhoneNumberUtils; import android.util.Log; import com.android.bluetooth.R; import com.android.bluetooth.Utils; import com.android.bluetooth.util.DevicePolicyUtils; Loading Loading @@ -86,9 +87,7 @@ public class AtPhonebook { private boolean mCheckingAccessPermission; // package and class name to which we send intent to check phone book access permission private static final String ACCESS_AUTHORITY_PACKAGE = "com.android.settings"; private static final String ACCESS_AUTHORITY_CLASS = "com.android.settings.bluetooth.BluetoothPermissionRequest"; private final String mPairingPackage; private static final String BLUETOOTH_ADMIN_PERM = android.Manifest.permission.BLUETOOTH_ADMIN; private final HashMap<String, PhonebookResult> mPhonebooks = Loading @@ -101,6 +100,7 @@ public class AtPhonebook { public AtPhonebook(Context context, HeadsetStateMachine headsetState) { mContext = context; mPairingPackage = context.getString(R.string.pairing_ui_package); mContentResolver = context.getContentResolver(); mStateMachine = headsetState; mPhonebooks.put("DC", new PhonebookResult()); // dialled calls Loading Loading @@ -604,7 +604,7 @@ public class AtPhonebook { if (permission == BluetoothDevice.ACCESS_UNKNOWN) { log("checkAccessPermission - ACTION_CONNECTION_ACCESS_REQUEST"); Intent intent = new Intent(BluetoothDevice.ACTION_CONNECTION_ACCESS_REQUEST); intent.setClassName(ACCESS_AUTHORITY_PACKAGE, ACCESS_AUTHORITY_CLASS); intent.setPackage(mPairingPackage); intent.putExtra(BluetoothDevice.EXTRA_ACCESS_REQUEST_TYPE, BluetoothDevice.REQUEST_TYPE_PHONEBOOK_ACCESS); intent.putExtra(BluetoothDevice.EXTRA_DEVICE, remoteDevice); Loading
android/app/src/com/android/bluetooth/map/BluetoothMapService.java +3 −7 Original line number Diff line number Diff line Loading @@ -41,11 +41,11 @@ import android.text.TextUtils; import android.util.Log; import android.util.SparseArray; import com.android.bluetooth.R; import com.android.bluetooth.Utils; import com.android.bluetooth.btservice.AdapterService; import com.android.bluetooth.btservice.ProfileService; import com.android.bluetooth.btservice.ProfileService.IProfileServiceBinder; import com.android.bluetooth.R; import java.io.IOException; import java.util.ArrayList; Loading Loading @@ -153,9 +153,6 @@ public class BluetoothMapService extends ProfileService { private boolean mSmsCapable = true; // package and class name to which we send intent to check phone book access permission private static final String ACCESS_AUTHORITY_PACKAGE = "com.android.settings"; private static final ParcelUuid[] MAP_UUIDS = { BluetoothUuid.MAP, BluetoothUuid.MNS, Loading @@ -163,7 +160,6 @@ public class BluetoothMapService extends ProfileService { public BluetoothMapService() { mState = BluetoothMap.STATE_DISCONNECTED; } Loading Loading @@ -361,7 +357,7 @@ public class BluetoothMapService extends ProfileService { case USER_TIMEOUT: if (mIsWaitingAuthorization) { Intent intent = new Intent(BluetoothDevice.ACTION_CONNECTION_ACCESS_CANCEL); intent.setPackage(ACCESS_AUTHORITY_PACKAGE); intent.setPackage(getString(R.string.pairing_ui_package)); intent.putExtra(BluetoothDevice.EXTRA_DEVICE, mRemoteDevice); intent.putExtra(BluetoothDevice.EXTRA_ACCESS_REQUEST_TYPE, BluetoothDevice.REQUEST_TYPE_MESSAGE_ACCESS); Loading Loading @@ -871,7 +867,7 @@ public class BluetoothMapService extends ProfileService { if (sendIntent) { // This will trigger Settings app's dialog. Intent intent = new Intent(BluetoothDevice.ACTION_CONNECTION_ACCESS_REQUEST); intent.setPackage(ACCESS_AUTHORITY_PACKAGE); intent.setPackage(getString(R.string.pairing_ui_package)); intent.putExtra(BluetoothDevice.EXTRA_ACCESS_REQUEST_TYPE, BluetoothDevice.REQUEST_TYPE_MESSAGE_ACCESS); intent.putExtra(BluetoothDevice.EXTRA_DEVICE, mRemoteDevice); Loading