Merge "Re-add checks for mutable intents on bubbles" into sc-dev
This commit is contained in:
@@ -10159,6 +10159,8 @@ public class Notification implements Parcelable
|
|||||||
* {@link Activity#isLaunchedFromBubble()} will return with {@code true}.
|
* {@link Activity#isLaunchedFromBubble()} will return with {@code true}.
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
|
* Note that the pending intent used here requires PendingIntent.FLAG_MUTABLE.
|
||||||
|
*
|
||||||
* @throws NullPointerException if intent is null.
|
* @throws NullPointerException if intent is null.
|
||||||
* @throws NullPointerException if icon is null.
|
* @throws NullPointerException if icon is null.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -6579,15 +6579,14 @@ public class NotificationManagerService extends SystemService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// bubble or inline reply that's immutable?
|
// bubble or inline reply that's immutable?
|
||||||
// TODO (b/171418004): renable after app outreach
|
if (n.getBubbleMetadata() != null
|
||||||
/*if (n.getBubbleMetadata() != null
|
|
||||||
&& n.getBubbleMetadata().getIntent() != null
|
&& n.getBubbleMetadata().getIntent() != null
|
||||||
&& hasFlag(mAmi.getPendingIntentFlags(
|
&& hasFlag(mAmi.getPendingIntentFlags(
|
||||||
n.getBubbleMetadata().getIntent().getTarget()),
|
n.getBubbleMetadata().getIntent().getTarget()),
|
||||||
PendingIntent.FLAG_IMMUTABLE)) {
|
PendingIntent.FLAG_IMMUTABLE)) {
|
||||||
throw new IllegalArgumentException(r.getKey() + " Not posted."
|
throw new IllegalArgumentException(r.getKey() + " Not posted."
|
||||||
+ " PendingIntents attached to bubbles must be mutable");
|
+ " PendingIntents attached to bubbles must be mutable");
|
||||||
}*/
|
}
|
||||||
|
|
||||||
if (n.actions != null) {
|
if (n.actions != null) {
|
||||||
for (Notification.Action action : n.actions) {
|
for (Notification.Action action : n.actions) {
|
||||||
|
|||||||
@@ -7811,8 +7811,7 @@ public class NotificationManagerServiceTest extends UiServiceTestCase {
|
|||||||
inOrder.verify(child).recordDismissalSentiment(anyInt());
|
inOrder.verify(child).recordDismissalSentiment(anyInt());
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO (b/171418004): renable after app outreach
|
@Test
|
||||||
/*@Test
|
|
||||||
public void testImmutableBubbleIntent() throws Exception {
|
public void testImmutableBubbleIntent() throws Exception {
|
||||||
when(mAmi.getPendingIntentFlags(pi1))
|
when(mAmi.getPendingIntentFlags(pi1))
|
||||||
.thenReturn(FLAG_IMMUTABLE | FLAG_ONE_SHOT);
|
.thenReturn(FLAG_IMMUTABLE | FLAG_ONE_SHOT);
|
||||||
@@ -7827,7 +7826,7 @@ public class NotificationManagerServiceTest extends UiServiceTestCase {
|
|||||||
} catch (IllegalArgumentException e) {
|
} catch (IllegalArgumentException e) {
|
||||||
// good
|
// good
|
||||||
}
|
}
|
||||||
}*/
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testMutableBubbleIntent() throws Exception {
|
public void testMutableBubbleIntent() throws Exception {
|
||||||
|
|||||||
Reference in New Issue
Block a user