From 02ca23d9a29d65bd224ff82e4363c93a9495effc Mon Sep 17 00:00:00 2001 From: Joe LaPenna Date: Mon, 19 Dec 2016 10:31:14 -0800 Subject: [PATCH 1/2] DO NOT MERGE Fix malformed log statement. Introduced in I1201d1d4fab8183dd83449c2afb2c35cfece883f BUG: 33746580 Test: built, triggered notification, no crash. (cherry picked from commit e1406167186c2cabe683b3c1511ad6733e9106c9) Change-Id: I50594ad865e6f95abc5c67c58af604ef2aa88f9b --- .../android/server/connectivity/NetworkNotificationManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/connectivity/NetworkNotificationManager.java b/services/core/java/com/android/server/connectivity/NetworkNotificationManager.java index c051642a2151c..777f7e7e0a7d7 100644 --- a/services/core/java/com/android/server/connectivity/NetworkNotificationManager.java +++ b/services/core/java/com/android/server/connectivity/NetworkNotificationManager.java @@ -142,7 +142,7 @@ public class NetworkNotificationManager { if (DBG) { Slog.d(TAG, String.format( - "showNotification tag=%s event=%s transport=%s extraInfo=%d highPrioriy=%s", + "showNotification tag=%s event=%s transport=%s extraInfo=%s highPrioriy=%s", tag, nameOf(eventId), getTransportName(transportType), extraInfo, highPriority)); } From 8e21030679a104fdb1ba3d02db6d3cb2920b55c1 Mon Sep 17 00:00:00 2001 From: Paul Stewart Date: Mon, 19 Dec 2016 08:45:32 -0800 Subject: [PATCH 2/2] DO NOT MERGE Fix other String.format issues in NetworkNotificationManager.java Commit fb2609d3eee1c7a4dda889c000f32183a044978a added a string format which caused an exception. On top of the fixes to this from e1406167186c2cabe683b3c1511ad6733e9106c9, we can also fix a few more issues here with some missing arguments to other String.format invocations in the aforementioned CL, and other formatting problems. Bug: 33737715 Test: Build and run SUW (cherry picked from commit 835cb49639fc7cb75819564fa15f2f5a0bd5dee2) Change-Id: I40064d3e1a0f0300c43bdbc51839b579a5394a36 --- .../server/connectivity/NetworkNotificationManager.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/services/core/java/com/android/server/connectivity/NetworkNotificationManager.java b/services/core/java/com/android/server/connectivity/NetworkNotificationManager.java index 777f7e7e0a7d7..9166bb3d87f7e 100644 --- a/services/core/java/com/android/server/connectivity/NetworkNotificationManager.java +++ b/services/core/java/com/android/server/connectivity/NetworkNotificationManager.java @@ -143,7 +143,8 @@ public class NetworkNotificationManager { if (DBG) { Slog.d(TAG, String.format( "showNotification tag=%s event=%s transport=%s extraInfo=%s highPrioriy=%s", - tag, nameOf(eventId), getTransportName(transportType), extraInfo, highPriority)); + tag, nameOf(eventId), getTransportName(transportType), extraInfo, + highPriority)); } Resources r = Resources.getSystem(); @@ -227,13 +228,14 @@ public class NetworkNotificationManager { } final int eventId = mNotificationTypeMap.get(id); if (DBG) { - Slog.d(TAG, String.format("clearing notification tag=%s event=", tag, nameOf(eventId))); + Slog.d(TAG, String.format("clearing notification tag=%s event=%s", tag, + nameOf(eventId))); } try { mNotificationManager.cancelAsUser(tag, eventId, UserHandle.ALL); } catch (NullPointerException npe) { Slog.d(TAG, String.format( - "failed to clear notification tag=%s event=", tag, nameOf(eventId)), npe); + "failed to clear notification tag=%s event=%s", tag, nameOf(eventId)), npe); } mNotificationTypeMap.delete(id); }