Commit Graph

11 Commits

Author SHA1 Message Date
Tsung-Mao Fang
327dba2488 Fix UI janky in privacy settings
Set a summary holder for initial preference at the biginning.
If there is no any permission granted, then set a string for it.

Test: Rebuild, visual
Fixes: 140783222
Change-Id: Ic5f2730123110bad5fbc08fcd22b1df564b8637d
2019-10-28 18:39:11 +08:00
Yi-Ling Chuang
922064ed69 Limit the number of permissions being displayed.
To avoid a long permission summary, let's limit the number to three.

Fixes: 117978938
Test: robotests
Change-Id: Id83fac7ad91140b22757d3e6e8eb72d86ad6ad42
2019-05-06 14:12:00 +08:00
Yi-Ling Chuang
0789b5d226 Use PermissionControllerManager to get permission groups
The mapping of permissions and permission groups may be changed upon
mainline module update, so we cannot reliably read from the platform.
PermissionControllerManager is created for this purpose, so we use it
to prevent from the outdated mapping instead of mapping them manually.

Bug: 117978938
Test: robotests

Change-Id: If8682796b8a30dee3b73572e977fade48d07eb2b
2019-05-02 10:04:53 +08:00
tmfang
057539f186 Fix App permission doesn't show summary
Since AppPermissionsPreferenceController assigns
a fixed preference key in constructor, so it can't
be used by same controller in Privacy page.

So, we change contructor directly, let controller
read preference key from xml file.

- Also remove unused imports.

Test: visual
Bug: 116628158
Change-Id: I42d6e978e91f0a2fe796d290cb9f34db596aa1f4
2018-11-14 16:25:48 +08:00
jyhshiangwang
4d015b17b3 Use ListFormatter to join strings
Currently in Settings we are using R.string.join_many_items_first, R.string.join_many_items_middle and R.string.join_many_items_last to manually join strings. The join code is messy and the joined string is incorrect in some languages, so we migrate all string join to just use ListFormatter.getInstance().format().

Bug: b/78248791
Test: robotests
Change-Id: I898339978e6e2027587e28994b0280fa46821fd6
2018-05-02 11:15:32 +08:00
Fan Zhang
04f1423bfa Remove custom updateState() if it's just setting summary
Change-Id: I6311d67d6ba11961a6814b91dcd8e37a2e17df40
Fixes: 73950519
Test: rerun robotests
2018-02-28 15:22:09 -08:00
Fan Zhang
906572b127 Change PreferenceController#getSummary return type.
Return CharSequence instead of String.

All user visible string should be modeled as CharSequence.

Bug: 73950519
Test: robotest
Change-Id: I30befef0c33f94351d4a2774e283bd1ed804aa8b
2018-02-27 22:30:12 -08:00
Matthew Fritze
c69f73f4d1 Support getDynamicSummary in BasePreferenceController
Adds dynamic summary getter in relevant BasePreferenceControllers.
Preferece controllers that don't have dynamic summaries or which
are not yet BasePreferenceControllers are not changed right now.

Change-Id: I435ccab7758d90515583fd8ca10a9b1ef0c858b9
Fixes: 71514936
Test: robotests
2018-01-04 13:58:01 -08:00
Doris Ling
a9693524bf Change the permission labels to lowercase.
In the summary for Apps permissions, change the list of permissions
lable to lowercase instead.

Change-Id: I5b3133c33de7110dbec6ab179c6f1308c4ed481e
Fixes: 65049565
Test: make RunSettingsRoboTests
2017-09-13 15:23:06 -07:00
Tony Mantler
1d583e125f Make PreferenceController a mixin
Bug: 62912136
Test: Existing tests in BaseSearchIndexProviderTest
Change-Id: Ieda359806c09a019840b2005446c7ec8b61fdb00
2017-06-26 10:58:36 -07:00
Doris Ling
ffda9c23c4 Add summary text to App permissions settings.
Check the granted permissions for the installed app and compose the
summary text to use the first 3 permissions granted from the list:
Location, Microphone, Camera, Sms, Contacts, and Phone.

Change-Id: I61d21f279af2fe86132de22b94e1a49da0225fcd
Fix: 36376411
Test: make RunSettingsRoboTests
2017-05-01 17:36:20 -07:00