943 Commits

Author SHA1 Message Date
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
The Android Automerger
750ccd5333 Manually merge branch 'nyc-mr1-dev-plus-aosp' to shortcircuit automerger b/28407115 2016-04-27 22:14:50 +00:00
Svetoslav Ganov
6a6af38e84 Merge "Merge "Add a missing null object check" into nyc-dev am: 44cc663" into nyc-mr1-dev
am: 3744435

* commit '3744435859b91e1f50a5926c339db6869b908299':
  Add a missing null object check

Change-Id: I0a620c6b17ddd66e6b84c1817292aef4b3bf010d
2016-04-27 21:30:16 +00: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
The Android Automerger
8bdf39e19c Manually merge branch 'nyc-mr1-dev-plus-aosp' to fix automerger blockage b/28407115 2016-04-27 17:58:24 +00:00
Seigo Nonaka
a0c0f9e40f Fix unexpected null check condition flipping. am: 6e5b602
am: c137b29

* commit 'c137b29fc32d5f4b7e57802a84d45ce05a2e6fb5':
  Fix unexpected null check condition flipping.

Change-Id: Iaa62ea16961e6fa4c4c1367d156ad5d9fa99fad2
2016-04-27 07:59:05 +00: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
6b42eb62b5 Merge "Replace null checks is null object checks" into nyc-dev am: cab5164 am: 9fe1826
am: e9d7298

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

Change-Id: Ifa83e8152686a75a0c9ba5c947c7463b213b6ab4
2016-04-27 02:50:44 +00: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
db2174dcb8 Merge "Ensure local settings caches are not stale" into nyc-dev am: f71d7fe am: d4bc15b
am: 0010741

* commit '0010741818127e6c9449fc49490f0bad14a76240':
  Ensure local settings caches are not stale

Change-Id: I26c4f1f72eda3b2ebfb3ca6e086a0381d357471c
2016-04-26 18:54:37 +00: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
ef773e84c6 frameworks/base: Avoid Long object allocations in Long.valueOf() am: 28532d0026
am: 9031ab18fd

* commit '9031ab18fdb0187016998d0e192df12160265b9c':
  frameworks/base: Avoid Long object allocations in Long.valueOf()

Change-Id: I87089a855f76ccbdb086185000f13e803023e67a
2016-04-22 12:58:47 +00: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
Baligh Uddin
15dd379c4e Import translations. DO NOT MERGE
Change-Id: I37197f229d8adde2d48d37c1f172fd3800a61811
Auto-generated-cl: translation import
2016-04-19 00:29:21 -07:00
TreeHugger Robot
d2f0242a47 Merge "Added null check in appendSettingToCursor" into nyc-dev am: b020279
am: 6e4fec3

* commit '6e4fec33d0c63827c5ebd4aa2d89cc652a37e884':
  Added null check in appendSettingToCursor

Change-Id: Id67d20eeb6bda19cb5ada62ac97f38d6f5dd30c3
2016-04-13 03:20:24 +00: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
d0dba8b973 Merge "Added getProfileIds method returning array of userIds" into nyc-dev am: 4c74334
am: 036bdca

* commit '036bdcac4499b3ce6932f1ed237797332609c329':
  Added getProfileIds method returning array of userIds

Change-Id: If88d4c3d480be43fedae6a976467706bfbaf37b7
2016-04-11 16:50:59 +00: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
abf8f16704 Merge "Copy lockscreen notification settings upon upgrade" into nyc-dev am: 534537d
am: ee6b95a

* commit 'ee6b95a226a1414588eb8a06468eb0cd8017985b':
  Copy lockscreen notification settings upon upgrade

Change-Id: I39ed39f2ebf8d1ce39cdd68447f832c82d5e1f28
2016-04-08 16:00:30 +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
8bdd359c7e Merge "Grant default permissions to preinstalled VrListenerServices." into nyc-dev am: 8f7e381
am: ec64b9d

* commit 'ec64b9d8075239a51eac9993bc9eea61c4bddcaa':
  Grant default permissions to preinstalled VrListenerServices.

Change-Id: I136e1c5bf3819ce7e25c5b4c988b955188ce665f
2016-03-31 22:06:08 +00: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
2d014a379e Import translations. DO NOT MERGE
Change-Id: Ib0562847b2bf63228be18be5f010abf03a747535
Auto-generated-cl: translation import
2016-03-18 20:25:49 -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
4621029922 Merge "Mark more Bundles as being defusable." into nyc-dev am: 620a28b
am: c012cf2

* commit 'c012cf26869e432adf8461e7134f117d95f239e2':
  Mark more Bundles as being defusable.
2016-03-18 20:09:53 +00: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
78bcc89df4 Merge "Refactoring FBE APIs based on council feedback." into nyc-dev am: a0a58a2
am: 5a128c4

* commit '5a128c4f33aa38d3a35b5884519f6bd3a355512d':
  Refactoring FBE APIs based on council feedback.
2016-03-17 22:09:46 +00: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
7029a23b38 Merge "Defuse Bundles parsed by the system process." into nyc-dev am: c4b0ade
am: a0f6318

* commit 'a0f6318f44244ec4e916d3abecf157beb4fefc8c':
  Defuse Bundles parsed by the system process.
2016-03-17 18:54:28 +00: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
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
Geoff Mendal
d629916673 Import translations. DO NOT MERGE
Change-Id: Ied20f8a06f71782e6f15c78d73cb3be49c097b2b
Auto-generated-cl: translation import
2016-03-09 07:27:08 -08:00
Prathmesh Prabhu
9625803762 Merge "SettingsProvider: Add default value for SHOW_IME_WITH_HARD_KEYBOARD." into nyc-dev am: fbcaea877c
am: d2b935e3c6

* commit 'd2b935e3c6054cd1d32b4f8f13b78dbfa23c20e9':
  SettingsProvider: Add default value for SHOW_IME_WITH_HARD_KEYBOARD.
2016-03-08 21:25:16 +00:00
Amith Yamasani
02badb8c4b Merge "Reorder migration of settings from db to xml" into nyc-dev am: 4b1d8b07e5
am: 6bf420168a

* commit '6bf420168a0e4f68cd43f8d4c99f4b17f415b54f':
  Reorder migration of settings from db to xml
2016-03-08 20:59:56 +00:00