Loading android/app/Android.bp +1 −0 Original line number Original line Diff line number Diff line Loading @@ -329,6 +329,7 @@ android_app { "-Xep:AndroidFrameworkBinderIdentity:ERROR", "-Xep:AndroidFrameworkBinderIdentity:ERROR", "-Xep:AndroidFrameworkEfficientParcelable:ERROR", "-Xep:AndroidFrameworkEfficientParcelable:ERROR", "-Xep:AndroidFrameworkEfficientStrings:ERROR", "-Xep:AndroidFrameworkEfficientStrings:ERROR", "-Xep:AndroidFrameworkPendingIntentMutability:ERROR", "-Xep:AndroidFrameworkRequiresPermission:ERROR", "-Xep:AndroidFrameworkRequiresPermission:ERROR", "-Xep:BadImport:ERROR", "-Xep:BadImport:ERROR", "-Xep:CatchAndPrintStackTrace:ERROR", "-Xep:CatchAndPrintStackTrace:ERROR", Loading android/app/src/com/android/bluetooth/avrcpcontroller/BluetoothMediaBrowserService.java +5 −2 Original line number Original line Diff line number Diff line Loading @@ -246,9 +246,12 @@ public class BluetoothMediaBrowserService extends MediaBrowserServiceCompat { Intent launchIntent = new Intent(); Intent launchIntent = new Intent(); launchIntent.setAction(BluetoothPrefs.BLUETOOTH_SETTING_ACTION); launchIntent.setAction(BluetoothPrefs.BLUETOOTH_SETTING_ACTION); launchIntent.addCategory(BluetoothPrefs.BLUETOOTH_SETTING_CATEGORY); launchIntent.addCategory(BluetoothPrefs.BLUETOOTH_SETTING_CATEGORY); int flags = PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE; PendingIntent pendingIntent = PendingIntent pendingIntent = PendingIntent.getActivity(getApplicationContext(), 0, launchIntent, flags); PendingIntent.getActivity( getApplicationContext(), 0, launchIntent, PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE); extras.putParcelable(ERROR_RESOLUTION_ACTION_INTENT, pendingIntent); extras.putParcelable(ERROR_RESOLUTION_ACTION_INTENT, pendingIntent); PlaybackStateCompat errorState = PlaybackStateCompat errorState = new PlaybackStateCompat.Builder() new PlaybackStateCompat.Builder() Loading android/app/src/com/android/bluetooth/sap/SapServer.java +14 −7 Original line number Original line Diff line number Diff line Loading @@ -199,9 +199,7 @@ public class SapServer extends Thread implements Handler.Callback { /* Handle local disconnect procedures */ /* Handle local disconnect procedures */ if (discType == SapMessage.DISC_GRACEFULL) { if (discType == SapMessage.DISC_GRACEFULL) { /* Update the notification to allow the user to initiate a force disconnect */ /* Update the notification to allow the user to initiate a force disconnect */ setNotification( setNotification(SapMessage.DISC_IMMEDIATE, PendingIntent.FLAG_CANCEL_CURRENT); SapMessage.DISC_IMMEDIATE, PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_IMMUTABLE); } else if (discType == SapMessage.DISC_IMMEDIATE) { } else if (discType == SapMessage.DISC_IMMEDIATE) { /* Request an immediate disconnect, but start a timer to force disconnect if the /* Request an immediate disconnect, but start a timer to force disconnect if the Loading Loading @@ -233,7 +231,6 @@ public class SapServer extends Thread implements Handler.Callback { mContext.getString(R.string.bluetooth_sap_notif_title), mContext.getString(R.string.bluetooth_sap_notif_title), NotificationManager.IMPORTANCE_HIGH); NotificationManager.IMPORTANCE_HIGH); notificationManager.createNotificationChannel(notificationChannel); notificationManager.createNotificationChannel(notificationChannel); flags |= PendingIntent.FLAG_IMMUTABLE; Log.v(TAG, "setNotification type: " + type); Log.v(TAG, "setNotification type: " + type); /* For PTS TC_SERVER_DCN_BV_03_I we need to expose the option to send immediate disconnect /* For PTS TC_SERVER_DCN_BV_03_I we need to expose the option to send immediate disconnect * without first sending a graceful disconnect. * without first sending a graceful disconnect. Loading @@ -257,7 +254,11 @@ public class SapServer extends Thread implements Handler.Callback { if (!ptsTest) { if (!ptsTest) { sapDisconnectIntent.putExtra(SapServer.SAP_DISCONNECT_TYPE_EXTRA, type); sapDisconnectIntent.putExtra(SapServer.SAP_DISCONNECT_TYPE_EXTRA, type); PendingIntent pIntentDisconnect = PendingIntent pIntentDisconnect = PendingIntent.getBroadcast(mContext, type, sapDisconnectIntent, flags); PendingIntent.getBroadcast( mContext, type, sapDisconnectIntent, flags | PendingIntent.FLAG_IMMUTABLE); Notification.Action actionDisconnect = Notification.Action actionDisconnect = new Notification.Action.Builder( new Notification.Action.Builder( Icon.createWithResource( Icon.createWithResource( Loading Loading @@ -285,10 +286,16 @@ public class SapServer extends Thread implements Handler.Callback { SapServer.SAP_DISCONNECT_TYPE_EXTRA, SapMessage.DISC_IMMEDIATE); SapServer.SAP_DISCONNECT_TYPE_EXTRA, SapMessage.DISC_IMMEDIATE); PendingIntent pIntentDisconnect = PendingIntent pIntentDisconnect = PendingIntent.getBroadcast( PendingIntent.getBroadcast( mContext, SapMessage.DISC_GRACEFULL, sapDisconnectIntent, flags); mContext, SapMessage.DISC_GRACEFULL, sapDisconnectIntent, flags | PendingIntent.FLAG_IMMUTABLE); PendingIntent pIntentForceDisconnect = PendingIntent pIntentForceDisconnect = PendingIntent.getBroadcast( PendingIntent.getBroadcast( mContext, SapMessage.DISC_IMMEDIATE, sapForceDisconnectIntent, flags); mContext, SapMessage.DISC_IMMEDIATE, sapForceDisconnectIntent, flags | PendingIntent.FLAG_IMMUTABLE); Notification.Action actionDisconnect = Notification.Action actionDisconnect = new Notification.Action.Builder( new Notification.Action.Builder( Icon.createWithResource( Icon.createWithResource( Loading Loading
android/app/Android.bp +1 −0 Original line number Original line Diff line number Diff line Loading @@ -329,6 +329,7 @@ android_app { "-Xep:AndroidFrameworkBinderIdentity:ERROR", "-Xep:AndroidFrameworkBinderIdentity:ERROR", "-Xep:AndroidFrameworkEfficientParcelable:ERROR", "-Xep:AndroidFrameworkEfficientParcelable:ERROR", "-Xep:AndroidFrameworkEfficientStrings:ERROR", "-Xep:AndroidFrameworkEfficientStrings:ERROR", "-Xep:AndroidFrameworkPendingIntentMutability:ERROR", "-Xep:AndroidFrameworkRequiresPermission:ERROR", "-Xep:AndroidFrameworkRequiresPermission:ERROR", "-Xep:BadImport:ERROR", "-Xep:BadImport:ERROR", "-Xep:CatchAndPrintStackTrace:ERROR", "-Xep:CatchAndPrintStackTrace:ERROR", Loading
android/app/src/com/android/bluetooth/avrcpcontroller/BluetoothMediaBrowserService.java +5 −2 Original line number Original line Diff line number Diff line Loading @@ -246,9 +246,12 @@ public class BluetoothMediaBrowserService extends MediaBrowserServiceCompat { Intent launchIntent = new Intent(); Intent launchIntent = new Intent(); launchIntent.setAction(BluetoothPrefs.BLUETOOTH_SETTING_ACTION); launchIntent.setAction(BluetoothPrefs.BLUETOOTH_SETTING_ACTION); launchIntent.addCategory(BluetoothPrefs.BLUETOOTH_SETTING_CATEGORY); launchIntent.addCategory(BluetoothPrefs.BLUETOOTH_SETTING_CATEGORY); int flags = PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE; PendingIntent pendingIntent = PendingIntent pendingIntent = PendingIntent.getActivity(getApplicationContext(), 0, launchIntent, flags); PendingIntent.getActivity( getApplicationContext(), 0, launchIntent, PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE); extras.putParcelable(ERROR_RESOLUTION_ACTION_INTENT, pendingIntent); extras.putParcelable(ERROR_RESOLUTION_ACTION_INTENT, pendingIntent); PlaybackStateCompat errorState = PlaybackStateCompat errorState = new PlaybackStateCompat.Builder() new PlaybackStateCompat.Builder() Loading
android/app/src/com/android/bluetooth/sap/SapServer.java +14 −7 Original line number Original line Diff line number Diff line Loading @@ -199,9 +199,7 @@ public class SapServer extends Thread implements Handler.Callback { /* Handle local disconnect procedures */ /* Handle local disconnect procedures */ if (discType == SapMessage.DISC_GRACEFULL) { if (discType == SapMessage.DISC_GRACEFULL) { /* Update the notification to allow the user to initiate a force disconnect */ /* Update the notification to allow the user to initiate a force disconnect */ setNotification( setNotification(SapMessage.DISC_IMMEDIATE, PendingIntent.FLAG_CANCEL_CURRENT); SapMessage.DISC_IMMEDIATE, PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_IMMUTABLE); } else if (discType == SapMessage.DISC_IMMEDIATE) { } else if (discType == SapMessage.DISC_IMMEDIATE) { /* Request an immediate disconnect, but start a timer to force disconnect if the /* Request an immediate disconnect, but start a timer to force disconnect if the Loading Loading @@ -233,7 +231,6 @@ public class SapServer extends Thread implements Handler.Callback { mContext.getString(R.string.bluetooth_sap_notif_title), mContext.getString(R.string.bluetooth_sap_notif_title), NotificationManager.IMPORTANCE_HIGH); NotificationManager.IMPORTANCE_HIGH); notificationManager.createNotificationChannel(notificationChannel); notificationManager.createNotificationChannel(notificationChannel); flags |= PendingIntent.FLAG_IMMUTABLE; Log.v(TAG, "setNotification type: " + type); Log.v(TAG, "setNotification type: " + type); /* For PTS TC_SERVER_DCN_BV_03_I we need to expose the option to send immediate disconnect /* For PTS TC_SERVER_DCN_BV_03_I we need to expose the option to send immediate disconnect * without first sending a graceful disconnect. * without first sending a graceful disconnect. Loading @@ -257,7 +254,11 @@ public class SapServer extends Thread implements Handler.Callback { if (!ptsTest) { if (!ptsTest) { sapDisconnectIntent.putExtra(SapServer.SAP_DISCONNECT_TYPE_EXTRA, type); sapDisconnectIntent.putExtra(SapServer.SAP_DISCONNECT_TYPE_EXTRA, type); PendingIntent pIntentDisconnect = PendingIntent pIntentDisconnect = PendingIntent.getBroadcast(mContext, type, sapDisconnectIntent, flags); PendingIntent.getBroadcast( mContext, type, sapDisconnectIntent, flags | PendingIntent.FLAG_IMMUTABLE); Notification.Action actionDisconnect = Notification.Action actionDisconnect = new Notification.Action.Builder( new Notification.Action.Builder( Icon.createWithResource( Icon.createWithResource( Loading Loading @@ -285,10 +286,16 @@ public class SapServer extends Thread implements Handler.Callback { SapServer.SAP_DISCONNECT_TYPE_EXTRA, SapMessage.DISC_IMMEDIATE); SapServer.SAP_DISCONNECT_TYPE_EXTRA, SapMessage.DISC_IMMEDIATE); PendingIntent pIntentDisconnect = PendingIntent pIntentDisconnect = PendingIntent.getBroadcast( PendingIntent.getBroadcast( mContext, SapMessage.DISC_GRACEFULL, sapDisconnectIntent, flags); mContext, SapMessage.DISC_GRACEFULL, sapDisconnectIntent, flags | PendingIntent.FLAG_IMMUTABLE); PendingIntent pIntentForceDisconnect = PendingIntent pIntentForceDisconnect = PendingIntent.getBroadcast( PendingIntent.getBroadcast( mContext, SapMessage.DISC_IMMEDIATE, sapForceDisconnectIntent, flags); mContext, SapMessage.DISC_IMMEDIATE, sapForceDisconnectIntent, flags | PendingIntent.FLAG_IMMUTABLE); Notification.Action actionDisconnect = Notification.Action actionDisconnect = new Notification.Action.Builder( new Notification.Action.Builder( Icon.createWithResource( Icon.createWithResource( Loading