Commit Graph

16237 Commits

Author SHA1 Message Date
Automerger Merge Worker
0ea7868a9d Merge "Revert "Cache binder calls in CompatChanges"" am: e879968fbf am: 1da820d954
Change-Id: I3bc8bea4eb5dcc7fbda8a3372083e04337e95242
2020-02-21 19:45:41 +00:00
Automerger Merge Worker
1da820d954 Merge "Revert "Cache binder calls in CompatChanges"" am: e879968fbf
Change-Id: I2fd44d5f95c66d57c8cf779a8b18a10b4e2e965c
2020-02-21 19:25:51 +00:00
Anna Trostanetski
9c6ecc90c5 Revert "Cache binder calls in CompatChanges"
Reason for revert: cache needs to be cleared on package install.
This is much simpler to do in internal master with recent changes
(ag/10172190) so I'm reverting the cache from aosp to keep it correct,
and cherrypicking this into internal master.

Change-Id: I71757a5b60fbdba3c69322b95a20527a1e3a66e9
2020-02-21 16:38:32 +00:00
Automerger Merge Worker
a2c3c9fe10 Merge "Revert "Revert "[DexLoadReporter] Report classloader contexts di..."" am: 1ee3e70cf3 am: 2cef69cb5f
Change-Id: I6146cfbbd0a8214e476e50b359ce5474e6d5070c
2020-02-19 20:12:07 +00:00
Automerger Merge Worker
2cef69cb5f Merge "Revert "Revert "[DexLoadReporter] Report classloader contexts di..."" am: 1ee3e70cf3
Change-Id: I5645d6c8f666e2e29e753cad5f216f9d7ab335d2
2020-02-19 19:52:57 +00:00
Calin Juravle
1ee3e70cf3 Merge "Revert "Revert "[DexLoadReporter] Report classloader contexts di..."" 2020-02-19 19:38:35 +00:00
Calin Juravle
c78162f489 Revert "Revert "[DexLoadReporter] Report classloader contexts di..."
Original commit:
[DexLoadReporter] Report classloader contexts directly from classloader

At the moment classloader contexts are incorrectly computed in the
PackageManager for secondary dex files. There are two issues:

(1) The wrong computed classLoaderContext will be reported for a secondary
    dex file if it was loaded at the same time as a primary dex file
    - This is due to the continue statement that doesn't increment
      dexPathIndex
(2) If a secondary dex file was loaded with a shared library then that
    shared library info isn't passed through the dex load reporting
    infrastructure, and thus its classloader context is incorrectly computed
    in PackageManager.

In order to fix the issues described above & prevent further classloader
context computation divergences between the package manager and the
runtime, lets compute the classloader context in the runtime at dex load
time and report the expected classloader context directly to
DexLoadReporter (and thus the package manager).

Notes: This is mostly just a refactor (i.e. there are a lot of line
changes, but functionally speaking this set of CLs doesn't do much
except change where the classloader context is computed)

Addendum: The bugs described above could also be fixed by:
- changing DexLoadReporter to report information about shared libraries that
  the reported classloaders depend on to PackageManager
- Teach DexoptUtils.processContextForDexLoad about shared libraries
- Fix dexPathIndex calculation in DexManager

I opted for this set of changes instead because this reduces the
possibility of context computation divergence between the framework and the
runtime. Additionally it feels more "solid" that the classloader context
is now computed directly when a dex file is loaded, rather than the
context recreated later on in the PackageManager.

Test: atest com.android.server.pm.dex.DexManagerTests
Test: atest com.android.server.pm.PackageManagerServiceTest
Test: Install app depending on shared library & uses secondary dex
files; adb shell pm bg-dexopt-job; launch app and see odex file
successfully loaded (from smaps/no logcat errors)

Bug: 148494302
Exempt-From-Owner-Approval: This is a pure re-revert, previously owner approved.
Reason for revert: Re-land
Reverted Changes:
I295a6e99e:Revert "Fix shared libraries not being reported vi...
Ib58066e8f:Revert "[DexLoadReporter] Report classloader conte...

Change-Id: I8d1af791f93a3f8fa6eca78df50891cd2ebbb4a3
2020-02-19 19:37:05 +00:00
Automerger Merge Worker
893bf3b7f5 Merge "Improve BaseBundle#kindofEquals" am: 42ab50d14b am: 1f82fbb4ac
Change-Id: I0dadb4269692a86cab1c66e1c69d9a95bfddd9a2
2020-02-19 00:53:38 +00:00
Automerger Merge Worker
1f82fbb4ac Merge "Improve BaseBundle#kindofEquals" am: 42ab50d14b
Change-Id: Ic5c2c5bcf979236c77344d0507d071bbb83f624e
2020-02-19 00:33:09 +00:00
Treehugger Robot
42ab50d14b Merge "Improve BaseBundle#kindofEquals" 2020-02-18 23:56:30 +00:00
Andrei-Valentin Onea
309680b57a Merge changes from topic "add-caching-platformcompat" am: 8f269473b2 am: 61e6c86f54
Change-Id: I29bd6489714d3101eef2d8c18a12bd71391ff4ef
2020-02-18 17:39:43 +00:00
Daniel Colascione
9df97ead62 Add property-invalidated cache am: 764ff47f87 am: 7c9f1499bc
Change-Id: Ib917ce8f32bccf91ec2c4d77e445f8afae6d7ad5
2020-02-18 17:39:40 +00:00
Andrei-Valentin Onea
61e6c86f54 Merge changes from topic "add-caching-platformcompat" am: 8f269473b2
Change-Id: If1af69efe644b57c990a85bbb07ea9442edf808e
2020-02-18 17:30:44 +00:00
Daniel Colascione
7c9f1499bc Add property-invalidated cache am: 764ff47f87
Change-Id: I49849de310a637d9d407698a4a0120b5b8aa48aa
2020-02-18 17:30:40 +00:00
Andrei-Valentin Onea
8f269473b2 Merge changes from topic "add-caching-platformcompat"
* changes:
  Cache binder calls in CompatChanges
  Add property-invalidated cache
2020-02-18 17:16:09 +00:00
Nicolas Geoffray
f96a5bf6a0 Merge "Revert "[DexLoadReporter] Report classloader contexts directly f..."" am: ae50e15d59 am: ea12868665
Change-Id: I4faaff1f5227b64028222c5824d70ac0356cf20f
2020-02-15 17:51:03 +00:00
Nicolas Geoffray
ea12868665 Merge "Revert "[DexLoadReporter] Report classloader contexts directly f..."" am: ae50e15d59
Change-Id: Icc45c40ce116ce54a915650ca6f6600b6db08e0e
2020-02-15 17:36:14 +00:00
Nicolas Geoffray
ae50e15d59 Merge "Revert "[DexLoadReporter] Report classloader contexts directly f..."" 2020-02-15 17:14:15 +00:00
Nicolas Geoffray
371fcb7cf2 Revert "[DexLoadReporter] Report classloader contexts directly f..."
Revert "Fix shared libraries not being reported via Reporter"

Revert submission 1198456-slclc

Reason for revert: Fails on luci:
https://ci.chromium.org/p/art/builders/ci/host-x86_64-cdex-fast/3123

Exempt-From-Owner-Approval: pure revert

Bug: 148494302
Reverted Changes:
I46d8d9105: Fix shared libraries not being reported via Report...
I00357cfe0: [DexLoadReporter] Report classloader contexts dire...

Change-Id: Ib58066e8f059642a11d9eaab02ec0b8b3217e487
2020-02-15 17:13:58 +00:00
Junyu Lai
a08cdb380e Merge "[SP16] Address comments on aosp/1172143" am: fc9e4fbc08 am: dfb6a0fdb9
Change-Id: Id6d4be756ec4bd6d3e9c7b8fa1d85b3bdc802a10
2020-02-15 02:51:23 +00:00
Junyu Lai
dfb6a0fdb9 Merge "[SP16] Address comments on aosp/1172143" am: fc9e4fbc08
Change-Id: I9c826c08320e112466dea0d2628f3447ebcb7d02
2020-02-15 02:35:42 +00:00
Junyu Lai
fc9e4fbc08 Merge "[SP16] Address comments on aosp/1172143" 2020-02-15 02:21:30 +00:00
Suprabh Shukla
3b413dd57e Improve BaseBundle#kindofEquals
If both BaseBundles are empty, we can infer that without needing to
unparcel any of them.

Test: atest FrameworksCoreTests:android.os.BundleTest

Bug: 146037505
Change-Id: I04c28cdd1293227d9887b0c17e178f61328c1959
Merged-In: I04c28cdd1293227d9887b0c17e178f61328c1959
2020-02-14 14:05:00 -08:00
Calin Juravle
cb3d0f7ab5 Merge "[DexLoadReporter] Report classloader contexts directly from classloader" am: 5a01991fef am: ce9b12f5bf
Change-Id: I55eb1b61f848b993d17d54e68f0e6403c61e456d
2020-02-14 20:42:33 +00:00
Calin Juravle
ce9b12f5bf Merge "[DexLoadReporter] Report classloader contexts directly from classloader" am: 5a01991fef
Change-Id: Ida294271950c3f330f1acb2150ac3892db88ab64
2020-02-14 20:29:11 +00:00
Calin Juravle
5a01991fef Merge "[DexLoadReporter] Report classloader contexts directly from classloader" 2020-02-14 20:16:24 +00:00
junyulai
7d058ec6b0 [SP16] Address comments on aosp/1172143
Test: atest FrameworksNetTests
Test: atest NetworkPolicyManagerServiceTest
Test: m doc-comment-check-docs
Bug: 130855321
Change-Id: Iccaab09f5b9668ec4a7249737c64a69cecb08d15
2020-02-14 16:53:40 +08:00
Automerger Merge Worker
01bb7cef0e Merge "Update InCallService API docs." am: 11e7b55ea9 am: 040db280fa
Change-Id: Id6df82c6284b2cc027dba1d2b355806888185761
2020-02-13 19:26:10 +00:00
Automerger Merge Worker
040db280fa Merge "Update InCallService API docs." am: 11e7b55ea9
Change-Id: Ica011ce75760d1d7338c3accdf29dc7505fd9949
2020-02-13 19:09:01 +00:00
Tyler Gunn
11e7b55ea9 Merge "Update InCallService API docs." 2020-02-13 18:48:00 +00:00
Andrei Onea
3ef678b58f Cache binder calls in CompatChanges
Cached call values are kept in ChangeIdStateCache (per-process cache).
Use "cache_key.is_compat_change_enabled" system property to
invalidate the cache (i.e. any value different from the last observed
will trigger an invalidation).
Any process can read that property, but only system server can change it.

Bug: 140441727
Test: atest PlatformCompatTest
Test: atest CompatConfigTest
Test: atest CompatChanges
Test: atest PlatformCompatGating

Change-Id: Ibed398ae965b7da2432aaf8d5ffc259f7d228c7e
2020-02-13 17:36:37 +00:00
Dan Zimmerman
a05766e507 [DexLoadReporter] Report classloader contexts directly from classloader
At the moment classloader contexts are incorrectly computed in the
PackageManager for secondary dex files. There are two issues:

(1) The wrong computed classLoaderContext will be reported for a secondary
    dex file if it was loaded at the same time as a primary dex file
    - This is due to the continue statement that doesn't increment
      dexPathIndex
(2) If a secondary dex file was loaded with a shared library then that
    shared library info isn't passed through the dex load reporting
    infrastructure, and thus its classloader context is incorrectly computed
    in PackageManager.

In order to fix the issues described above & prevent further classloader
context computation divergences between the package manager and the
runtime, lets compute the classloader context in the runtime at dex load
time and report the expected classloader context directly to
DexLoadReporter (and thus the package manager).

Notes: This is mostly just a refactor (i.e. there are a lot of line
changes, but functionally speaking this set of CLs doesn't do much
except change where the classloader context is computed)

Addendum: The bugs described above could also be fixed by:
- changing DexLoadReporter to report information about shared libraries that
  the reported classloaders depend on to PackageManager
- Teach DexoptUtils.processContextForDexLoad about shared libraries
- Fix dexPathIndex calculation in DexManager

I opted for this set of changes instead because this reduces the
possibility of context computation divergence between the framework and the
runtime. Additionally it feels more "solid" that the classloader context
is now computed directly when a dex file is loaded, rather than the
context recreated later on in the PackageManager.

Test: atest com.android.server.pm.dex.DexManagerTests
Test: atest com.android.server.pm.PackageManagerServiceTest
Test: Install app depending on shared library & uses secondary dex
files; adb shell pm bg-dexopt-job; launch app and see odex file
successfully loaded (from smaps/no logcat errors)

Bug: 148494302
Change-Id: I00357cfe086ff149f92c1078c6df6daa713c8f7c
2020-02-13 04:31:55 -08:00
Daniel Colascione
764ff47f87 Add property-invalidated cache
The PropertyInvalidatedCache class provides a framework for caching
frequently-read, seldom-written information between processes.

Test: caching CLs
Test: atest FrameworksCoreSystemPropertiesTests
Bug: 140788621

(cherry picked from commit 06e9a4e01b)
Merged-In: I2d650129389e9567e4982b3a613fb8d1cbc97f4b
Change-Id: Ia03c2e6ab0ba0388ac729e5872795e25d06ee322
2020-02-12 12:28:48 +00:00
Automerger Merge Worker
f0b9f042de Merge "Add HomeVisibilityObserver APIs in ActivityManager." am: cb47d86158 am: c1363ad2b9
Change-Id: If7b65fd40532a8868463a5d545da5c197676ffe8
2020-02-11 21:34:57 +00:00
Automerger Merge Worker
c1363ad2b9 Merge "Add HomeVisibilityObserver APIs in ActivityManager." am: cb47d86158
Change-Id: Ib48d687e8da2941fa3385aa5066e4d490b1d3ad8
2020-02-11 21:10:48 +00:00
Xiangyu/Malcolm Chen
cb47d86158 Merge "Add HomeVisibilityObserver APIs in ActivityManager." 2020-02-11 21:00:16 +00:00
Automerger Merge Worker
4c0d1a02b6 Merge "Add TEST_MAPPING for gating and logging" am: 05fb4434f3 am: 5d3e5fb3b5
Change-Id: Ie1963bb7965827d9f9985b08c78e70b2de3319a7
2020-02-10 21:35:05 +00:00
Automerger Merge Worker
5d3e5fb3b5 Merge "Add TEST_MAPPING for gating and logging" am: 05fb4434f3
Change-Id: I701ef53dada696ee5f6e45d8539ca385a08ffc29
2020-02-10 21:24:31 +00:00
Treehugger Robot
05fb4434f3 Merge "Add TEST_MAPPING for gating and logging" 2020-02-10 21:12:10 +00:00
Andrei Onea
1a0195349b Add TEST_MAPPING for gating and logging
The tests included are unit tests for the implementation (under
FrameworksServicesTests), for the corresponding TestRule
(PlatformCompatGating) and CTS tests.

Bug: 137821288
Test: cd frameworks/base/core/java/android/app/compat && atest
Test: cd frameworks/base/services/core/java/com/android/server/compat \
          && atest
Change-Id: I1a652775715f1a9738cc72725303bc78dfa17d03
2020-02-10 18:25:06 +00:00
Automerger Merge Worker
912f8487d2 Merge "Clear callingId before binder calls in CompatChanges" am: 45d1f67bf6 am: 00f11fe5fd
Change-Id: I90fd68462e5967cfe7eef2c3b86dbec78a124f72
2020-02-10 16:35:29 +00:00
Automerger Merge Worker
00f11fe5fd Merge "Clear callingId before binder calls in CompatChanges" am: 45d1f67bf6
Change-Id: I803ed8ac7035295d819130d1b19c9585fe0edb65
2020-02-10 16:23:49 +00:00
Andrei-Valentin Onea
45d1f67bf6 Merge "Clear callingId before binder calls in CompatChanges" 2020-02-10 16:13:13 +00:00
Automerger Merge Worker
af5dbf486a Merge "Disabled some DEBUG constants." into qt-qpr1-dev am: e8d9d331ae
Change-Id: I7d4e49253b1ecd54dc8036e21e23e7392aa47602
2020-02-08 21:24:30 +00:00
Automerger Merge Worker
06dd4617c0 Merge changes from topic "lights-manager" am: 59401aab80 am: bd0f475895
Change-Id: I2f4ba72c3b56b5ae0f9ec82e368281734b9a9715
2020-02-08 01:53:41 +00:00
Automerger Merge Worker
bd0f475895 Merge changes from topic "lights-manager" am: 59401aab80
Change-Id: I9a45024b3cb557afd4fb09e69692f35c4372c928
2020-02-08 01:37:15 +00:00
Felipe Leme
85382ce4d2 Disabled some DEBUG constants.
Bug: 138939803
Bug: 142965266
Bug: 148457657

Test: echo 'in TH we trust!'

Change-Id: Ie3112fa1965d9b03bc142924ca17cf27dd6aa44d
(cherry picked from commit e966b8e76d26283163721620528eea0bfd77b43c)
2020-02-07 11:52:28 -08:00
Andrei Onea
01ba3215fa Clear callingId before binder calls in CompatChanges
Since this was already a recurring pattern when using PlatformCompat
directly, clear calling id before binder calls in CompatChanges.

Bug: 149091690
Test: atest CtsAppCompatHostTestCases
Change-Id: I4eec315eba14b840f9ef222b81b624d8e4f201eb
2020-02-07 19:19:20 +00:00
Ivailo Karamanolev
3e376b79ce Add LightsManager implementation to LightsService
Includes backend code to support LightsManager binder calls and route
them to the HALs.

Bug: 144979010
Bug: 144978691
Bug: 142715294
Change-Id: I0080972620ba7a3fb1197cdd0288287d3cfa8780
Fix: 142230898
Test: atest LightsManagerTest
Test: atest LightsServiceTest
Merged-In: I2db7f2caa432cd1e2389ea5ca6544200ada18675
2020-02-07 02:11:18 +01:00
Automerger Merge Worker
f1f1b1402a Merge "Add CompatChanges API." am: 54036c0525 am: 9f9657ee5e
Change-Id: Ief0b05e44e55c562df4dd616ba9ffdc534463468
2020-02-06 17:55:28 +00:00