summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Hugo Benichi <hugobenichi@google.com> 2017-05-18 03:20:50 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2017-05-18 03:20:51 +0000
commitc13a80deee9990ea5fe370d19ab69964f52ea799 (patch)
treee254e8b2e976e4eba156883b24ff0e87566891bf
parent3a7c4f3337a1e9891258422c67b6b392ec090f4b (diff)
parente6181b0c47c161be56bbc07f69275fe768634b82 (diff)
Merge "Fix NetworkNotificationManagerTest"
-rw-r--r--tests/net/java/com/android/server/connectivity/NetworkNotificationManagerTest.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/net/java/com/android/server/connectivity/NetworkNotificationManagerTest.java b/tests/net/java/com/android/server/connectivity/NetworkNotificationManagerTest.java
index 21c2de79d68b..f201bc7a7d3c 100644
--- a/tests/net/java/com/android/server/connectivity/NetworkNotificationManagerTest.java
+++ b/tests/net/java/com/android/server/connectivity/NetworkNotificationManagerTest.java
@@ -91,7 +91,7 @@ public class NetworkNotificationManagerTest extends TestCase {
final int NETWORK_ID_BASE = 100;
List<NotificationType> types = Arrays.asList(NotificationType.values());
List<Integer> ids = new ArrayList<>(types.size());
- for (int i = 0; i < ids.size(); i++) {
+ for (int i = 0; i < types.size(); i++) {
ids.add(NETWORK_ID_BASE + i);
}
Collections.shuffle(ids);
@@ -101,9 +101,10 @@ public class NetworkNotificationManagerTest extends TestCase {
mManager.showNotification(ids.get(i), types.get(i), mWifiNai, mCellNai, null, false);
}
- Collections.shuffle(ids);
+ List<Integer> idsToClear = new ArrayList<>(ids);
+ Collections.shuffle(idsToClear);
for (int i = 0; i < ids.size(); i++) {
- mManager.clearNotification(ids.get(i));
+ mManager.clearNotification(idsToClear.get(i));
}
for (int i = 0; i < ids.size(); i++) {