OSDN Git Service

DO NOT MERGE Network notifications: revamp keying scheme
authorHugo Benichi <hugobenichi@google.com>
Thu, 8 Dec 2016 00:36:52 +0000 (09:36 +0900)
committerHugo Benichi <hugobenichi@google.com>
Thu, 15 Dec 2016 11:31:11 +0000 (20:31 +0900)
commit84daaea8fdaf58c76b4c04dee96967e478b9c595
tree7c088bce3e9cd0978fa2c9b2ef24ea6ec23fa816
parent065acc5a6c0bbe32327ea2a54f7c4d771465afeb
DO NOT MERGE Network notifications: revamp keying scheme

This patch changes the (tag: String, id: Int) keying scheme for network
notifications so that TRON notification counters can count network
related notifications unambiguously.

TRON instruments all notifications shown for package "android" as well
as user interactions with these Notifications. These counters are
grouped by id. However the network notifications ("no internet" dialog,
"captive portal sign in" dialog, ...) use a static tag and a dynamic id
for keying notifications, preventing the counters to correctly
aggregate. In addition there is also the risk of collision with other
SystemUi notification ids not managed by NetworkNotificationManager.

In order to make the TRON counters useful for network notifications,
the id is now encoding the network notification type in a stable way
while the tag is used to uniquely identify network notifications.

Test: change covered by previously added new unit tests.
Bug: 32198726
Bug: 33030620

(cherry picked from commit fb2609d3eee1c7a4dda889c000f32183a044978a)

Change-Id: Iadf7f15da38de28587090ed0395f15c24d4ad442
services/core/java/com/android/server/connectivity/NetworkNotificationManager.java
tests/net/java/com/android/server/connectivity/NetworkNotificationManagerTest.java