Commit Graph

23 Commits

Author SHA1 Message Date
Jason Chiu
cf13dfd4c6 [Safer intents] Permission controller
To avoid implicit intents, make intents launch explicitly.

Test: build, manual
Bug: 323061508
Change-Id: Ib95b417fc8682f690890fc55f321b4fece2c0369
2024-03-28 17:09:37 +08:00
Hai Zhang
5509b03996 Revert^2 "Expose role API for Settings on RoleManager."
e822aea2e1

Bug: 158736025
Test: atest RcsProvisioningMonitorTest
Change-Id: Ib9e66803d780a93db2bbad34745ce1939954a3f3
2021-01-11 22:54:07 +00:00
Diego Vela
e822aea2e1 Revert "Expose role API for Settings on RoleManager."
Revert submission 13261069-role-settings-api

Reason for revert: Might be breaking RcsProvisioningMonitorTest
Bug: 177227549
Test: RcsProvisioningMonitor
Reverted Changes:
Idbd0db119:Expose role API for Settings on RoleManager.
Iafe1d2460:Expose role API for Settings on RoleManager.
I6a3e5a26c:Expose role API for Settings on RoleManager.

Change-Id: Ic48c562e8249ca43e7c594f55d94ba190540be22
2021-01-11 19:11:25 +00:00
Hai Zhang
a8bd0d263f Expose role API for Settings on RoleManager.
Settings is a platform app so the role APIs for it wasn't system APIs,
but just @hide. Now that we are moving role into module, we need to
create system APIs for them.

RoleControllerManager is an implementation detail and may change in
soon when we move role logic into system server and leave only UI in
PermissionController, so we shouldn't expose it. Instead, we can
expose the new system APIs on RoleManager, and delegate to
RoleControllerManager internally.

Bug: 158736025
Test: presubmit
Test: atest DefaultSmsShortcutPreferenceControllerTest
Change-Id: Iafe1d24601a32799e04d9aa385ec2fbce833a02e
2020-12-22 21:17:33 -08:00
Hai Zhang
51b76855f9 Add RoleControllerManager.isApplicationVisibleForRole().
Settings doesn't actually need to know whether an application
qualifies for a role, but only whether the default app setting should
be visible for an application. Qualification and visibility differs in
cases such as FallbackHome inside Settings which is a qualifying home
activity but should never be shown in default apps UI.

Fixes: 138636320
Test: manual
Change-Id: I2995b6fa5c7920d14fa644748db9c41b442ce53b
2019-08-26 14:23:44 -07:00
Hai Zhang
729f1bb48b Use RoleControllerService for role related APIs.
Move isApplicationQualifiedForRole() and isRoleVisible() from
PermissionControllerService to RoleControllerService.

Bug: 127691087
Test: manual
Change-Id: I87edb1bc457fbbec3d9a87054eaad5024ed91310
2019-03-07 21:33:56 -08:00
Hai Zhang
617e745c4d Use PermissionControllerService.isRoleVisible() in app info shortcut.
Use the new PermissionControllerService.isRoleVisible() to hide roles
that are not visible.

Bug: 124452117
Bug: 124457823
Test: manual
Change-Id: I4c61a2760dc62ecd8a52fba9e133e96a447c4a29
2019-02-28 17:02:43 -08:00
Hai Zhang
3064ca585e Migrate all default app shortcut preference to use roles.
Bug: 124452117
Test: build
Change-Id: I19375dc21bfcd932a263c49330dc9a040a446beb
2019-02-28 13:51:21 -08:00
Hai Zhang
3850908671 Show Default app shortcut preference only when app is qualified.
This change uses the new isApplicationQualifiedForRole() API on
PermissionControllerManager to correctly report availability of
default app shortcut preference.

Bug: 110557011
Bug: 123238935
Test: atest DefaultAppShortcutPreferenceControllerBaseTest DefaultSmsShortcutPreferenceControllerTest
Change-Id: Ib86ab0fd84334a149f7c6c3556297745f2990f47
2019-01-24 17:38:47 -08:00
Fan Zhang
31b210017b Migrate all MetricsProto enums to SettingsEnums
Bug: 122855168
Test: rebuild
Change-Id: I962d9a71179f86b7cae9dc5e9a00e0aa1557dc76
2019-01-17 14:55:42 -08:00
Hai Zhang
ac5a639aeb Use role for App info default SMS shortcut.
This change makes the default SMS shortcut in App info launch the new
default app UI based on roles, since we've migrated default SMS
mechanism.

Bug: 110557011
Test: atest DefaultAppShortcutPreferenceControllerBaseTest && atest DefaultSmsShortcutPreferenceControllerTest
Change-Id: I074e41433fe912309082f1e9c54bf74200297dd1
2019-01-14 14:10:34 -08:00
Fan Zhang
23f8d59d02 Sort imports
Having consistent import order will reduce chance of merge
conflict between internal and external master

Test: rebuild
Change-Id: I0b1a170967ddcce7f388603fd521f6ed1eeba30b
2018-08-28 22:13:15 +00:00
Fan Zhang
c7162cd24d Reorder and clean up imports.
Test: rebuild
Change-Id: I178485c84ae7146f991fd77b6d7504b029942a68
2018-06-18 15:45:09 -07:00
android-build-team Robot
02ec86a17b Merge "Establish permanently unavailable settings" 2018-05-09 18:14:32 +00:00
Matthew Fritze
f87a1f3f41 Establish permanently unavailable settings
Distinguish between settings which are permanently unavailable on
the device, and temporarily unavailable. This enables us to restrict
which setting slices are exposed in onSliceGetDescendants.

The primary changes in this CL are renaming:
"DISABLED_UNSUPPORTED" -> "UNSUPPORTED_ON_DEVICE"
to be more clear the the setting will cannot be accessed on the device, and,
adding a new enum to encapsulate settings which are currently unavailable, but
could be enabled in the future.

Also remove UNAVAILABLE_UNKNOWN. Devs should never need this enum.

Bug: 78910582
Bug: 79245656
Test: robotests
Change-Id: I58821a6cfd6134b3b351657b6edf5f74ead00643
2018-05-09 08:36:59 -07:00
hjchangliao
e86eec0c07 Rename SubSettingLauncher.setTitle, add java doc
For make this method usage more clear,
setTitle(charSequence) rename as setTitleText,
add java doc: it is only for user generated string
setTitle(int) rename as setTitleRes.

Change-Id: I972cb6a8ff90873dfdc25c23f6dc3d68103c8e4e
Fixes: 78347436
Test: make RunSettingsRoboTests
2018-05-09 10:00:05 +08:00
Aurimas Liutikas
e0069d332d Migrate Settings to androidx.
Test: make Settings
Bug: 76692459
Change-Id: I941dea40562170649bf056e675cc32e5163c0e39
2018-04-20 12:52:29 -07: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
Fan Zhang
47854c2945 Migrate more places to subsetting launcher
Bug: 73250851
Test: robotests
Change-Id: Iaf29df45ddb42fd58f181cb01e10998a97cb7c34
2018-02-19 14:21:05 -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
Matthew Fritze
f527684183 Remove Slice getter from BasePreferenceController
After working through a prototype here: (ag/3324435)
it is clear that we don't need the controller to
provider the slice. We will build an index that
will contain sufficent UI information, and a reference
to the controller.

At Slice Bind time, we can get the curret value from the
controller, and the UI information from the Index.

Bug: 67996923
Test: robotests
Change-Id: Id43a51bcd73051bc719cd5829907583e0edf23b2
2017-12-08 10:09:57 -08:00
Doris Ling
86daa8f4c6 Add controllers for default app shortcut preferences.
For AppInfoDashboardFragment:
- add the default app shortcut preferences into the preference screen
instead of creating them dynamically.
- add controller for each of the shortcut preference.

Bug: 69384089
Test: make RunSettingsRoboTests
Change-Id: I1e81944a3bc867fd6a3a0d484bab77c3ad0e6441
2017-12-01 17:21:49 -08:00