Commit Graph

16229 Commits

Author SHA1 Message Date
Lucas Lin
4db4933c81 Merge "Add some comments in isAlwaysOnVpnLockdownEnabled" 2020-03-16 10:08:51 +00:00
Junyu Lai
240f5bb4e9 Merge "[SP21] Address comments for API council review about aosp/1172143" 2020-03-16 02:41:19 +00:00
lucaslin
86e560c749 Add some comments in isAlwaysOnVpnLockdownEnabled
Bug: 141621373
Test: Build pass.
Change-Id: Ib9df71192937164ff95ce564195d5d68508ec69d
2020-03-16 09:40:01 +08:00
Treehugger Robot
9a3446e067 Merge "Add @RequiresPemission compat framework APIs." 2020-03-13 19:10:21 +00:00
junyulai
393e10d4cd [SP21] Address comments for API council review about aosp/1172143
Test: atest FrameworksNetTests ImsPhoneCallTrackerTest
Test: atest TetheringTests NetworkStackTests
Test: m doc-comment-check-docs
Fix: 148552904

Change-Id: I141393f229e772d2eb9f7c156849e379bd71b845
2020-03-12 21:34:17 +08:00
Junyu Lai
0fa3b9e2e4 Merge changes from topic "sp20-stats-provider-permission"
* changes:
  [SP20] Check signature permission when accessing network stats provider
  Add permission check functions to NetworkStatsService
2020-03-12 08:19:24 +00:00
sqian
a14185aad4 Add updateMccMncConfiguration as @TestApi for CTS
Test: cts; https://paste.googleplex.com/5930499648258048
Bug: 147897445
Change-Id: I63288be1acd9e898548ced345799ac1ae69ce427
Merged-In: I63288be1acd9e898548ced345799ac1ae69ce427
(cherry picked from commit 3d873cf7d0)
2020-03-10 22:57:43 +00:00
sqian
9799e6e810 Introduce system API for ActivityManager.updateMccMncConfiguration for Mainline
Test: treehugger
Bug: 147381728
Bug: 138545688
Change-Id: Ieef1dbbab3b05fc166c3dbc53ed2507ef45d09d7
Merged-In: Ieef1dbbab3b05fc166c3dbc53ed2507ef45d09d7
(cherry picked from commit b9c9bfa6e8)
2020-03-10 21:29:32 +00:00
Bill Yi
020c84a136 Merge stage-aosp-master to aosp-master - DO NOT MERGE
Change-Id: I352ed2cba25df69594ee5861f3a64be63bc18c96
2020-03-05 10:20:17 -08:00
Neil Fuller
86fd801bff Merge "Add command line support for testing tz detection" 2020-03-05 18:07:24 +00:00
Automerger Merge Worker
627bfca085 Merge "Start process of next activity with top priority in advance" am: efbcd6752d
Change-Id: I8e8dd0f20cd3a783e49468a7657e571812bca3eb
2020-03-04 23:54:10 +00:00
Treehugger Robot
efbcd6752d Merge "Start process of next activity with top priority in advance" 2020-03-04 23:41:40 +00:00
Riddle Hsu
364f2500e5 Start process of next activity with top priority in advance
In common cases, to resume the next activity we need to wait for the
current one to be paused. Since starting a process for activity is
asynchronous, if we already know the process of next activity has not
started yet, we can start the process earlier so the time waiting for
the pause to complete can be saved.

Also if the launching activity is going to be the top app, we can set
the top schedule group right after its process is started so the start
time before actually launching the activity can be improved.

Although before the current activity is paused, the next top activity
may still change and results some empty processes. That should not be
a common case and the process is still useful when going back the stack,
and the empty background processes are easier to be reclaimed.

Bug: 123043091
Test: AppLaunchTest
Test: Launch calculator from launcher, the event log am_proc_start will
      show "pre-top-activity".
Test: Cold launch a top activity, the system log should not show
      "not expected top priority".
Test: Use startActivities to start serveral activities in a sequence.
      Check "adb shell cat /proc/$pid/task/$pid/cgroup" for each process.
      Only the last one has top-app, others are background.

Change-Id: I9601b66e7cc0855fd7c2b573ded31fcf8d0711ae
Merged-In: I9601b66e7cc0855fd7c2b573ded31fcf8d0711ae
2020-03-03 16:36:46 -08:00
Automerger Merge Worker
f6cdbeb470 Merge "Make MmsManager public and @SystemService" am: 01574a30ea
Change-Id: I6978fb1377f76308732fb241f04adcef82087b7f
2020-03-03 21:22:33 +00:00
Sarah Chin
01574a30ea Merge "Make MmsManager public and @SystemService" 2020-03-03 21:17:11 +00:00
Automerger Merge Worker
f1124753ed Merge "[API Review] Expose sendOrderedBroadcast" am: b0157c3ee3
Change-Id: I686308c2af6e31a30c211d25adea416d556e5cd1
2020-03-02 21:59:55 +00:00
atrost
e8e97c0aab Add @RequiresPemission compat framework APIs.
The permission check is already implemented server side.

Test: m
Bug: 150471082
Change-Id: I63d807be84bccb237f69562cdbce22f99a964d1a
Merged-In: I63d807be84bccb237f69562cdbce22f99a964d1a
2020-03-02 13:30:44 +00:00
Peter Wang
3e227cdfc5 [API Review] Expose sendOrderedBroadcast
with appOp as String and options as Bundle

Bug: 139077993
Bug: 146423958
Test: Build
Change-Id: I5325e08d60016741139251813a5df9b42f2efc82
Merged-In: I5325e08d60016741139251813a5df9b42f2efc82
2020-02-27 14:45:23 -08:00
Neil Fuller
4879487862 Add command line support for testing tz detection
Add support for "adb shell cmd time_zone_detector".

This allows platform developers and future host tests to simulate
clients like telephony / SettingsUI and make changes to the
TimeZoneDetectorService state to mimic various real-world situations.

Example adb shell invocations:

Withdraw a previous telephony suggestion from slot_index=0:

cmd time_zone_detector suggestTelephonyTimeZone --suggestion --slot_index 0 \
    --zone_id "_"

Make a new telephony suggestion from slot_index=0, with a quality of
TelephonyTimeZoneSuggestion.QUALITY_SINGLE_ZONE, and a matchType of
TelephonyTimeZoneSuggestion.MATCH_TYPE_NETWORK_COUNTRY_ONLY:

cmd time_zone_detector suggestTelephonyTimeZone --suggestion --slot_index 0 \
    --zone_id "Europe/London" --quality single --match_type country

Make a manual (user) suggestion as if from SettingsUI:

cmd time_zone_detector suggestManualTimeZone --suggestion --zone_id America/Los_Angeles

Bug: 140712361
Test: Various command line invocations.
Test: atest core/tests/coretests/src/android/app/timezonedetector
Change-Id: I0f16868a526d2ea4b17acbd274cb2359f93166f5
2020-02-25 17:57:42 +00:00
junyulai
ddbbe58863 [SP20] Check signature permission when accessing network stats provider
Currently, registerNetworkStatsProvider requires the
UPDATE_DEVICE_STATS permission. This is a privileged permission
so it can be granted to preinstalled apps. Thus, apps like
GmsCore, or preinstalled apps will be able to update network stats.

This change checks for a new permission that would only allow
signature apps to declare that. Also check
MAINLINE_NETWORK_STACK permission to allow NetworkStack process
to use it.

Test: adb shell dumpsys netstats
Test: atest FrameworksNetTests
Bug: 149652079
Change-Id: Idfebd0a1988c3dcfd812d87e30f6a2034d6fbf6b
2020-02-24 20:22:48 +08: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
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
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
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
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
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
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
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
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
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
00f11fe5fd Merge "Clear callingId before binder calls in CompatChanges" am: 45d1f67bf6
Change-Id: I803ed8ac7035295d819130d1b19c9585fe0edb65
2020-02-10 16:23:49 +00:00