Loading android/app/src/com/android/bluetooth/btservice/AdapterService.java +2 −1 Original line number Diff line number Diff line Loading @@ -2861,7 +2861,8 @@ public class AdapterService extends Service { Intent intent = new Intent(ACTION_ALARM_WAKEUP); mPendingAlarm = PendingIntent.getBroadcast(this, 0, intent, PendingIntent.FLAG_ONE_SHOT); PendingIntent.getBroadcast(this, 0, intent, PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE); mAlarmManager.setExact(type, wakeupTime, mPendingAlarm); return true; } Loading android/app/src/com/android/bluetooth/gatt/ScanManager.java +2 −1 Original line number Diff line number Diff line Loading @@ -539,7 +539,8 @@ public class ScanManager { mAlarmManager = (AlarmManager) mService.getSystemService(Context.ALARM_SERVICE); Intent batchIntent = new Intent(ACTION_REFRESH_BATCHED_SCAN, null); mBatchScanIntervalIntent = PendingIntent.getBroadcast(mService, 0, batchIntent, 0); mBatchScanIntervalIntent = PendingIntent.getBroadcast(mService, 0, batchIntent, PendingIntent.FLAG_IMMUTABLE); IntentFilter filter = new IntentFilter(); filter.addAction(ACTION_REFRESH_BATCHED_SCAN); mBatchAlarmReceiver = new BroadcastReceiver() { Loading android/app/src/com/android/bluetooth/map/BluetoothMapContentObserver.java +4 −3 Original line number Diff line number Diff line Loading @@ -2857,7 +2857,8 @@ public class BluetoothMapContentObserver { sentIntent.putExtra(EXTRA_MESSAGE_SENT_RETRY, retry); //sentIntent.setDataAndNormalize(btMmsUri); PendingIntent pendingSendIntent = PendingIntent.getBroadcast(mContext, 0, sentIntent, 0); PendingIntent.getBroadcast(mContext, 0, sentIntent, PendingIntent.FLAG_IMMUTABLE); SmsManager.getDefault() .sendMultimediaMessage(mContext, btMmsUri, null/*locationUrl*/, null/*configOverrides*/, Loading Loading @@ -3206,7 +3207,7 @@ public class BluetoothMapContentObserver { intentDelivery.putExtra(EXTRA_MESSAGE_SENT_TIMESTAMP, msgInfo.timestamp); PendingIntent pendingIntentDelivery = PendingIntent.getBroadcast(mContext, 0, intentDelivery, PendingIntent.FLAG_UPDATE_CURRENT); PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE); intentSent = new Intent(ACTION_MESSAGE_SENT, null); /* Add msgId and part number to ensure the intents are different, and we Loading @@ -3221,7 +3222,7 @@ public class BluetoothMapContentObserver { PendingIntent pendingIntentSent = PendingIntent.getBroadcast(mContext, 0, intentSent, PendingIntent.FLAG_UPDATE_CURRENT); PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE); // We use the same pending intent for all parts, but do not set the one shot flag. deliveryIntents.add(pendingIntentDelivery); Loading android/app/src/com/android/bluetooth/map/BluetoothMapService.java +4 −2 Original line number Diff line number Diff line Loading @@ -950,7 +950,8 @@ public class BluetoothMapService extends ProfileService { } mRemoveTimeoutMsg = true; Intent timeoutIntent = new Intent(USER_CONFIRM_TIMEOUT_ACTION); PendingIntent pIntent = PendingIntent.getBroadcast(this, 0, timeoutIntent, 0); PendingIntent pIntent = PendingIntent.getBroadcast(this, 0, timeoutIntent, PendingIntent.FLAG_IMMUTABLE); mAlarmManager.set(AlarmManager.RTC_WAKEUP, System.currentTimeMillis() + USER_CONFIRM_TIMEOUT_VALUE, pIntent); } Loading @@ -960,7 +961,8 @@ public class BluetoothMapService extends ProfileService { Log.d(TAG, "cancelUserTimeOutAlarm()"); } Intent timeoutIntent = new Intent(USER_CONFIRM_TIMEOUT_ACTION); PendingIntent pIntent = PendingIntent.getBroadcast(this, 0, timeoutIntent, 0); PendingIntent pIntent = PendingIntent.getBroadcast(this, 0, timeoutIntent, PendingIntent.FLAG_IMMUTABLE); pIntent.cancel(); AlarmManager alarmManager = (AlarmManager) this.getSystemService(Context.ALARM_SERVICE); Loading android/app/src/com/android/bluetooth/opp/BluetoothOppNotification.java +22 −11 Original line number Diff line number Diff line Loading @@ -390,7 +390,8 @@ class BluetoothOppNotification { intent.setClassName(Constants.THIS_PACKAGE_NAME, BluetoothOppReceiver.class.getName()); intent.setDataAndNormalize(Uri.parse(BluetoothShare.CONTENT_URI + "/" + item.id)); b.setContentIntent(PendingIntent.getBroadcast(mContext, 0, intent, 0)); b.setContentIntent(PendingIntent.getBroadcast(mContext, 0, intent, PendingIntent.FLAG_IMMUTABLE)); mNotificationMgr.notify(NOTIFICATION_ID_PROGRESS, b.build()); } } Loading Loading @@ -458,9 +459,11 @@ class BluetoothOppNotification { .system_notification_accent_color, mContext.getTheme())) .setContentIntent( PendingIntent.getBroadcast(mContext, 0, contentIntent, 0)) PendingIntent.getBroadcast(mContext, 0, contentIntent, PendingIntent.FLAG_IMMUTABLE)) .setDeleteIntent( PendingIntent.getBroadcast(mContext, 0, deleteIntent, 0)) PendingIntent.getBroadcast(mContext, 0, deleteIntent, PendingIntent.FLAG_IMMUTABLE)) .setWhen(timeStamp) .setLocalOnly(true) .build(); Loading Loading @@ -523,10 +526,13 @@ class BluetoothOppNotification { com.android.internal.R.color .system_notification_accent_color, mContext.getTheme())) .setContentIntent( PendingIntent.getBroadcast(mContext, 0, contentIntent, 0)) PendingIntent.getBroadcast(mContext, 0, contentIntent, PendingIntent.FLAG_IMMUTABLE)) .setDeleteIntent( PendingIntent.getBroadcast(mContext, 0, deleteIntent, 0)) PendingIntent.getBroadcast(mContext, 0, deleteIntent, PendingIntent.FLAG_IMMUTABLE)) .setWhen(timeStamp) .setLocalOnly(true) .build(); Loading Loading @@ -563,12 +569,13 @@ class BluetoothOppNotification { mContext.getText(R.string.incoming_file_confirm_cancel), PendingIntent.getBroadcast(mContext, 0, new Intent(baseIntent).setAction(Constants.ACTION_DECLINE), 0)).build(); PendingIntent.FLAG_IMMUTABLE)).build(); Notification.Action actionAccept = new Notification.Action.Builder( Icon.createWithResource(mContext,R.drawable.ic_accept), mContext.getText(R.string.incoming_file_confirm_ok), PendingIntent.getBroadcast(mContext, 0, new Intent(baseIntent).setAction(Constants.ACTION_ACCEPT), 0)).build(); new Intent(baseIntent).setAction(Constants.ACTION_ACCEPT), PendingIntent.FLAG_IMMUTABLE)).build(); Notification public_n = new Notification.Builder(mContext, OPP_NOTIFICATION_CHANNEL).setOnlyAlertOnce( true) Loading @@ -578,9 +585,11 @@ class BluetoothOppNotification { .addAction(actionAccept) .setContentIntent(PendingIntent.getBroadcast(mContext, 0, new Intent(baseIntent).setAction( Constants.ACTION_INCOMING_FILE_CONFIRM), 0)) Constants.ACTION_INCOMING_FILE_CONFIRM), PendingIntent.FLAG_IMMUTABLE)) .setDeleteIntent(PendingIntent.getBroadcast(mContext, 0, new Intent(baseIntent).setAction(Constants.ACTION_HIDE), 0)) new Intent(baseIntent).setAction(Constants.ACTION_HIDE), PendingIntent.FLAG_IMMUTABLE)) .setColor(mContext.getResources() .getColor( com.android.internal.R.color Loading @@ -603,9 +612,11 @@ class BluetoothOppNotification { .setWhen(info.mTimeStamp) .setContentIntent(PendingIntent.getBroadcast(mContext, 0, new Intent(baseIntent).setAction( Constants.ACTION_INCOMING_FILE_CONFIRM), 0)) Constants.ACTION_INCOMING_FILE_CONFIRM), PendingIntent.FLAG_IMMUTABLE)) .setDeleteIntent(PendingIntent.getBroadcast(mContext, 0, new Intent(baseIntent).setAction(Constants.ACTION_HIDE), 0)) new Intent(baseIntent).setAction(Constants.ACTION_HIDE), PendingIntent.FLAG_IMMUTABLE)) .setColor(mContext.getResources() .getColor( com.android.internal.R.color Loading Loading
android/app/src/com/android/bluetooth/btservice/AdapterService.java +2 −1 Original line number Diff line number Diff line Loading @@ -2861,7 +2861,8 @@ public class AdapterService extends Service { Intent intent = new Intent(ACTION_ALARM_WAKEUP); mPendingAlarm = PendingIntent.getBroadcast(this, 0, intent, PendingIntent.FLAG_ONE_SHOT); PendingIntent.getBroadcast(this, 0, intent, PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE); mAlarmManager.setExact(type, wakeupTime, mPendingAlarm); return true; } Loading
android/app/src/com/android/bluetooth/gatt/ScanManager.java +2 −1 Original line number Diff line number Diff line Loading @@ -539,7 +539,8 @@ public class ScanManager { mAlarmManager = (AlarmManager) mService.getSystemService(Context.ALARM_SERVICE); Intent batchIntent = new Intent(ACTION_REFRESH_BATCHED_SCAN, null); mBatchScanIntervalIntent = PendingIntent.getBroadcast(mService, 0, batchIntent, 0); mBatchScanIntervalIntent = PendingIntent.getBroadcast(mService, 0, batchIntent, PendingIntent.FLAG_IMMUTABLE); IntentFilter filter = new IntentFilter(); filter.addAction(ACTION_REFRESH_BATCHED_SCAN); mBatchAlarmReceiver = new BroadcastReceiver() { Loading
android/app/src/com/android/bluetooth/map/BluetoothMapContentObserver.java +4 −3 Original line number Diff line number Diff line Loading @@ -2857,7 +2857,8 @@ public class BluetoothMapContentObserver { sentIntent.putExtra(EXTRA_MESSAGE_SENT_RETRY, retry); //sentIntent.setDataAndNormalize(btMmsUri); PendingIntent pendingSendIntent = PendingIntent.getBroadcast(mContext, 0, sentIntent, 0); PendingIntent.getBroadcast(mContext, 0, sentIntent, PendingIntent.FLAG_IMMUTABLE); SmsManager.getDefault() .sendMultimediaMessage(mContext, btMmsUri, null/*locationUrl*/, null/*configOverrides*/, Loading Loading @@ -3206,7 +3207,7 @@ public class BluetoothMapContentObserver { intentDelivery.putExtra(EXTRA_MESSAGE_SENT_TIMESTAMP, msgInfo.timestamp); PendingIntent pendingIntentDelivery = PendingIntent.getBroadcast(mContext, 0, intentDelivery, PendingIntent.FLAG_UPDATE_CURRENT); PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE); intentSent = new Intent(ACTION_MESSAGE_SENT, null); /* Add msgId and part number to ensure the intents are different, and we Loading @@ -3221,7 +3222,7 @@ public class BluetoothMapContentObserver { PendingIntent pendingIntentSent = PendingIntent.getBroadcast(mContext, 0, intentSent, PendingIntent.FLAG_UPDATE_CURRENT); PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE); // We use the same pending intent for all parts, but do not set the one shot flag. deliveryIntents.add(pendingIntentDelivery); Loading
android/app/src/com/android/bluetooth/map/BluetoothMapService.java +4 −2 Original line number Diff line number Diff line Loading @@ -950,7 +950,8 @@ public class BluetoothMapService extends ProfileService { } mRemoveTimeoutMsg = true; Intent timeoutIntent = new Intent(USER_CONFIRM_TIMEOUT_ACTION); PendingIntent pIntent = PendingIntent.getBroadcast(this, 0, timeoutIntent, 0); PendingIntent pIntent = PendingIntent.getBroadcast(this, 0, timeoutIntent, PendingIntent.FLAG_IMMUTABLE); mAlarmManager.set(AlarmManager.RTC_WAKEUP, System.currentTimeMillis() + USER_CONFIRM_TIMEOUT_VALUE, pIntent); } Loading @@ -960,7 +961,8 @@ public class BluetoothMapService extends ProfileService { Log.d(TAG, "cancelUserTimeOutAlarm()"); } Intent timeoutIntent = new Intent(USER_CONFIRM_TIMEOUT_ACTION); PendingIntent pIntent = PendingIntent.getBroadcast(this, 0, timeoutIntent, 0); PendingIntent pIntent = PendingIntent.getBroadcast(this, 0, timeoutIntent, PendingIntent.FLAG_IMMUTABLE); pIntent.cancel(); AlarmManager alarmManager = (AlarmManager) this.getSystemService(Context.ALARM_SERVICE); Loading
android/app/src/com/android/bluetooth/opp/BluetoothOppNotification.java +22 −11 Original line number Diff line number Diff line Loading @@ -390,7 +390,8 @@ class BluetoothOppNotification { intent.setClassName(Constants.THIS_PACKAGE_NAME, BluetoothOppReceiver.class.getName()); intent.setDataAndNormalize(Uri.parse(BluetoothShare.CONTENT_URI + "/" + item.id)); b.setContentIntent(PendingIntent.getBroadcast(mContext, 0, intent, 0)); b.setContentIntent(PendingIntent.getBroadcast(mContext, 0, intent, PendingIntent.FLAG_IMMUTABLE)); mNotificationMgr.notify(NOTIFICATION_ID_PROGRESS, b.build()); } } Loading Loading @@ -458,9 +459,11 @@ class BluetoothOppNotification { .system_notification_accent_color, mContext.getTheme())) .setContentIntent( PendingIntent.getBroadcast(mContext, 0, contentIntent, 0)) PendingIntent.getBroadcast(mContext, 0, contentIntent, PendingIntent.FLAG_IMMUTABLE)) .setDeleteIntent( PendingIntent.getBroadcast(mContext, 0, deleteIntent, 0)) PendingIntent.getBroadcast(mContext, 0, deleteIntent, PendingIntent.FLAG_IMMUTABLE)) .setWhen(timeStamp) .setLocalOnly(true) .build(); Loading Loading @@ -523,10 +526,13 @@ class BluetoothOppNotification { com.android.internal.R.color .system_notification_accent_color, mContext.getTheme())) .setContentIntent( PendingIntent.getBroadcast(mContext, 0, contentIntent, 0)) PendingIntent.getBroadcast(mContext, 0, contentIntent, PendingIntent.FLAG_IMMUTABLE)) .setDeleteIntent( PendingIntent.getBroadcast(mContext, 0, deleteIntent, 0)) PendingIntent.getBroadcast(mContext, 0, deleteIntent, PendingIntent.FLAG_IMMUTABLE)) .setWhen(timeStamp) .setLocalOnly(true) .build(); Loading Loading @@ -563,12 +569,13 @@ class BluetoothOppNotification { mContext.getText(R.string.incoming_file_confirm_cancel), PendingIntent.getBroadcast(mContext, 0, new Intent(baseIntent).setAction(Constants.ACTION_DECLINE), 0)).build(); PendingIntent.FLAG_IMMUTABLE)).build(); Notification.Action actionAccept = new Notification.Action.Builder( Icon.createWithResource(mContext,R.drawable.ic_accept), mContext.getText(R.string.incoming_file_confirm_ok), PendingIntent.getBroadcast(mContext, 0, new Intent(baseIntent).setAction(Constants.ACTION_ACCEPT), 0)).build(); new Intent(baseIntent).setAction(Constants.ACTION_ACCEPT), PendingIntent.FLAG_IMMUTABLE)).build(); Notification public_n = new Notification.Builder(mContext, OPP_NOTIFICATION_CHANNEL).setOnlyAlertOnce( true) Loading @@ -578,9 +585,11 @@ class BluetoothOppNotification { .addAction(actionAccept) .setContentIntent(PendingIntent.getBroadcast(mContext, 0, new Intent(baseIntent).setAction( Constants.ACTION_INCOMING_FILE_CONFIRM), 0)) Constants.ACTION_INCOMING_FILE_CONFIRM), PendingIntent.FLAG_IMMUTABLE)) .setDeleteIntent(PendingIntent.getBroadcast(mContext, 0, new Intent(baseIntent).setAction(Constants.ACTION_HIDE), 0)) new Intent(baseIntent).setAction(Constants.ACTION_HIDE), PendingIntent.FLAG_IMMUTABLE)) .setColor(mContext.getResources() .getColor( com.android.internal.R.color Loading @@ -603,9 +612,11 @@ class BluetoothOppNotification { .setWhen(info.mTimeStamp) .setContentIntent(PendingIntent.getBroadcast(mContext, 0, new Intent(baseIntent).setAction( Constants.ACTION_INCOMING_FILE_CONFIRM), 0)) Constants.ACTION_INCOMING_FILE_CONFIRM), PendingIntent.FLAG_IMMUTABLE)) .setDeleteIntent(PendingIntent.getBroadcast(mContext, 0, new Intent(baseIntent).setAction(Constants.ACTION_HIDE), 0)) new Intent(baseIntent).setAction(Constants.ACTION_HIDE), PendingIntent.FLAG_IMMUTABLE)) .setColor(mContext.getResources() .getColor( com.android.internal.R.color Loading