browserIntent needs proper flags for PendingIntent

Previously the browserIntent was updated after the call to
PendingIntent.getActivity. It should be updated correctly
before the PendingIntent.getActivity call so that the
PendingIntent is correctly created for the browser instead
of the Instant App.

Test: Existing tests, manually tested fixed behavior.

Bug: 35873804
Change-Id: Ie77344a4190fbc6a3896b02e3adfcdd29985006d
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java
index bd16c96..5690495 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java
@@ -561,12 +561,14 @@
         Intent browserIntent = getTaskIntent(taskId, userId);
         Notification.Builder builder = new Notification.Builder(mContext, NotificationChannels.GENERAL);
         if (browserIntent != null) {
+            // Make sure that this doesn't resolve back to an instant app
+            browserIntent.setComponent(null)
+                    .setPackage(null)
+                    .addFlags(Intent.FLAG_IGNORE_EPHEMERAL)
+                    .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+
             PendingIntent pendingIntent = PendingIntent.getActivity(mContext,
                     0 /* requestCode */, browserIntent, 0 /* flags */);
-            browserIntent.setComponent(null);
-            browserIntent.addFlags(Intent.FLAG_IGNORE_EPHEMERAL);
-            browserIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
-
             ComponentName aiaComponent = null;
             try {
                 aiaComponent = AppGlobals.getPackageManager().getInstantAppInstallerComponent();