Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cb292372 authored by paulhu's avatar paulhu
Browse files

Correct PendingIntent#getActivity() flags

TetheringNotificationUpdater create a PendingIntent with
Intent#FLAG_ACTIVITY_NEW_TASK flag. But this flag is used for
Intent only. Thus, move this flag into Intent.

Bug: 158639789
Test: atest TetheringTests
Change-Id: I4c3af75c87b797bcde9356a94c835c7422dac1c6
parent 51e93653
Loading
Loading
Loading
Loading
+6 −4
Original line number Original line Diff line number Diff line
@@ -273,8 +273,9 @@ public class TetheringNotificationUpdater {
                mContext.createContextAsUser(UserHandle.CURRENT, 0 /* flags */),
                mContext.createContextAsUser(UserHandle.CURRENT, 0 /* flags */),
                0 /* requestCode */,
                0 /* requestCode */,
                new Intent(Settings.ACTION_TETHER_SETTINGS)
                new Intent(Settings.ACTION_TETHER_SETTINGS)
                        .setPackage(getSettingsPackageName(mContext.getPackageManager())),
                        .setPackage(getSettingsPackageName(mContext.getPackageManager()))
                Intent.FLAG_ACTIVITY_NEW_TASK | PendingIntent.FLAG_IMMUTABLE,
                        .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK),
                PendingIntent.FLAG_IMMUTABLE,
                null /* options */);
                null /* options */);


        showNotification(R.drawable.stat_sys_tether_general, title, message,
        showNotification(R.drawable.stat_sys_tether_general, title, message,
@@ -317,8 +318,9 @@ public class TetheringNotificationUpdater {
                mContext.createContextAsUser(UserHandle.CURRENT, 0 /* flags */),
                mContext.createContextAsUser(UserHandle.CURRENT, 0 /* flags */),
                0 /* requestCode */,
                0 /* requestCode */,
                new Intent(Settings.ACTION_TETHER_SETTINGS)
                new Intent(Settings.ACTION_TETHER_SETTINGS)
                        .setPackage(getSettingsPackageName(mContext.getPackageManager())),
                        .setPackage(getSettingsPackageName(mContext.getPackageManager()))
                Intent.FLAG_ACTIVITY_NEW_TASK | PendingIntent.FLAG_IMMUTABLE,
                        .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK),
                PendingIntent.FLAG_IMMUTABLE,
                null /* options */);
                null /* options */);


        showNotification(R.drawable.stat_sys_tether_general, title, message,
        showNotification(R.drawable.stat_sys_tether_general, title, message,