741 Commits

Author SHA1 Message Date
Roshan Pius
28be4fc091 SettingsBackupAgent: Remove redundant size parameter
Remove the redundant size parameter in wifi backup/restore.

BUG: 28967335
Change-Id: I8ae9b2bf3bc8eb2dd1fd6dd87fe7b1dcf0712382
(cherry picked from commit 5db739c67fb6c897da91ccdda5700ff660eea15d)
2016-08-26 13:22:50 -07:00
Roshan Pius
1bf869887d Use WifiManager for wifi backup/restore
Use the newly exposed WifiManager API's for backing up/restoring wifi
related data. Remove all other wifi related logic from
SettingsBackupAgent.

There are 3 API's exposed by WifiManager for backup/restore:
1. retrieveBackupData - Data to be backed up in new format.
2. restoreBackupData - Restore from the new backup data format.
3. restoreOldBackupData - Restore from the old backup data format.

BUG: 29075035
BUG: 28967335
Change-Id: I2dc379bc36af0a0824ed51fbe9aaebfd0a0114b0
(cherry picked from commit 7a2491fa3b42dd22c829eea3690239545f16f124)
2016-08-26 13:22:48 -07:00
Bill Yi
9a2f574fce Import translations. DO NOT MERGE
Auto-generated-cl: translation import

Bug: 29390361
Change-Id: Iac4bc0fff7337c0971222e59b1f01e4a7ff3a1c5
2016-06-30 19:59:37 -07:00
Svetoslav Ganov
ee4c0a3c7e Merge \"Fix a race in local settings caches\" into nyc-dev
am: f4ddb7ce30

Change-Id: Ia973ef68382ac359908b83be3dbca485c91d5cd6
2016-06-18 00:38:28 +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
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
bced7c5fb6 Merge "Don\'t remove existing EAP configurations" into nyc-dev
am: c7ad1ac712

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

Change-Id: I2678831ad384368a322af859aeadc42fcd2aeda7
2016-05-20 17:45:21 +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
8d761fb452 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: I6939635dfc93015c4625e50b6431ceb850cfbd1a
2016-05-16 19:50:00 +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
d361bbd0db Merge "Make settings cahches generation mechanism robust." into nyc-dev
am: b35301e421

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

Change-Id: I59566be20a76084f409f0dd57c70337b60339c87
2016-05-13 22:26:29 +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
Svet Ganov
21914ba1ae Merge "Persist settings on a dedicated background thread" into nyc-dev
am: 00749aeb15

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

Change-Id: I31ec418fb5b1338bc8d55eec08568028d42d95a2
2016-05-12 19:57:46 +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
27e54131fa Merge "Fix a race in settings update." into nyc-dev
am: df15e03ed0

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

Change-Id: I6b51cb006e3b729ae8e0bd1060b41eb0ca1bdd68
2016-05-12 15:51:05 +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
8de4d5ecca 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: If082c93a5868b2a95965458a2c06defe101edd72
2016-05-10 07:18:33 +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
f528fb457b Persist settings on a dedicated background thread
am: 82b8c92b97

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

Change-Id: I596e8f3ee73b886c79f2b79d47c73111e5f2d0a3
2016-05-10 03:50:47 +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
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
469ae41501 Merge "Add a missing null object check" into nyc-dev
am: 44cc663

* commit '44cc663f7873e37ee6bf19a01c0b404316e180fc':
  Add a missing null object check

Change-Id: I7d102a0bd250eeb11e969295576217fa1d7beb45
2016-04-27 21:26:35 +00: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
d9a6dbc33b Fix unexpected null check condition flipping.
am: 6e5b602

* commit '6e5b602552b15ab95dc7b1e4e824f8da6a951fcf':
  Fix unexpected null check condition flipping.

Change-Id: I769efe191ebda83e63361f51f193a9824de6fddc
2016-04-27 07:54:57 +00: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
661f26a248 Add a missing null check
am: 6f8a10b

* commit '6f8a10bd14d927f9603823c06a3e53f56392ba95':
  Add a missing null check

Change-Id: Ic6e71119c16925cab184826442d4a7c648c287f1
2016-04-27 06:20:09 +00: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
9fe1826fb7 Merge "Replace null checks is null object checks" into nyc-dev
am: cab5164

* commit 'cab51643e7ee265fca57bb826e54ff55bbd8afb3':
  Replace null checks is null object checks

Change-Id: I64dd138118f175a3fde6ba164b66fcdf63fff5e7
2016-04-27 01:45:58 +00: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
d4bc15b66b Merge "Ensure local settings caches are not stale" into nyc-dev
am: f71d7fe

* commit 'f71d7feef22db9e0cab2f32edc7440aedb86fdfe':
  Ensure local settings caches are not stale

Change-Id: I356b9ad0b6dc1e91bfad140de1b9fc79ab6efef3
2016-04-26 18:47:52 +00: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
Tobias Thierer
28532d0026 frameworks/base: Avoid Long object allocations in Long.valueOf()
Replace usages where the Long is immediately unboxed or thrown
away with Long.parseLong().
In TaskRecord.java, I also fixed up similar uses of
{Boolean,Integer}.valueOf()

Tested: built frameworks/base successfully.

Bug: 28289401
(cherry picked from commit 4bd017d6a5437f153b2b0a149a5dde0b85bf6907)

Change-Id: Icfa4708946e774f4a1bacf185c3fd11a7087017e
2016-04-22 13:36:53 +01:00
Suprabh Shukla
6e4fec33d0 Merge "Added null check in appendSettingToCursor" into nyc-dev
am: b020279

* commit 'b0202799528fe70a045224b1151c1720ef224aa8':
  Added null check in appendSettingToCursor

Change-Id: Iaf678dd04e6ee911452fd70319fc458ba39673cf
2016-04-13 03:17:22 +00: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
036bdcac44 Merge "Added getProfileIds method returning array of userIds" into nyc-dev
am: 4c74334

* commit '4c74334c4425e43dfb53bc2ef707eebb1bef7d5b':
  Added getProfileIds method returning array of userIds

Change-Id: Iea98c0fa6062e759da3adfe35c324a018aef2223
2016-04-11 16:46:01 +00: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
ee6b95a226 Merge "Copy lockscreen notification settings upon upgrade" into nyc-dev
am: 534537d

* commit '534537d313fdf456979aaf7cdbabc63c718e1d44':
  Copy lockscreen notification settings upon upgrade

Change-Id: I920dd5b11c52de96ebac3cd42109ef1ed9cbf9f8
2016-04-08 15:56:09 +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
ec64b9d807 Merge "Grant default permissions to preinstalled VrListenerServices." into nyc-dev
am: 8f7e381

* commit '8f7e3815e71cfb9a45b8632e6b9f37684699ff82':
  Grant default permissions to preinstalled VrListenerServices.

Change-Id: I5332d425146fcac44b662843fa9b10644a6f8e1e
2016-03-31 22:02:55 +00: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
c012cf2686 Merge "Mark more Bundles as being defusable." into nyc-dev
am: 620a28b

* commit '620a28bad2b1ddabddf2d78b5a20a762ebc29205':
  Mark more Bundles as being defusable.
2016-03-18 20:06:07 +00: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
5a128c4f33 Merge "Refactoring FBE APIs based on council feedback." into nyc-dev
am: a0a58a2

* commit 'a0a58a2fd5cbc1bb8056227bb04f276b364c6e96':
  Refactoring FBE APIs based on council feedback.
2016-03-17 22:07:23 +00: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
a0f6318f44 Merge "Defuse Bundles parsed by the system process." into nyc-dev
am: c4b0ade

* commit 'c4b0ade245fcf6546ac722ac9ce6ddd30b473e68':
  Defuse Bundles parsed by the system process.
2016-03-17 17:35:04 +00:00