OSDN Git Service

Dramatically simplify NotificationRankingUpdate.
authorDan Sandler <dsandler@android.com>
Tue, 29 Jan 2019 18:58:52 +0000 (13:58 -0500)
committerDan Sandler <dsandler@android.com>
Thu, 6 Jun 2019 19:43:23 +0000 (15:43 -0400)
commitba666f8f5448d30cac6b183cefabaa1a6f07c8e3
tree67b33220bada8c4ebff7873a47589bbcd6e96de9
parent57854d3b902b72bd61ab7041097a9492e841e66b
Dramatically simplify NotificationRankingUpdate.

It is now simply a container for a parceled RankingMap,
which can be unparceled entirely into objects in the
listener's heap and discarded. Notification key strings are
interned (by reference into the Ranking data structure).

This should save a considerable amount of RAM:

 - parceled Bundles hanging around in the listener process,
   waiting to be unparceled, never freed
 - a dozen copies of the notification key string

Bug: 133763354
Test: atest NotificationManagerServiceTest NotificationListenerServiceTest NotificationDataTest
Test: coretests, cts, etc.
Change-Id: I5d8ab5c8f27c70f4af7051b24608ba0d1f2dd5cd
core/java/android/service/notification/NotificationListenerService.java
core/java/android/service/notification/NotificationRankingUpdate.java
services/core/java/com/android/server/notification/NotificationManagerService.java
services/tests/uiservicestests/src/com/android/server/notification/NotificationListenerServiceTest.java