Commit Graph

11855 Commits

Author SHA1 Message Date
Jeff Hamilton
caf728ea26 Minor LoadedApk refactoring.
- Rename varaibles holding LoadedApk to make the code easier to read.
- Move resource creation into LoadedApk, consolidating the logic.

(cherry picked from commit 7541ca4d1a)

Test: manual
Merged-In: I6bdc70482fbbb346ff694ada528ded18d3a63ef7
Change-Id: I6bdc70482fbbb346ff694ada528ded18d3a63ef7
2018-01-12 11:05:50 -08:00
Treehugger Robot
5edae415b0 Merge "Frameworks: Move SharedPreferencesImpl to tristate" 2018-01-11 23:52:46 +00:00
Jerry Zhang
68ad3d119c Merge "DO NOT MERGE: Add ScreenObserver" 2018-01-11 23:50:34 +00:00
Jerry Zhang
1b4b3c4e9b DO NOT MERGE: Add ScreenObserver
ScreenObserver allows system components to
monitor the screen lock state.

Bug: 68054513
Test: manual
Change-Id: I50f4690f68443f676d17e93efb1b7cb0857abd9e
2018-01-11 19:38:27 +00:00
Holly Jiuyu Sun
3d6b53c075 Add EuiccCardManager and EuiccCardController.
EuiccCardManager is in the same path with EuiccManager.
EuiccCardController is in the same path with EuiccController.
Use getAllProfiles() as an example interface.
The implementation of EuiccCard and its content will be added in a
follow up CL.
The new API is marked as @hide and TODO for @SystemApi.

Bug: 38206971
Test: test on phone
Change-Id: I153937c0f79bdd1a00b06b234a6e254a3f43072c
Merged-In: I153937c0f79bdd1a00b06b234a6e254a3f43072c
2018-01-11 10:30:43 -08:00
Andreas Gampe
1aa0d01cc8 Frameworks: Move SharedPreferencesImpl to tristate
The code loading shared preferences from disk may throw in other
ways then a missing file, for example during an out-of-memory
situation. Ensure that waiters will be woken up, and propagate
the exception to the getters.

Bug: 67986472
Test: m
Test: Device boots
Test: m cts && cts-tradefed run commandAndExit cts-dev --module CtsContentTestCases -c android.content.cts.SharedPreferencesTest
Change-Id: I56e47342111f1cb53c5817c0429af4a6787475a9
2018-01-05 18:02:30 -08:00
Andreas Gampe
158bde462e Revert "Frameworks: Move SharedPreferencesImpl to Future"
This reverts commit 70b600d456.

In preparation for a different fix. There are too many loopholes
with updates vs commits.

Bug: 67986472
Bug: 71533447
Test: m
Test: Device boots
Test: m cts && cts-tradefed run commandAndExit cts-dev --module CtsContentTestCases -c android.content.cts.SharedPreferencesTest
Change-Id: I872a81ae1a26e1f77aad2a52daf88e093a686ec6
2018-01-03 17:58:44 -08:00
Andreas Gampe
383f4f397b Revert "Frameworks: Silently ignore InterruptedException"
This reverts commit c8d5fc8572.

In preparation for different fix.

Bug: 67986472
Bug: 70122540
Bug: 71533447
Test: m
Test: Device boots
Test: m cts && cts-tradefed run commandAndExit cts-dev --module CtsContentTestCases -c android.content.cts.SharedPreferencesTest
Change-Id: I0b9e72d271725e15c20b68de981303c96ac1bd2a
2018-01-03 17:58:39 -08:00
Treehugger Robot
29f61c21f4 Merge "Fixed create app shortcut text and icon alignment in RTL Language" 2017-12-15 21:58:07 +00:00
susanta.patra
63c4f3318c Fixed create app shortcut text and icon alignment in RTL Language
The icon and text alignment was inconsistent in create app shortcut.

Test: 1. RTL language
      2. adb shell am start -n com.android.settings/com.android.settings.CreateShortcut
      3. Check the alignment
Bug: 70201173

Change-Id: Ib2be99fd6b5da5853acf34ade8e3b407164383aa
Signed-off-by: susanta.patra <susanta.patra@lge.com>
2017-12-05 15:44:26 +05:30
Andreas Gampe
a6c6c4f5d3 Merge "Frameworks: Silently ignore InterruptedException"
am: 7e717e09cd

Change-Id: I75da071918e7fc2e547df4e4d75121806c730ca2
2017-12-05 02:34:41 +00:00
Andreas Gampe
c8d5fc8572 Frameworks: Silently ignore InterruptedException
Apps seem to rely on this undocumented behavior so that the
threaded sync adapter doesn't crash an app. That's really
bad on the app side, but we will have to live with it.

Bug: 67986472
Bug: 70122540
Test: m
Test: Device boots
Test: m cts && cts-tradefed run commandAndExit cts-dev --module CtsContentTestCases -c android.content.cts.SharedPreferencesTest
Change-Id: I1ee4dfba4ad29c4f66fa60d3c8f8a99900b3447a
2017-12-04 15:00:24 -08:00
Andreas Gampe
bd4b1bad48 Merge "Frameworks: Move SharedPreferencesImpl to Future"
am: aa3e9d351e

Change-Id: I2a47400d1e584aef1a16e05840ab964ca5735110
2017-12-02 23:45:54 +00:00
Andreas Gampe
70da38960c Merge "Frameworks: Clean up SharedPreferencesImpl"
am: 572f46a3ef

Change-Id: I7b922f795283cefabf661e999e5a9897889fa287
2017-11-29 19:25:13 +00:00
Andreas Gampe
70b600d456 Frameworks: Move SharedPreferencesImpl to Future
The asynchronous loading code is not safe wrt/ exceptions. Instead
of adding a tri-state for loading, move the code to use a Future
for the map. This encapsulates the required wait & synchronization,
as well as propagating any exceptions.

Bug: 67986472
Test: m
Test: Device boots
Test: m cts && cts-tradefed run commandAndExit cts-dev --module CtsContentTestCases -c android.content.cts.SharedPreferencesTest
Change-Id: I6616e8a05e64eb1cfe024cc3239a05847dfe1fab
2017-11-21 15:59:02 -08:00
Andreas Gampe
f78a51759b Frameworks: Clean up SharedPreferencesImpl
Clean up in preparation for an implementation change. Add missing
annotations. Rename inner lock to be uniquely named. Use the local
map instead of mMap in the commit logic.

Test: m
Test: m cts && cts-tradefed run commandAndExit cts-dev --module CtsContentTestCases -c android.content.cts.SharedPreferencesTest
Change-Id: Id3a798732c83a4aa6487225e2375ade4985852e2
2017-11-21 15:34:05 -08:00
Philip P. Moltmann
7e37d48b0a Make SharedPreferences check with higher precision
When two processes modify shared preferences we use the timestamp to
figure out if the file was changes underneath. Do this with the highest
precision available (instead of sec) as before.

It would be possible to make the check more reliable by writing a unique
id to the shared pref file, but this would make this check much more
expensive in the common case that nothing changed. Considering that this
has not been a problem and we don't officially give any guarantee for
this sounds like a good middle-ground.

(cherry picked from commit ffe74357ae)

Merged-In: I04c96b6a946618d5599c26410c88d7cd654d31fb
Change-Id: I04c96b6a946618d5599c26410c88d7cd654d31fb
Test: SharedPreferencesTest
Fixes: 62949739
2017-11-20 10:01:08 -08:00
Ahmad Melegy
8c7c6e3952 Merge "Fix typo"
am: 913f396c11

Change-Id: I244ccafe5bf76718cdc48b2fa7d9ce8270b0dd33
2017-11-17 18:55:53 +00:00
Ahmad Melegy
e2bfbf1348 Fix typo
Fix typo in Activity class in requestPermissions method

Test: Existing unit tests still pass.
Bugs: None

Change-Id: If81117a0e769bca2f303e1ebce57ecda9544e129
Signed-off-by: Ahmad Melegy <ahmad.melegy@gmail.com>
2017-11-14 21:51:40 +00:00
Xin Li
220871a697 Merge commit '98e12851336b7db16e583f9afac63ecc97465980' from
oc-mr1-dev-plus-aosp-without-vendor into stage-aosp-master.

Change-Id: Ia7b8da4a00d215160e4a4fa40f6044208d1297b7
Merged-In: I19846d2a3ee27aecbae2367a74ee49082eea154d
2017-11-14 12:31:11 -08:00
Tianran Li
2973f63816 Merge "TimePickerDialog OTG keyboard entry discarded"
am: 8c2cb6ff08

Change-Id: Ib28468e637c146e69d59ee352b5a019654b3dc14
2017-11-14 19:47:34 +00:00
Treehugger Robot
8c2cb6ff08 Merge "TimePickerDialog OTG keyboard entry discarded" 2017-11-14 19:35:20 +00:00
Calin Juravle
310bc2b571 Merge "Create secondary dex profiles relative to the provided dex path"
am: f7f5732e2c

Change-Id: I6f2eb760e07959e26d46f8a0f3d4b4358b9a5a1e
2017-11-14 03:03:56 +00:00
Calin Juravle
d35451d76b Create secondary dex profiles relative to the provided dex path
We previously used the realpath to simplify the validation and processing
in installd. However it ended up making things more complicated when
cleaning up the profiles, especially because of /data/user/0 symlinks to
/data/data/.

Instead of using the realpath of the dex file to compute the profile
location, use the file path as given. This makes things consistent with
DexManager registration and allows for easier dex file reconciliation in
the presence of symlinks.

Bug: 64460009
Test: manual

(cherry picked from commit c119c5a8c1d8e3ba6c90300a82d2086273d0d3f3)

Merged-In: I2362f32a679324d4bc1e8a0fe83b5b17ee523e7a
Change-Id: Ic9c38a920c5eef85f26ac33f2b8a37c3694bfbad
2017-11-13 17:37:24 -08:00
Bryce Lee
a4ceea026d DO NOT MERGE Remove orientation restriction to only fullscreen activities.
This changelist removes checks that enforce that only fullscreen,
opaque activities may request orientation changes. An application
may itself be compatible with the change and update their SDK level.
However, it is possible they use a library that has not itself been
updated and still leverages this feature for non-fullscreen
activities.

Fixes: 68684796
Test: bit FrameworksServicesTests:com.android.server.wm.AppWindowTokenTests

Change-Id: I75bbda96b132694c722b0b535e33ea5e1b9a55db
2017-11-13 21:00:17 +00:00
Tianran Li
10864b0fcb TimePickerDialog OTG keyboard entry discarded
A user can manually enter time value using a keyboard.
NumberPicker then evaluates its value when focus is changed.
Currently when the dialog is closed by pressing OK, the value
from the focused NumberPicker is not taken into consideration.

To ensure retrieval of the correct value when closing the
dialog, the focus must be removed from the NumberPicker as
is done in DatePickerDialog.

Bug: 65664546
Test: Manual
      1. Connect physical keyboard via OTG connector
      2. Enter Settings and set time manually
      3. Select keyboard entry
      4. Change time and tap OK
      The entered time should be applied
Change-Id: I8a77cb3aaa54acb228ec1ce0e9385e2eb5e88e9b
2017-11-13 12:49:44 +00:00
Calin Juravle
a18e992770 Use the class loader context when optimizing secondary dex files
Record the class loader context for secondary dex loads and pass it to
dexopt during compilation.

The class loader context is passed from libcore every time a
BaseDexClassLoader is created and its recorded in the package dex usage
file.

Note that the context may be:
- unknown: if the dex file was not use after the the upgrade and its
context was not yet updated
- unsupported: if any of the class loaders from the loading context is
unsupported (only PathClassLoader and DelegateLastClassLoader are
supported).
- variable: if it changes over time, form one run to another.

In all the above cases the old compilation behavior is preserved for
now.(i.e. the dex file with be compiled with SKIP_SHARED_LIBRARY_CHECK)

(cherry picked from commit f1ff36f0f9)

Bug: 38138251
Test: runtest -x
services/tests/servicestests/src/com/android/server/pm/dex/
      adb shell cmd package compile -f -m quicken ^Csecondary-dex
com.google.android.gms

(cherry picked from commit 3bec94d78b)

Merged-In: Ie8b78c7c0d5de43733b3d116f8dcb3a65324cca8
Change-Id: Ie8b78c7c0d5de43733b3d116f8dcb3a65324cca8
2017-11-01 13:07:34 -07:00
Calin Juravle
6214f1bc53 Change the location of current profiles for secondary dex files
Move the secondary dex profiles inside the oat folder. This makes it
easier to clean them up and "protects" them against apps which may delete
unknown files from their directories (e.g. search).

(cherry picked from commit eec18f41e2)

Bug: 62336157
Test: Manual: boot the device, use the app, check the profiles are
collected in the new location.

Merged-In: I2fbce7591589d162775e4652b12e4698083adcff
Change-Id: I2fbce7591589d162775e4652b12e4698083adcff
2017-10-31 15:25:00 -07:00
Jeff Sharkey
1285cfd48f Change storage migration to use quota APIs.
New quota APIs are much faster than trying to measure manually, and
removing this last user of calculateDirectorySize() means we can
remove it once and for all.

(cherry picked from commit c8b29ac6f0)

Bug: 36056324
Test: builds, boots
Merged-In: Ibdf1ee4e8885680e106df6a9269b6309ddc61af8
Change-Id: Ibdf1ee4e8885680e106df6a9269b6309ddc61af8
2017-10-31 09:50:50 -07:00
Neil Fuller
b755291e65 Be more explicit about users
Be more explicit about users executing processes in the time
zone updates code.The code was already running everything as the
system user but now that's more explicit / by design.

To service unit tests:
make -j30 FrameworksServicesTests
adb install -r -g "${ANDROID_PRODUCT_OUT}/data/app/FrameworksServicesTests/FrameworksServicesTests.apk"
adb shell am instrument -e package com.android.server.timezone -w com.android.frameworks.servicestests \
  "com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner"

Bug: 64111659
Test: Unit tests: See above
Test: Manual testing installing updates as secondary device user
Test: PTS: run pts -m PtsTimeZoneTestCases
Change-Id: Idb754f3e1aa3830ba1ada8ef5740f9f7340f03d5
Merged-In: Idb754f3e1aa3830ba1ada8ef5740f9f7340f03d5
(cherry picked from commit 1281f39f86)
2017-10-25 14:00:24 +01:00
Bernardo Rufino
4229c3fcbd Canonicalize notification channel sounds for backup
am: 2d7a4a3f67

Change-Id: I47c5aba70bd6713f5cd2432b1141d0772fa1e672
2017-10-11 17:50:06 +00:00
Bernardo Rufino
2d7a4a3f67 Canonicalize notification channel sounds for backup
Canonicalize for backup and canonicalize and uncanonicalize for restore
(see comment).

Test: Set custom notification sound, make backup, remove notification
sound from device (from Ringtones and make sure to update media content
provider), restore => Observe default instead of random number. Do the
same without removing the sound and observe restores successfully.
Test: runtest systemui-notification
Bug: 66444697

(cherry picked from commit c27bb6ad34)

Change-Id: I32c186d0d7479b01f6cc67cce9bc5cb66264a064
2017-10-11 15:22:32 +01:00
Andrew Solovay
81643c09cc Merge "docs: Tiny usage fix ("e-mail" -> "email")" into oc-mr1-dev
am: c4a0b34248

Change-Id: I96c464236f694b194e9f5a6aba68b40ad840035d
2017-10-10 16:42:31 +00:00
Andrew Solovay
ab8ea9ff01 docs: Tiny usage fix ("e-mail" -> "email")
I needed to make an edit in this branch to verify part of our docs
process, so I found a Javadoc typo to fix. No code error, just took
out the hyphen in "e-mail" in a Javadoc comment.

Test: make ds-docs
Bug: 67515954
Change-Id: Icb9b2a9df0d7dfd697050735886adec80bc92ff8
2017-10-09 18:49:41 -07:00
Ruben Brunk
3de064f7cc Merge "Bind VR compositor service from VrManagerService." into oc-mr1-dev
am: c765c2c448

Change-Id: I868d30cae1181efc90d41d3a2fea33baa503ff0a
2017-10-05 04:03:03 +00:00
TreeHugger Robot
c765c2c448 Merge "Bind VR compositor service from VrManagerService." into oc-mr1-dev 2017-10-05 03:53:44 +00:00
Felipe Leme
63b45a87d5 Merge "Sets AutofillClient on attachBaseContext()" into oc-mr1-dev
am: 6d17d9d0cf

Change-Id: I4b1d2a4e308a91d15282ae99ee158b7004b91211
2017-10-04 22:25:18 +00:00
TreeHugger Robot
6d17d9d0cf Merge "Sets AutofillClient on attachBaseContext()" into oc-mr1-dev 2017-10-04 22:17:11 +00:00
Felipe Leme
bb567ae6c0 Sets AutofillClient on attachBaseContext()
When an activity overrides attachBaseContext(), the attached context must share
the same AutofillCient, otherwise it will break autofill in the activity.

Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases -t android.autofillservice.cts.AttachedContextActivityTest
Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases

Fixes: 67350639

Change-Id: I6b0c4c2fab5fa68eb6ee0714e107ca0816efb2cb
2017-10-04 12:23:23 -07:00
Clara Bayarri
889c0c0f12 Merge "Fix NPE in ActivityThread" into oc-mr1-dev
am: 348b13f597

Change-Id: I4ac05199b93902bb19fd6eb42563e9c4fa00ed6c
2017-10-04 12:51:59 +00:00
TreeHugger Robot
348b13f597 Merge "Fix NPE in ActivityThread" into oc-mr1-dev 2017-10-04 12:40:39 +00:00
Ruben Brunk
52ea662280 Bind VR compositor service from VrManagerService.
- Allow VR system application to have VR manager service bind a
compositor process so that oom scoring for the compositor process can be
adjusted.

Bug: 38390640

Test: Check that the VrCore compositor process is -700 on AIO devices with:

  adb shell procrank -o

Change-Id: I7b5bce5eb87bd5ed0fdeadf4ec7bdd2b361ab875
2017-10-03 20:58:30 -07:00
Felipe Leme
aee3ccb15c Merge "Fixed URL used on sample." into oc-mr1-dev
am: 6ba7019bb0

Change-Id: I124cbaecd5f8763ecd7f4b06070af48f6b1e0c1d
2017-10-04 00:36:02 +00:00
Felipe Leme
52c6ed3763 Fixed URL used on sample.
Test: nope!
Bug: 66963249

Change-Id: Ieb46c00d97c8657a4e7498a8136c6da46760fbdd
2017-10-03 14:49:15 -07:00
Clara Bayarri
cb941157a2 Fix NPE in ActivityThread
Calling LoadedApk.getResources() instead of accessing its
mResources directly accounts for the case where this might
not have been initialized.

Bug: 67327250
Test: none
Change-Id: Iaa392a90eefb60ad479cedf8c882976dbe390387
2017-10-03 16:03:22 +00:00
George Mount
8e8e3eff08 Merge "Fix Transition test failure." into oc-mr1-dev
am: dbd11d6c8b

Change-Id: I5ae4bde02a4ee2a6d053529ebed0b6aa3dc596c5
2017-10-02 21:23:15 +00:00
George Mount
3884b03b98 Fix Transition test failure.
Bug: 67049319

TransitionUtils was returning null when the View wasn't attached,
but Visibility transitions can do that intentionally. This CL
temporarily adds detached views to the view hierarchy as part of
an overlay while creating the hardware bitmap representation.

Test: ran transition CTS tests
Change-Id: Ie335619953653dce0224514f0d5c9c8eb00ee1a9
2017-09-29 15:03:47 -07:00
Felipe Leme
8eec0c723d Merge "Fixed warning on getWebDomain()" into oc-mr1-dev
am: 256c2822f5

Change-Id: I4279400bd5a5ab441961942782054d5e810235c4
2017-09-29 18:40:34 +00:00
Felipe Leme
6221903454 Fixed warning on getWebDomain()
Test: ran 'm -j doc-comment-check-docs' and checked resulting HTML.
Bug: 66963249

Change-Id: If063961f41f297da1ed67e73616972f455edc117
2017-09-29 08:58:47 -07:00
Svet Ganov
b5ac756015 Merge "Don't clobber shared libs when updating app info" into oc-mr1-dev
am: 4de7ab5cb1

Change-Id: I2e50c036193ba30a203fcfe2f46ea9f94b5992ee
2017-09-29 00:17:57 +00:00