Skip to content

Commit

Permalink
DO NOT MERGE Stricter NetworkNotificationManagerTest
Browse files Browse the repository at this point in the history
This patch changes NetworkNotificationManagerTest to populate extraInfo
of NetworkInfo in order to catch regressions in malformed format Strings
of log statements in NetworkNotificationManager.

Test: verified that the test fails when reintroducing the format String
bug.
Bug: 33737715

Change-Id: If14063554b8246d9d80cd222cb41c30dee121c5a
  • Loading branch information
hugobenichigoogle committed Dec 20, 2016
1 parent 7eaec19 commit a865790
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ tag, nameOf(eventId), getTransportName(transportType), extraInfo,
details = r.getString(R.string.network_switch_metered_detail, toTransport,
fromTransport);
} else {
Slog.wtf(TAG, "Unknown notification type " + notifyType + "on network transport "
Slog.wtf(TAG, "Unknown notification type " + notifyType + " on network transport "
+ getTransportName(transportType));
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ public void setUp() {
when(mCtx.getResources()).thenReturn(mResources);
when(mCtx.getPackageManager()).thenReturn(mPm);
when(mCtx.getApplicationInfo()).thenReturn(new ApplicationInfo());
when(mNetworkInfo.getExtraInfo()).thenReturn("extra");
when(mResources.getColor(anyInt(), any())).thenReturn(0xFF607D8B);

mManager = new NetworkNotificationManager(mCtx, mTelephonyManager, mNotificationManager);
Expand Down

0 comments on commit a865790

Please sign in to comment.