wifi: Add flag FLAG_IMMUTABLE in SAP notification

In S, it requires to specify explicitly either FLAG_MUTABLE
or FLAG_IMMUTABLE when creating a PendingIntent.

The SoftAp Notification is used to notify user the configuration changed.
And it supports to launch Setting page to show the current configuration.
Based on the flag description, the FLAG_MUTABLE should be considered when
the notification need to be used with inline reply or bubbles.
But it is not the use case on SoftAp Notification.
Use FLAG_IMMUTABLE.

Bug: 171719799
Test: Manuel Test
Change-Id: Id3df909f7754931e8018d7b8f6d07aba58158cbe
This commit is contained in:
lesl
2020-11-30 18:48:25 +08:00
committed by Les Lee
parent 26ca287da7
commit 6a334ed1cb

View File

@@ -82,6 +82,7 @@ public class WifiSoftApConfigChangedNotifier {
private static PendingIntent getPendingActivity(Context context) {
Intent intent = new Intent("com.android.settings.WIFI_TETHER_SETTINGS")
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
return PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
return PendingIntent.getActivity(context, 0, intent,
PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE);
}
}