740 Commits

Author SHA1 Message Date
Benjamin Franz
36eb7a1370 Block user from setting safe boot setting via adb
am: 0ff13fce6f

Change-Id: I50db586478eb52d0a2f43e9150cc663c96e5779b
2016-07-22 08:47:32 +00:00
Daniel Sandler
c3bdde9790 Merge "Decrease default longpress timeout to 400ms." into nyc-mr1-dev 2016-07-22 04:41:30 +00:00
Dan Sandler
71f85e9194 Decrease default longpress timeout to 400ms.
If the device being upgraded happens to have a timeout of
500ms it will be reset to 400. If the value is something
else it will be left alone upon upgrade.

Bug: 30159825
Change-Id: Ifec70e458ce0199b61d36f7504aea02b4a974990
2016-07-21 19:23:12 -04:00
Bill Yi
8eff1c381b Import translations. DO NOT MERGE
Change-Id: I7261aecb1f28f1b46c1555c52a0010bcc6c52408
Auto-generated-cl: translation import
2016-07-20 19:44:42 -07:00
Benjamin Franz
0ff13fce6f Block user from setting safe boot setting via adb
Bug: 29900345
Change-Id: Id3b4472b59ded2c7c29762ddf008ee8486009dbb
2016-07-15 10:43:15 +01:00
Justin Klaassen
22eb19939d Refactor display color transforms
- Removed Secure.ACCESSIBILITY_DISPLAY_COLOR_MATRIX, it's not desirable
  to persist the actual color transformation matrix.
- Refactored all SurfaceFlinger transforms to DisplayTransformManager,
  which allows color transforms to be set independently from the a11y
  manager service.

Bug: 30042357
Change-Id: Iefa477dedb66aac90e1218e327802a3fab6899ed
2016-07-14 11:28:07 -07:00
Victor Chang
e293b0cd00 Disallow shell to mutate always-on vpn when DISALLOW_CONFIG_VPN user restriction is set
Fix: 29899712

Change-Id: I38cc9d0e584c3f2674c9ff1d91f77a11479d8943
(cherry picked from commit 9c7b706cf4332b4aeea39c166abca04b56685280)
2016-07-14 10:47:35 +00:00
Julia Reynolds
5bd9ea82d2 Merge "Whitelist default apps for DND access." into nyc-mr1-dev 2016-07-13 18:40:21 +00:00
Victor Chang
e05b35db0d Merge "Disallow shell to mutate always-on vpn when DISALLOW_CONFIG_VPN user restriction is set" into nyc-mr1-dev 2016-07-13 18:36:37 +00:00
Julia Reynolds
1f721e113b Whitelist default apps for DND access.
Bug: 29606962
Change-Id: I0a94004cf08a51ab17813f99aabddbceb95ac8f0
2016-07-13 12:45:05 -04:00
Victor Chang
9c7b706cf4 Disallow shell to mutate always-on vpn when DISALLOW_CONFIG_VPN user restriction is set
Fix: 29899712

Change-Id: I38cc9d0e584c3f2674c9ff1d91f77a11479d8943
2016-07-13 16:01:35 +01:00
Mahaver Chopra
3d9805d502 Added UM.DISALLOW_OEM_UNLOCK, Removed Global.OEM_UNLOCK_DISALLOWED.
Currently we used global setting to restrict user from enabling oem
unlock. As global settings can be chagned using adb, using user
restrictions instead.

Bug: 29893399
Change-Id: Ic83112a4838b8279bf50408a29ae205e0b8639ee
2016-07-12 19:29:14 +01:00
Svetoslav Ganov
8011f5ed1c Merge \"Fix a race in local settings caches\" into nyc-dev
am: f4ddb7ce30

Change-Id: If28342d6deab7d0b7e89029229bad060ce7c8a8d
2016-06-18 02:22:52 +00:00
Svetoslav Ganov
8c35dcc7ae Fix a race in local settings caches
We send a handle to the generation tracker along with the first accessed
setting but don't send the generation id of when the setting was
actually looked up. So by the time the client gets the setting with the
generation tracker from which to get and cache the last generation the
setting may have changed. We need to pass the generation id along with
the value and the generation tracker.

bug:29458487

Change-Id: I0ac4955ba5b10b547f8fe653a7c28e048a4691eb
2016-06-17 15:30:45 -07:00
Bill Yi
4535c0f80c Import translations. DO NOT MERGE
Change-Id: Id381d85225a2de4b0e0c1f2d3fba40143ed738a2
Auto-generated-cl: translation import
2016-06-03 09:43:50 -07:00
Bill Yi
686d0d7cf6 Import translations. DO NOT MERGE
Change-Id: Ie630e761cacbec55840a3de9439aa36835a34b38
Auto-generated-cl: translation import
2016-06-03 09:33:00 -07:00
Baligh Uddin
cd669b648a Import translations. DO NOT MERGE
Auto-generated-cl: translation import

Bug: 28857042
Change-Id: I3e66f964402487321dd1923656d488b514bc68ba
2016-05-21 12:46:09 -07:00
Paul Stewart
7ca542fa99 Merge "Don\'t remove existing EAP configurations" into nyc-dev
am: c7ad1ac712

* commit 'c7ad1ac712f09c5bc116c66a54a860000b53fa38':
  Don't remove existing EAP configurations

Change-Id: I743d4b0291b7d0c864d30cb04acd7811428419d0
2016-05-20 17:45:20 +00:00
Paul Stewart
45e6fec2cf Don't remove existing EAP configurations
When merging backed-up configurations with the current supplicant
configuration, we read both configurations into a instance of
WifiNetworkSettings.  No EAP configurations should be restored as
per b/25725016, however existing EAP configurations that already
reside in wpa_supplicant.conf (presumably configured in SUW)
should not be removed in the process.

This CL adds a parameter to the "readNetworks" method to allow it
to select whether or not EAP configurations should be read in.  It
is used to allow the "restoreWifiSupplicant" method to copy in EAP
configurations from the existing wpa_supplicant.conf, but not out
of the backup data.

BUG: 28873992
Change-Id: I8b3e0c1a6629b3f1ca5055b1b2190e6b3ca4c033
2016-05-20 08:22:53 -07:00
Svetoslav Ganov
23d729deb8 Merge "Use the correct handler when persisting the settings state." into nyc-dev
am: 967fcfa593

* commit '967fcfa5939403017a6edc6d365b2996b915685d':
  Use the correct handler when persisting the settings state.

Change-Id: I53fea39e5097512f080f62f3510cc6c7acf87e3c
2016-05-16 19:49:55 +00:00
Svetoslav Ganov
9205749cfe Use the correct handler when persisting the settings state.
bug:28784358

Change-Id: Iba9d569bae67c7ba0c3ab0a486ae14efa84a7acf
2016-05-16 12:36:48 -07:00
Svetoslav Ganov
1ba77621c6 Merge "Make settings cahches generation mechanism robust." into nyc-dev
am: b35301e421

* commit 'b35301e421bb08c28425c49ad46a277c96ccb411':
  Make settings cahches generation mechanism robust.

Change-Id: Ided07e935f83e96edfec9217bfad9ae2da1fc6fb
2016-05-13 22:26:27 +00:00
Svetoslav Ganov
b35301e421 Merge "Make settings cahches generation mechanism robust." into nyc-dev 2016-05-13 22:22:32 +00:00
Svetoslav Ganov
04df738bcb Make settings cahches generation mechanism robust.
Settings is using a MemoryIntArray to communicate the settings table
version enabling apps to have up-to-date local caches. However, ashmem
allows an arbitrary process with a handle to the fd (even in read only
mode) to unpin the memory which can then be garbage collected. Here we
make this mechanism fault tolerant against bad apps unpinning the ashmem
region. First, we no longer unpin the ashmem on the client side and if
the ashmem region is purged and cannot be pinned we recreate it and
hook up again with the local app caches. The change also adds a test
that clients can only read while owner can read/write.

bug:28764789

Change-Id: I1ef79b4b21e976124b268c9126a55d614157059b
2016-05-13 15:14:14 -07:00
Steven Ng
e333b2eb81 Merge "Add a Global setting for disabling OEM unlocking setting" into nyc-mr1-dev 2016-05-13 11:27:59 +00:00
Svet Ganov
f4e2832742 Merge "Persist settings on a dedicated background thread" into nyc-dev
am: 00749aeb15

* commit '00749aeb15d52151fcc9f9051b525840c49e14ce':
  Persist settings on a dedicated background thread

Change-Id: I62d1cf9a8955ea949c420c1eb62645bff325da2a
2016-05-12 19:57:42 +00:00
Svetoslav Ganov
00749aeb15 Merge "Persist settings on a dedicated background thread" into nyc-dev 2016-05-12 19:51:58 +00:00
Phil Weaver
d56cd1fcab Merge "Fix a race in settings update." into nyc-dev
am: df15e03ed0

* commit 'df15e03ed062493b506f7599ff1e6aff26828485':
  Fix a race in settings update.

Change-Id: I970606b21b1a5cd2d19e0f21077636e68f107c6b
2016-05-12 16:53:49 +00:00
Phil Weaver
83fec00697 Fix a race in settings update.
Need to invalidate caching before notifying of changes.

Bug: 28621277
Change-Id: I2820b15d2364ecaad7666a820c0c7280ac6b7b4c
2016-05-11 10:55:29 -07:00
Svet Ganov
a8f9026d22 Persist settings on a dedicated background thread
Settings were persisted on the system background thread but during
first boot the device is under heavy load and persisting settings
competes with other system components using the shared background
thread. As a result persisting settings can be delayed much longer
than the expected 200ms. This can cause issues with setup wizard
being skipped/went over and its component disaabled being persisted
but the setting whether the device is provisioned not being
persisted - now if the device boots it will have no SUW but also
the home button would be missing. Generally, we need a tansactional
abstraction in the system process to peform all delayed operations
atomically.

bug:25472484

Change-Id: I8e0cf7ffa32e86e36e777964eb0c3cc7de02d3c3
2016-05-10 08:48:00 -07:00
Guang Zhu
e3dec83852 Merge "Revert "Persist settings on a dedicated background thread"" into nyc-dev
am: 875e99443f

* commit '875e99443f6c56d71090b8bedddd71f2b9601787':
  Revert "Persist settings on a dedicated background thread"

Change-Id: Ice3e7f7ebe50f85eb0a9f3e04662df5f68963c07
2016-05-10 07:18:29 +00:00
Guang Zhu
5537ce1f94 Revert "Persist settings on a dedicated background thread"
Bug: 25472484

This reverts commit 82b8c92b97d3c7006d7a9f67a9cdb83263d6bf2c.

Change-Id: I1a8c2e186ad74d78f1c82fe508c6f71c438177dc
2016-05-10 07:02:42 +00:00
Svet Ganov
b3f1e67921 Persist settings on a dedicated background thread
am: 82b8c92b97

* commit '82b8c92b97d3c7006d7a9f67a9cdb83263d6bf2c':
  Persist settings on a dedicated background thread

Change-Id: I1432822542bf914d106440b3f4bfa0e56b911eb2
2016-05-10 03:50:44 +00:00
Svet Ganov
82b8c92b97 Persist settings on a dedicated background thread
Settings were persisted on the system background thread but during
first boot the device is under heavy load and persisting settings
competes with other system components using the shared background
thread. As a result persisting settings can be delayed much longer
than the expected 200ms. This can cause issues with setup wizard
being skipped/went over and its component disaabled being persisted
but the setting whether the device is provisioned not being
persisted - now if the device boots it will have no SUW but also
the home button would be missing. Generally, we need a tansactional
abstraction in the system process to peform all delayed operations
atomically.

bug:25472484

Change-Id: Icf38e72403b190a8fa9d0554b8dd83ce78da3bc8
2016-05-10 03:39:55 +00:00
Steven Ng
dc20ba69bf Add a Global setting for disabling OEM unlocking setting
+ By default, OEM unlocking setting is enabled.
+ Add a check to prevent oem unlock being flipped if the setting isn't
  enabled.

Bug: 28163088
Change-Id: I087d8d5a1d99a611a8f66ff71a92ec9ea1da4e9f
2016-05-04 19:52:02 +00:00
Baligh Uddin
8a44c3c8d0 Import translations. DO NOT MERGE
Auto-generated-cl: translation import

Bug: 28463229
Change-Id: Ie10dd0e18292f94995761a098df8c42ee69a0e25
2016-05-03 16:36:29 -07:00
Svetoslav Ganov
83a1f7fe91 Add a missing null object check
We now have a null object instead of null values and
there was a place where we returned null instead of
the correct null object.

bug:28423485

Change-Id: I2626768acdf8d19fc94aa5e978eb057818450fa5
2016-04-27 14:18:05 -07:00
Seigo Nonaka
6e5b602552 Fix unexpected null check condition flipping.
With I5a40675dd226564c0ee190d0d6f7eb2a7e4673b0, isNull() is used for
null check but accidentally the condition is flipped.

Bug:28406262
Change-Id: I776a6c259765210a7b334a81876233b594fd25ed
2016-04-27 16:32:44 +09:00
Svet Ganov
6f8a10bd14 Add a missing null check
We no longer have a null settings value - instead it is a
null object. This change adds a missing null check that is
not changed to check against the null object.

bug:28406262

Change-Id: I5a40675dd226564c0ee190d0d6f7eb2a7e4673b0
2016-04-26 23:14:06 -07:00
Svetoslav Ganov
fedb230213 Replace null checks is null object checks
A recent change replaced the null state during a setting
lookup with a null object, however missed to update some
null checks to be null object ones.

bug:28405145

Change-Id: I80f0fb3ac6e64f4283b6c617283a009e97a40efe
2016-04-26 18:36:47 -07:00
Svet Ganov
53a441ca8e Ensure local settings caches are not stale
We used the system proterties as a shared memory mechanism
to propagate information to local settings caches when the
content has changed and the cache should be cleared. The
system properties are unfortunately updated asynchronously
leading to cases where clients may read stale data.

This change adds a simple int array data structure backed
by shared memory which guarantees individual values are
atomically read and updated without memory tear. Multi-
index opearations are not synchronized between each other.

The settings provider is using the new data structure to
propagate the settings generation which drives when caches
are purged.

We have a single memory array keeping the generation for
different settings tables per user. Since memory array is
not a compact data structure and the user space exceeds
the memory array size we use an in-memory map from keys
to indices in the memory array where the generation id of
a key is stored. A key is derived by the setting type in
the 4 most significant bits and the user id in the 28 least
significant bits.

The mapping from a key to an index is cleared if the user is
removed and the corresponding index in the memory arry is
reset to make it available for other users. The size of the
memory array is derived from the max user count that can be
created at the same time.

bug:18826179

Change-Id: I64009cc5105309ef9aa83aba90b82afc8ad8c659
2016-04-26 11:31:55 -07:00
Suprabh Shukla
c9d064a380 Added null check in appendSettingToCursor
Added check for null setting before adding to MatrixCursor.

Bug: b/27908871
Change-Id: I0b71c3d5347cad705b8def98fda7e9e463c295e2
2016-04-12 18:45:41 -07:00
Fyodor Kupolov
4c74334c44 Merge "Added getProfileIds method returning array of userIds" into nyc-dev 2016-04-11 16:40:55 +00:00
Daniel U
02ba61203e Copy lockscreen notification settings upon upgrade
Copy the primary values of LOCK_SCREEN_SHOW_NOTIFICATIONS and
LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS into managed profile upon upgrade.

Bug:27673591
Change-Id: I3207b7e5bf844f0df534324220082edbdabe8444
2016-04-08 16:41:15 +01:00
Fyodor Kupolov
7f98aa4aa9 Added getProfileIds method returning array of userIds
Previously many usages of UserManager.getProfiles and getEnabledProfiles
were only using ids of returned users. Given that the list of users needs
to be parceled and unparceled for Binder calls, returning array of ids
minimizes memory usage and serialization time.

A new method getProfileIds was introduced which returns an array of userIds.
Existing method calls were updated where appropriate.

Bug: 27705805
Change-Id: Ic5d5decd77567ba0f749e48837a2c6fa10e812c0
2016-04-07 16:41:57 -07:00
Ruben Brunk
98576cf949 Grant default permissions to preinstalled VrListenerServices.
- While explicitly bound, the package for a single pre-installed
  VrListenerService will be granted permission to access
  notification policy, be bound as a notification listener service,
  and draw system overlays.

Bug: 22855417
Change-Id: I568d5d9c032e0926e47c8ef4b46e3910b6bdf766
2016-03-30 18:48:54 -07:00
Geoff Mendal
0e1850fa22 Import translations. DO NOT MERGE
Change-Id: I52c8272bdf31d1624b5323433ef2f4742158a773
Auto-generated-cl: translation import
2016-03-19 03:57:59 +01:00
Jeff Sharkey
a04c7a7c64 Mark more Bundles as being defusable.
They're destined for the system, so they're okay to look inside.

Bug: 27726127
Change-Id: Ic85c308a8efe6f9b8652952717c72b3c663d328a
2016-03-18 12:20:39 -06:00
Jeff Sharkey
8a372a0a28 Refactoring FBE APIs based on council feedback.
Mostly consists of removing the word "encryption" from most APIs,
since we can't actually make promises about the data being encrypted.

Bug: 27531029
Change-Id: Iace9d7c4e64716abf86ed11847c40f3947e1d625
2016-03-17 14:49:08 -06:00
Jeff Sharkey
d136e51a99 Defuse Bundles parsed by the system process.
It's easy for apps to throw custom Parcelables into Bundles, but
if the system tries peeking inside one of these Bundles, it triggers
a BadParcelableException.  If that Bundle was passed away from the
Binder thread that delivered it into the system, we end up with a
nasty runtime restart.

This change mitigates this trouble by "defusing" any Bundles parsed by
the system server.  That is, if it encounters BadParcelableException
while unpacking a Bundle, it logs and delivers an empty Bundle as
the result.

Simultaneously, to help catch the system process sticking its
fingers into Bundles that are destined for other processes, a Bundle
now tracks if it's "defusable."  For example, any Intents delivered
through ActivityThread are marked as being defusable, since they've
arrived at their final destination.  Any other Bundles are considered
to be "in transit" and we log if the system tries unparceling them.

Merges several Parcel boolean fields into a flags int.  Add better
docs to several classes.

Bug: 27581063
Change-Id: I28cf3e7439503b5dc9a429bafae5eb48f21f0d93
2016-03-16 14:45:26 -06:00