OSDN Git Service

Group injected tiles together based on package name.
authorFan Zhang <zhfan@google.com>
Mon, 14 Nov 2016 17:48:06 +0000 (09:48 -0800)
committerFan Zhang <zhfan@google.com>
Mon, 14 Nov 2016 23:37:49 +0000 (15:37 -0800)
commitfc76ab3cbf1794d2d72a92c87afc1cf9f62cc03a
treeabe2d081a66364d68d49f6627e5f89ecc50f765a
parent04c0d2b5683fc011f7a757bd1966b935726a456a
Group injected tiles together based on package name.

During grouping, tiles are sorted based on package name, and their own
priority value. However if the package is Settings itself, the ordering
is not changed.

Before sort: [pkg1, 100], [pgk2, 120], [pkg1, 130]
After sort: [pkg1, 1], [pkg1, 2], [pkg2,3]

This is necessary to make sure settings app have the overall control of
ordering of all dynamic tiles. When each app define their priority, they
don't have access to the global vision of what other settings are on
screen so it's possible different app define conflicting orderings.
Settings app is the only reasonable place to rank them properly.

Bug: 32827787
Test: RunSettingsLibRoboTests
Change-Id: I38de55530e61da9de7532ef6a7ee97ef89aca9d9
packages/SettingsLib/src/com/android/settingslib/drawer/CategoryManager.java
packages/SettingsLib/tests/robotests/src/com/android/settingslib/drawer/CategoryManagerTest.java