Commit Graph

50 Commits

Author SHA1 Message Date
Chaohui Wang
3ce806d870 Fix scrolling position not kept in Trusted Credentials
For example when changing display states.

Save view states to solve this issue.
 - Save current tab. (System / User)
 - Save group expanded state. (Personal / Work)
 - Save scrolling position of each group.

Also updated to ViewPager2 and updated the styles.

Bug: 204839552
Test: manual
Change-Id: Ibeda50b50e7dfd2ba071b75fe2aa88ef560f4c88
2022-04-15 10:12:36 +08:00
kholoud mohamed
de78149c16 RESTRICT AUTOMERGE Refactor device policy resource APIs to a separate class
Bug: 217388602
Bug: 218875965
Test: atest EnterpriseResourcesTests
Test: manual
Change-Id: I4775d7741c7819fd811c3fc4eda1636b1e04b398
2022-03-17 17:37:45 +00:00
Jonathan Scott
e0d439472f Allow Device Management Role Holder to update Settings strings.
Test: manual
Bug: 188414370
Change-Id: I6e1a06619799a9e99382d791e72e2e4518f93cac
2022-01-25 19:03:24 +00: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
Fan Zhang
c7162cd24d Reorder and clean up imports.
Test: rebuild
Change-Id: I178485c84ae7146f991fd77b6d7504b029942a68
2018-06-18 15:45:09 -07:00
Doris Ling
72489725c6 Change superclass to InstrumentedFragment.
- for fragments that do not implement the preference screen, change them
to inherit from InstrumentedFragment instead.

Change-Id: I791c2634024bd2c248efea955be5c680180d735c
Fixes: 68277111
Test: make RunSettingsRoboTests
2018-02-02 13:41:16 -08:00
Doris Ling
4a01283309 Remove the feature flag for using new title.
- remove all code that check for the feature flag, and use the new logic
by default.

Change-Id: I7fbe60da84c1c0f35e7241402a71d2bc4cd300e6
Fixes: 64564191
Test: make RunSettingsRoboTests
2017-11-13 17:58:13 -08:00
Doris Ling
ed4685fafb Update activity titles for fragments without preference screen.
1. Move getPreferenceScreenResId() from individual subclass to
InstrumentedPreferenceFragment.

2. Removed InstrumentedPreferenceFragment.getTitle() and let the
preference fragments that do not have preference screen set the activity
title directly instead.

3. Removed OptionsMenuFragment as all it does is call
setHasOptionMenu().
- changed subclasses of OptionsMenuFragment to extend from
InstrumentedPreferenceFragment directly.
- none of the exisitng subclasses actually implements the option menu
related methods to provide any option menu. So, the setHasOptionMenu()
call is not added to the subclasses.

4. Update Languages preference title.
- launch the fragment from the preference controller instead of from the
default handling, as we need the title res id at launch time to get it
work properly when retrieving the title from back stack.

Bug: 64564191
Test: blaze-bin/screenshots/android/i18nscreenshots/i18nscreenshots
Change-Id: Ibecdcab32cbaed8bf604ec5ebe0a926b4e489a7d
2017-10-26 12:01:06 -07:00
Doris Ling
03a3b518de Update preference screen title.
- Add missing title to preference screen xml so that they will be used to
set the activity title when the fragment is launched.
- Also updated some incorrect preference screen titles.
- Overrides getTitle() in preference fragments that do not use the
preference screen xml.

Bug: 64564191
Test: blaze-bin/screenshots/android/i18nscreenshots/i18nscreenshots
Change-Id: Id72d5ddf18f0962bc484de8bbd847a2e55d6371e
2017-10-25 11:02:07 -07:00
daqi
be47df7395 Fix TrustedCredentialsSettings NPE
[Cause of Defect]
TrustedCredentialsSettings#mKeyChainConnectionByProfileId is get/set by
more than one thread. Main thread would set it in onDestroy method, and
AsyncTask would get and set in the doInBackground method. So
mKeyChainConnectionByProfileId.get(profileId) would get null after
onDestroy method get called.

Bug: N/A
Test: Debugger to simulate concurrency
Change-Id: I0664d1e9b88b079855354ce0e6fe014a98a22327
Signed-off-by: daqi <daqi@xiaomi.com>
2017-09-07 17:21:25 +08:00
Robin Lee
b50e681a21 Remove ParcelableString references
Even better would be to completely get rid of non-framework code using
this, and then even better than that would be to completely get rid of
all code using this.

Test: manual. open Settings > Security > Trusted Credentials before and after this change. Number of certificates should be the same. No crashes should happen in either case.
Change-Id: I4237e630b903eb04e6b572d6464a40d183b24276
2017-02-20 21:02:45 +00:00
Tamas Berghammer
265d3c2a0c Update package names to work with the proto3 compiler
Bug: b/28974522
Change-Id: I5f3adf4946ee4ba1e09e4f40afe83c151405972a
2016-11-08 14:06:17 +00:00
Robin Lee
bed8559a20 Enable the switch in TrustedCredentialsSettings
And match the behaviour of the dialog button that does the same thing,
so it only asks for confirmation when something is being irrevocably
deleted.

The dialog button should not be removed as it's used by system services
that deeplink to a specific cert to give the option of reviewing,
removing, or trusting it.

Bug: 31159682
Change-Id: I4fb3f38f8ab0e80e5c2dca0fc3d6d3bd4db26bb6
2016-09-02 11:03:32 +01:00
Fan Zhang
6507613ebc Log visibility change for all fragments.
Bug: 30681771
Test: SettingsUnitTests

Refactor visibility logging from InstrumentedFragment into a mixin. And
apply mixin in remaining fragments.

Change-Id: Ibbb59904336254a3e4bb9e8c7d0b36e5a6bc2622
2016-08-18 14:04:13 -07:00
Robin Lee
232f057df0 Futureproof trusted credentials for multiple profiles
Made use of the shiny LayoutTransition.CHANGING animations. Now it's a
little more obvious where things are going when tapping a header.

Future work: maybe show the usernames / user icons in there too? This
could get complicated, and it'll need to be done everywhere at once.

Change-Id: Id7396235abe6218d591d16db91af0f56a83a7bcd
Fix: 28310002
2016-08-02 12:12:14 +01:00
Victor Chang
45ca906e27 Trust the certificate after unlocking screenlock
When trust button is clicked, if ConfirmCredential (CC) is shown,
and user successfully unlock CC, trust the cert immediately

Bug: 28752364
Change-Id: Ied4aeda59a668a9dd2bf079a385b1fecd8eabb9e
2016-05-23 20:11:18 +01:00
Victor Chang
00859bd548 Temp fix for NPE when race condition happens in TrustedCredentialsSettings
Bug: 28762124
Change-Id: I21e46c2008e106db1c43573171e0d852cbe0a68a
2016-05-20 17:19:29 +00:00
Victor Chang
01f4dbcc1c Fix ConfirmCredential is not presented before trusting cert installed by PO/DO
- Show ConfirmCredential in TrustedCredentialsSettings when Trust button is clicked
  for the very first time since the activity launched
- Warning activity (work mode off, crpyto-aware) should not be shown when the activity is started. Also fixed it here.

Bug: 28619980
Change-Id: I084b70883c087376e437a9ad3238d7c3313a0a17
2016-05-11 15:05:21 +01:00
Victor Chang
9583dcecce TrustCredentials listview should be expanded by default
UI Change for 2-profile case:
1. When both personal and work listview are expanded, half height is allocated for each list view
2. When only one listview is expanded, full height is allocated to the list view

Video can be found at go/trust-cred-split-view

- Use 2 ListView instead of 1 ExpandableListView in order to scoll the list independently
- The ui is not changed for only one or more than 3 profiles.
- Remove TrustedCertificateAdapterCommons, and wrap GroupAdapter by ChildAdapter in order to re-use more codes
- clear mAliasLoaders in onDestroy. (Seems it's a bug.)
- When work mode or fbe locked, force to collapse work list view. User message will be prompted when user press on header
- Groups in GroupAdapter is set synchronously instead of async, since we assume the number of users are fixed during initialization
- DataSet events will go through GroupAdapter to notifiy ChildAdapter

Bug:28236955
(cherry picked from commit 7dde845544)

Change-Id: I87293afc56e9cc270c2289111bab6f1809351faf
2016-05-06 12:55:18 +00:00
Victor Chang
caa8877f75 Show trust option for multiple unapproved cert in chain
- Add a argument to pass user id
- Check approval status of certs in WorkerThread

Bug: 18224038
Change-Id: I5fd6a41e9593d0f339fecb4185331175e32c50c2
2016-04-12 21:00:14 +01:00
Victor Chang
d7d0e1b6b0 CertDialog supports multiple certs
- Allow user to trust multiple certs in chain in one AlertDialog
- The animation is similar to GrantPermissionsViewHandlerImpl.
  - Fadeout current, Slide-in next cert from the right.
  - Not animate scale as the CustomeView in AlertDialog matchParent
- Refactor CertDialogBuilder into a separate class
- The change for config multiple cert into the dialog is another CL

note: For single cert case when user taps on a system/user cert,
no change is visible to user after this change

Bug: 18224038
Change-Id: I09ee8f683031c800830af4001582882d61cd4974
2016-04-12 16:09:30 +01:00
Victor Chang
b49c901f8e Merge "Add button to trust a CA cert" into nyc-dev 2016-04-06 10:59:20 +00:00
Victor Chang
a390d63682 Add button to trust a CA cert
- Put Disable button for system cert and Remove button for user cert as action button in cert dialog
- OK (dismiss) button is displayed when trust button is not shown
- Showing chain of cert dialot will be in a later CL

Bug: 18224038
Change-Id: Ieef70e12fd8bdf711be48dc0488f03dbe143d3c5
2016-04-05 22:22:41 +01:00
Rubin Xu
819f78e91b Listen on new broadcasts for profile changes.
The change is due to API review comments on the platform side.

Bug: 27532254
Change-Id: Iacb87f97148ceead6bf1f1cc7a0671711698b061
2016-04-04 17:24:30 +01:00
Udam Saini
0708d9e119 Fixes back button on action bar on some fragments.
SettingsPreferenceFragment has this already set so that the drawer
layout will work when the menu doesn't exist. However, some fragments
are not preference fragments, and we need to set setHasOptionsMenu
manually.

bug:27879503
Change-Id: I6faadeb56dab00af611ac413109800822038c66d
2016-03-29 10:29:14 -07:00
Ricky Wai
78fb3d3e42 Do not connect to KeyChainService when user is not started
Bug: 27418671
Change-Id: Id1bca405e8b0ebea79726f623aaa0c59bce0331c
2016-03-18 14:15:11 +00:00
Chris Wren
9d1bfd1e8d port settings over to new metrics enum
Change-Id: I0b3efd2f4db773ccbc52bfe59ee8eb0dab9584fb
2016-01-27 10:58:58 -05:00
Jason Monk
39b467482d Depend on support lib preferences
Bug: 24576551
Change-Id: Ic6190bacd3f7582c9bbc8de972da4612bd92421e
2015-10-13 10:12:20 -04:00
Chris Wren
8a963babe2 log visibility of views
Depends-On: I5b1dccb5d103ece3112acf38889bae16273b092f
Change-Id: I116aed2bb805f723a5bf2ec9eb94257de0b4a7b5
2015-03-27 13:39:07 -04:00
John Spurlock
9a23adf69d Settings: Remove all unused imports.
Change-Id: Iebfa52cb849d69974c94902b0b020893cf5618a3
2015-03-18 15:51:15 -04:00
Zoltan Szatmary-Ban
3af2e4c35c Eliminate duplicated code in Settings for category headers
Change-Id: I5bdba2ad4f9e1987f9e818af9d5aa96a9d558f6b
2015-01-16 15:48:13 +00:00
Zoltan Szatmary-Ban
fb1bdf0ffc Check DISALLOW_CONFIG_CREDENTIALS on Settings > Trusted Credentials
Remove the enable/disable button in certificate setting dialog if restriction
has been put on the respective profile. Also catch security exception just in
case.

Bug: 18899182
Change-Id: Ia247ab264c1b2d08b58456519bf471ba8c727745
2015-01-05 16:49:53 +00:00
Zoltan Szatmary-Ban
cfe521e6e3 Stop background processes if TrustedCredentialSettings fragment gets detached
Otherwise getActivity() returns null and other nasty null pointer dereferencings happen.

Bug: 17976307
Change-Id: If867785f991217267e0bf0ad3058a62177509852
2014-11-18 18:02:48 +00:00
Fabrice Di Meglio
44db45ac11 Fix bug #15730311 Checkboxes on R side should update to Quantum/Material on/off switch
Per UX request, convert Trusted Credentials CheckBoxes to Switches

Change-Id: If878e8c10454a212ba9052280e3cbb17c0fdeeca
2014-10-17 14:06:22 -07:00
Zoltan Szatmary-Ban
50263efbaf Remove CA Cert UI item from one list only
When removing a CA Cert in TrustedCredentialsSettings the UI item
is now removed from the list of the respective profile only.

Bug: 17926190
Change-Id: I7f7ae3498717cc457cb9e360e59bb365225b0cb6
2014-10-09 13:00:32 +01:00
Zoltan Szatmary-Ban
af0f89ff91 Disambiguate categories in Settings > Trusted Credentials
Use fixed category names (e.g. 'Personal' and 'Work') on Trusted Credentials
screen instead of names of profiles that may be the same (or similar) for both.

Bug: 17629895
Change-Id: I25b39310f7b9f445d2724be046a16cc82f5d1a9a
2014-09-30 16:30:07 +01:00
Zoltan Szatmary-Ban
860e1e1f44 Fixing Trusted Credentials Settings crash
List adapter's getCount method did not check for the case of uninitialised
data. This CL fixes that.

Bug:17437943
Change-Id: I72d7f2c92aa380b1aaafe0658bd920017ff23906
2014-09-10 12:22:36 +01:00
Zoltan Szatmary-Ban
1613cb0da4 Update Trusted Credentials screen in settings
Trusted credentials for both the primary user and its managed profiles are shown
on the Trusted Credentials fragment. All functionalities (e.g. disabling/enabling
of certificates) remain available.

Bug: 16029580
Change-Id: Id6335d12ec5fbeed0e254f3ded1e715def3e8e04
2014-08-18 12:29:55 +01:00
Julia Reynolds
233ccd0cf7 Credentials should be shown but can't be modified.
Change-Id: I1a22a0ffb244d6cec3c64b2224fa5e9639bf4673
2014-06-23 13:59:04 -04:00
Julia Reynolds
565653cef1 Remove pin and add restrictions for Security settings.
Bug: 14081992
Change-Id: Iec5667202b6f5ae5b5a2a0cfded1a832d98adaf9
2014-06-13 13:15:39 -04:00
Selim Gurun
f64facc2f9 Display certificate chain
Bug: 5012010
Change-Id: Id1b4753b28ab3460662ea41feea277777e655780
2013-12-27 18:17:24 -08:00
Amith Yamasani
14912666d9 Handle renamed APIs
Bug: 10461761
Change-Id: If63c3801663b347a4643e44d5bd3bab4e3049578
2013-09-05 12:40:31 -07:00
Geoffrey Borggaard
fc6bc20161 Allow navigation to TrustedCredentials User Certs by intent.
Adds an activity, and an entry in the AndroidManifest.xml

Change-Id: Ic3cfa1f3bdc3f2eefc290195679011c224496d63
2013-08-09 16:21:08 -04:00
Geoffrey Borggaard
6e1102d9fa Restriction pin changes.
Fixed bug in WirelessSettings where it was asking users for a PIN when
they weren't restricted.  Did this by refactoring the preference level
pin checking into the superclass, where it checks for the restricted mode first.
Also pin protected changes to certificates for restricted users.

Change-Id: I8310fd39f0862159668318fc1360ec6859cc00d5
2013-08-07 14:57:43 -04:00
Kenny Root
d76bc2248e Track change to JSSE provider
Change-Id: I25d6612b12ab46b1f5c88c400b95bba1c023398a
2013-04-29 10:43:00 -07:00
Brian Carlstrom
945e383833 Set progress bar to 0 when done so that will not come back as full
Change-Id: I766e852d029168433a0d47c93dc3110a053f712c
2011-07-06 15:13:48 -07:00
Brian Carlstrom
729c6d99e2 Convert CA loading from spinning wheel to progress bar
Change-Id: I3d9d596cbdf3ac4751b7b2e297faa0f667d2de02
2011-07-06 13:15:03 -07:00
Brian Carlstrom
10cc989346 Improved presentation of CA list
Change-Id: Ibc6dd9d553c3f7f53453fb43e9842afe789d8b50
2011-07-06 10:43:07 -07:00
Brian Carlstrom
91615cfa9e Fix TrustedCredentialsSettings for small screens
Change-Id: I01149a88b044d0f95db01039aabba62666e8f397
2011-06-30 17:57:42 -07:00
Brian Carlstrom
ac45fb42b0 Follow naming conventions of proguard.flags
Change-Id: Idbd136fb25447aa1f6629d8caa17b87924ed3936
2011-06-28 19:57:14 -07:00