Commit Graph

323 Commits

Author SHA1 Message Date
Matthew Fritze
9c3c7d8ccd Fix crash from Settings Search
Security Settings was returning a search indexable
resource without an xml resource (in this case id = 0).

Settings search did not handle this exception and crashed.
This patch catches the exception, and adds a TODO to fix
the indexing in security settings.

Change-Id: Ic7f05c98d99cc45fbebbdc672c7e346c27daa0f0
Fixes: 67967367
Test: robotests
2017-10-19 10:58:05 -07:00
Fan Zhang
aee173142f Fix a bug: applied wrong layout for advanecd button flag
Change-Id: I5a44bb5e910bc73e46087820e5ccf76e220fa834
Fixes: 3076430
Test: robotests
2017-10-17 14:49:04 -07:00
Fan Zhang
069830012f Add advanced button to security & location page
Change-Id: I45977105d6ddabef8f2d9bdc7b46959af9cbbf0f
Fixes: 36657221
Test: visual
2017-10-16 17:39:27 -07:00
Ng Zhi An
f0c0320c82 Reflect device encryption status
On the Settings & Location settings page, the
encryption_and_credential preference will statically show
"Phone encrypted" regardless of encryption status of phone.

This change changes Settings to check for encryption status
of the phone and update the summary as required.
This requires adding a string saying that the device is not encrypted.
And translations will have to happen after this is merged.

Change-Id: I2f5bd281d8f1ed32801446fcdd453ebbaa04bd32
Bug: 65535239
Fixes: 65535239
Test: manual, I had a gobo phone that was not encrypted,
made sure that it said "Phone not encrypted", then tap through
to encrypt phone, and then check that it is now "Phone encrypted".
2017-09-22 09:48:43 -07:00
Matthew Fritze
2e34a64a55 Remove duplicates in Security Settings
Duplicates:
- Location
- Scanning
- Encryption and Credentials
- Screen Pinning
- Device Admin Apps

Merge for ag/2247508

Bug: 33701673
Test: make RunSettingsRoboTests
Change-Id: I91566b8fb7fdb3b39c8833a6fa8e52bbbf6507b6
2017-05-23 10:43:14 -07:00
Maurice Lam
2eb170cd6f Clean up choose lock intent creation
Consolidated the many variants of ChooseLock*.createIntent, so that
it will take the same set of arguments.

Also modified SetupChooseLock*.createIntent to modifyIntentForSetup,
which will take the intent created by ChooseLock* and modify it for
use with setup.

Test: cd tests/robotests && mma
Change-Id: I5ff033f459c33ec9980872a536b3996d89f2bbbb
2017-05-12 15:35:20 -07:00
Alex Salo
2e52b42e3b Location setting now updates summary timely.
Subscribed the LocationPreferenceController to listen to the location
providers changed action. This allows timely summary update. Previous
approach, directly calling the updateSummary method onResume failed in
the scenario when user changed the location settings via the
QuickSettings.

Test: Added robolectric tests, and manually verified the intended
behavior on a device.
Bug: 37956060
Change-Id: I2f81713d59da3384f3c98b327d377d529d440a88
2017-05-09 16:43:53 -07:00
Charles He
fc6c016969 Turn off QUIET_MODE before changing unified lock credential.
For FBE-enabled devices, the work profile disk encryption key is evicted
when the the profile is turned off (i.e. QUIET_MODE is on). If the user
attempts to change the profile's lock screen credentials in this state,
the profile will get into an unrecoverable state as vold does not have
the current encryption key.

Currently, separate work challenge does not suffer from this issue as
QUIET_MODE must be turned off before the change credentials flow could
be initiated in Settings. In this CL, we fix the issue for unified work
challenge as well by adopting the same approach.

This is temporary and should be removed when vold no longer relies on
the current key for resetting the password.

Bug: 35930129
Test: manually resetting unified PIN when work mode is off
      on both sailfish (FBE) and angler (no FBE)
Test: make SettingsRoboTests

Change-Id: Ibb4b1c40a9cad8a473e08cf0c294699406108cd9
2017-04-25 12:10:50 +01:00
Doris Ling
48ffe67611 Update subtext for Security settings.
Instead of using summary for verifer, change the security setting
summary to a static text.

Bug: 36889582
Test: make RunSettingsRoboTests
Change-Id: Ia3e2c7c595f403965751bacf2239c70070408e49
2017-04-15 10:41:57 -07:00
Doris Ling
cee83e4bbf Add summary text to Lock screen preferences.
Each time we refresh the security preference page, get the current
summary text from "On the lock screen" and populate to Lock screen
preferences summary.

Bug: 36540633
Test: make RunSettingsRoboTests
Change-Id: I317e3892b35b30981b62f7b7aee9cfdacd04a3ed
2017-04-07 11:11:45 -07:00
Doris Ling
2db8c867d1 Update summary text for Trust agent.
Update the summary text to show the number of active trust agent.

Bug: 36540633
Test: make RunSettingsRoboTests
Change-Id: I6627564a8356022c89694c84cfd47e875a0916b1
2017-04-06 17:29:12 -07:00
Matthew Fritze
8a42b074a7 Reserve full indexing for SearchFragment
Full Index should only be accessible from Search Fragment,
and when only full index should declare a locale to be
indexed.

Test: make RunSettingsRoboTests
Fixes: 36656637
Change-Id: Ie673067118ac6b184570e116ea24a169be027053
2017-03-29 23:55:48 +00:00
Doris Ling
93582995da Add page Settings->Security & lock screen->Lock screen preferences.
- add the new preference screen that contains configuration for lock
screen notification, add user when locked, and owner info.
- refactor SecuritySettings to use the new owner info controller.

Fix: 36163515
Test: make RunSettingsRoboTests

Change-Id: I3bada8f652f89ed0af7aebc03f0bf2f637296b4d
2017-03-23 11:35:20 -07:00
Bartosz Fabianowski
479f32e0ed Remove "Device administration" heading
This heading was meant to go away in the new IA.

Bug: 32692748
Test: m RunSettingsRoboTests

Change-Id: I842673b01f62c2eb5eb51837d2c3d92829ac0ca0
2017-03-21 15:00:42 +01:00
Matthew Fritze
5c83cfa278 Remove Index.java from old Search and its dependents
Test: make RunSettingsRoboTests
Bug: 35763944, 36192909
Change-Id:  If216e1eeb4c29e7372720c6228fa4e99ea2a9904
2017-03-17 14:26:05 -07:00
Bartosz Fabianowski
ba66a0ef09 Update strings and layout for enterprise privacy
This CL continues the finalization of UI layout and strings for the
enterprise privacy page:
* Turn footer into a header
* Update strings
* Dynamically generate summaries for entry points in security page

Bug: 32692748
Test: m RunSettingsRoboTests

Change-Id: Ibf248ac269380fb1b919b01f88f721130060b7f9
2017-03-13 23:59:35 +01:00
TreeHugger Robot
690d0cfdd0 Merge "SecuritySubSettings: Show trust agent label on lock timeout setting" 2017-03-08 19:54:11 +00:00
Doris Ling
f2cf2aea37 Remove code that check for dashboard feature.
- remove DashboardFeatureProvider.isEnabled() and all relating code
and tests.

Bug: 35764802
Test: make RunSettingsRoboTests
Change-Id: If7796677abc8904b7436525836d50cdef38e37a4
2017-03-07 11:15:03 -08:00
Adrian Roos
73c52f291d SecuritySubSettings: Show trust agent label on lock timeout setting
Fixes: 35475555
Test: Observe description of 'Automatically lock' and 'Power button instantly locks' options, should mention trust agent when one is enabled.
Change-Id: I7967e44d5155c6620dc44cc4d284a8470166d687
2017-02-28 16:16:42 -08:00
William Luh
c8c6c4b1c7 Merge "Query the security feature provider on separate threads." 2017-02-28 17:20:32 +00:00
William Luh
4f80f221c6 Query the security feature provider on separate threads.
Bug: 35065510
Test: make RunSettingsRoboTests
Change-Id: Ib9ffc5bf9c3ace5d2a904206f834f69eccfb690d
2017-02-24 09:49:37 -08:00
TreeHugger Robot
4e1477b60e Merge "Update Security & screen lock preference" 2017-02-22 03:08:12 +00:00
Doris Ling
81610543a9 Update Security & screen lock preference
- change password category title to Privacy and move Location into it.
- remove Advanced security preference category
- remove SIM card preference category and move the SIM card lock
  preferece down.
- move Encryption and Credential settings to a separate screen.

Bug: 34976707
Test: make RunSettingsRoboTests
Change-Id: Iebaba4a8aad135fa88f163de0b60b488fd9510d0
2017-02-21 14:55:25 -08:00
Fan Zhang
c6ca314c0b Log source with visibility change
- Add a method in VisibilityLoggerMixin to log visible event using
  LogMaker, which allows logging additional FIELD_CONTEXT field.
- In Utils.startFragment, add current page's metricsCategory as an extra
  to next page.
- In next page's onResume(), extract the previous page's metricsCategory
  and send it to VisibilityLoggerMixin.visible()
- Update all caller with additional paramters

Change-Id: I8e1f2597fa465b7d3aa16fa1d21c052a3219694a
Fix: 35359289
Test: RunSettingsRoboTests
2017-02-15 17:17:19 -08:00
Fan Zhang
2cab298f13 Update security screen summary text when no fingerprint
Change-Id: I810c533b0daeab3bd67d9d5be8a89d93738b4962
Fix: 35339887
Test: RunSettingsRoboTest
2017-02-14 15:05:40 -08:00
Fan Zhang
7520e81ab5 Update top level menu items summary text.
- Use static summary for most items
- Move summary for user setting to user&account setting

Bug: 34975053
Test: RunSettingsRoboTests
Change-Id: I9bf87267778dc5933f97f5d3b9ae0f4f0b8da1a8
2017-02-09 15:22:47 -08:00
Fan Zhang
62e66c9ca4 Move GearPreference to widget package.
- This is step1 of making gear preference more flexible to use.

Bug: 33579296
Test: builds
Change-Id: I30ac6c75f7ad16ec5c732fbb93170e5fab0eacb7
2017-02-08 16:09:12 -08:00
Suprabh Shukla
f61f11b870 Removing unknown sources from security settings
The secure setting is deprecated starting from O. Removing it from the
settings UI so the user cannot change it. The unknown sources can be
managed at a more granular level by starting activity for intent
MANAGE_EXTERNAL_SOURCES

Test: Manually tested that the preference is removed and does not
disturb the other settings on the page.

Bug: 33947615

Change-Id: I8dc559d0e6aaaf5bad78fb6e04469d9ab647411d
2017-02-06 15:27:46 -08:00
Shahriyar Amini
c60464e46d Create security status preference category.
Bug: 31002801
Test: make RunSettingsRoboTests
Change-Id: I513253e79f91e41686bad9abac8548bb366fc98d
2017-01-25 14:23:55 -08:00
Zachary Iqbal
ccae73f228 Refactored TrustAgentUtils to allow agent check injection.
Notes:
- TrustAgentUtils defined a method that allowed callers to determine if a Trust Agent package is allowed to provide trust. If it is, it adds it to the list of available trust agents that can be displayed in the Settings->Security screen.
- The logic used to define what agents are permitted on the device can now be injected.

Test: Ran 'm RunSettingsRoboTest' and added a new test for the TrustAgentFeatureProviderImpl.
Bug: 34354635
Change-Id: I24c54c14bde26073ce6fa907379b86aae2841600
2017-01-19 12:39:38 -08:00
Shahriyar Amini
5c1ad614a6 Implement summary provider for Security.
Bug: 31002801
Test: make RunSettingsRoboTests

The Security summary is implemented to show the same summary as the
package verifier injected tile if one exists.

Change-Id: I0a2f163a801a7b07fd5363b302c451aca8d389b0
2017-01-17 11:46:02 -08:00
Shahriyar Amini
4774b58b4c Dynamically update injected security preferences.
Bug: 31002801
Test: make RunSettingsRoboTests

onResume will dynamically update injected security preferences with data
from the associated tiles.

Change-Id: Ibf46abdfcff27bd1b00729fe815c3cf3ace64e26
2016-12-29 12:04:47 -08:00
Fan Zhang
16f5af6e84 Move ad-hoc dynamic tile injection into FeatureProvider.
Ideally a page should use DashboardFragment and it doesn't need to
handle adding dynamic tiles manually. This method is only designed for
page that are not fully migrated to DashboardFragment yet.

Bug: 32623105
Test: RunSettingsRoboTests
Change-Id: I0cafcddf9a43b164daea500bade869fada5b3f4e
2016-11-16 16:26:38 -08:00
Fan Zhang
9dc9c6174c Insert dynamic dashboard tiles into optional placeholders
Insteads of inserting tile onto screen using absolute priority values,
now each page can have a placeholder preference, and at run time we will
add dynamic dashboard tiles to placeholder's place.

Bug: 32827787
Test: RunSettingsRoboTests
Change-Id: I1fe9e11dce4eb6fb4a9b56af05a2b8e5cdae00d2
2016-11-14 17:09:18 -08: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
Fan Zhang
301fe80fa7 Add location to security settings.
Bug: 32437756
Test: RunSettingsRoboTests
Change-Id: I999669963801684eb2399f5e642159970727b3c4
2016-10-26 11:23:20 -07:00
Jeff Sharkey
ab50807d1e Offer a null FignerprintManager.
Settings likes null.

Test: builds
Bug: 32060380
Change-Id: I5ba19bccfd48916d4e581518928a6aee19e84a77
2016-10-11 14:30:19 -06:00
Fan Zhang
1e516287bd Add visibility metrics to dialogs.
Bug: 30681529
Test: adb logcat -b events | egrep "(sysui_|notification_)"
Change-Id: I199d2e1b2cb8588a562b46bb8128d8ece24952f0
2016-09-19 17:34:12 -07: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
Julia Reynolds
de4f471e55 Update lock timeout value after pref change.
Change-Id: I0d16256cb61e2db481d99349cd49c17e51de7c87
Fixes: 28734916
2016-05-12 13:48:34 -04:00
Clara Bayarri
35bf932eb0 Merge "Remove Secure Startup option from Security Settings" into nyc-dev 2016-04-29 17:28:42 +00:00
Adrian Roos
3686ef5e03 Fix crash when recreating SecuritySubSettings
Restoring instance state requires the items to be
there after onCreate.

Change-Id: Icef92bcbb168a0b4029a86b2b74235e344e2055e
Fixes: 27013071
2016-04-27 13:58:23 -07:00
Clara Bayarri
b4d55a2050 Remove Secure Startup option from Security Settings
Bug: 27440560
Change-Id: Iff700e4e759aea88f8e71f1fdff1837962f84a92
2016-04-20 15:02:44 +01:00
Bernard Chau
88d523bc5c Fixed typos "QuiteMode"
Bug: 28186496
Change-Id: I460509f7fda205711532c290f764d842f07aba49
2016-04-14 15:12:14 +01:00
Ricky Wai
616342bb94 Show "work mode off" dialog when work security option is clicked
Bug: 28158297
Change-Id: I31bc3197d2ff9c95419ea87d009fe7d677181d69
2016-04-13 10:03:31 +00:00
Ricky Wai
f6fc22092a Unified work lock checkbox should roll back when user cancels confirm dialog
Bug: 28137228
Change-Id: I81cbd41462418ac25142c561c80394db1e6f7d74
2016-04-12 18:35:41 +01:00
Ricky Wai
a0a073864a Do not update unified setting before updating primary profile lock
Bug: 28135945
Change-Id: Ib6332f42d3b6416d8fd08d5f829bf9852fa0e9f0
2016-04-12 17:34:59 +01:00
Toni Barzic
e7d6e4ddb2 Teach settings about PASSWORD_QUALITY_MANAGED constant
Add hooks for adding an option for selecting a managed password as
lock credential. By default this option will not be visible.

BUG=27923581

Change-Id: Id17bd8074bf23cbcffb96d8576cc760df6f2298a
2016-04-07 10:44:35 -07:00
Ricky Wai
36cce830b9 Fix work profile screen timeout policy
Settings screen should apply both primary and managed maximum
timeout policy, even separate profile challenge is enabled.

Bug: 27493348
Change-Id: I09e815d6c6ae6ecd554316cfac82daf0ad0b0cdf
2016-04-07 17:18:04 +01:00
Ricky Wai
4bbf0653c0 Keymaster init for work profile
Changes:
(1) When unified work challenge is enabled and screen lock is secure
  - Store work profile secure key in primary profile
  - When primary user keystore unlocked, unlock work profile keystore
  - When primary user change lock to none, remove work secure key
(2) When unified work challenge is enabled but screen lock is not secure
  - When screen lock changes to secure, store work secure key in primary
(3) When user changes work challenge from unified to separated
  - Remove work secure key in primary
(4) When user changes work challenge from separate to unified
  - Do (1) and (2)

Bug: 27460698

Change-Id: Id7464c178e6ea7b561643477e7cd84f963048c87
2016-04-07 14:23:55 +00:00