Commit Graph

16571 Commits

Author SHA1 Message Date
Jiakai Zhang
405fb6dee9 Prefetch standalone system server jars before switching domain.
In b/203198541, we start to compile standalone system server jars, but
the SELinux policy doesn't allow system_server to load the compiled code
at runtime. As a solution, this change creates class loaders for
standalone system server jars and caches them before switching to the
"system_server" SELinux domain, which essentially loads the jars and
compiled code into the memory.

Bug: 203198541
Test: manual -
  1. Patch aosp/1874113, aosp/1876173, aosp/1906158 (in order to have
     odrefresh compile a standalone system server jar).
  2. Build a system image and flash it to a device.
  3. Run "adb shell cat /proc/`adb shell pidof system_server`/maps" and
     see "apex@com.android.wifi@javalib@service-wifi.jar@classes.odex"
     being mmap'ed.
  4. Run "adb logcat | grep avc" and see no denial.
  5. atest odsign_e2e_tests

Change-Id: I27fbdaadae2b6f50989b4c534f7fbc80044a6685
Merged-In: I365be766cfb77c6e240d5871f1b3d8ed7abae6f5
(cherry picked from commit 281a2dfaa1)
2021-12-08 09:47:38 +00:00
Andrei Onea
95ecac506d Allow privapp permission allowlist in apex
Read priv-app permission allowlists from APEX file and warn if
they're in the /system partition instead.

Test: boots
Bug: 190375768
Change-Id: I37d6deb60f0dffb75dd634075cd95bcf7ddf9684
Merged-In: I37d6deb60f0dffb75dd634075cd95bcf7ddf9684
2021-12-03 18:19:00 +00:00
Treehugger Robot
faf1b1cf0b Merge "Fix an issue when empty the usap pool." 2021-11-29 07:46:36 +00:00
zhangjianqiu
1bc2b9c612 Fix an issue when empty the usap pool.
When empty the usap pool, the usap processes may be blocked by
usapPoolSocket.accept(), which cause the usap process fail to kill
immediately. So we can move the position of blockSigTerm after
usapPoolsSocket.accept() and delele the old blockSigTerm in the while
loop.

Test: manual test.
1.setprop persist.device_config.runtime_native.usap_pool_enabled true.
After 1 min, trigger fill usap pools.
2.setprop persist.device_config.runtime_native.usap_pool_enabled false.
After 1 min, trigger empty usap pools.
3.repeat step 1.

Signed-off-by: zhangjianqiu <zhangjianqiu@oppo.com>
Change-Id: I657940b30f71cdc717c673be6d70738e61e2bb68
2021-11-24 09:48:01 +08:00
Treehugger Robot
8cb6d28329 Merge "Framework and system_server classes can access public vendor libraries" 2021-11-19 00:08:57 +00:00
Jiyong Park
24c57c33ea Framework and system_server classes can access public vendor libraries
This CL fixes a regression caused by [1] which introduced
<uses-native-library> tag [2]. With the change, public vendor libraries
[3] became accessible only when they are listed in the caller's
AndroidManifest.xml using the new tag. However, this caused a problem to
the places where AndroidManifest.xml doesn't exist: framework and
system_server classes. For those cases, [1] incorrectly used a null list
as the requested native libraries, and as a result, no public vendor
libraries were accessible.

This CL fixes the issue by not doing the filtering for the class loaders
created for non-app contexts like zygote or system_server. Specifically,
it uses the magic keyword "ALL" which let libnativeloader.so
accept all public vendor libraries.

[1] 6a5b8b1f6d
[2] https://developer.android.com/guide/topics/manifest/uses-native-library-element
[3] https://source.android.com/devices/tech/config/namespaces_libraries#adding-additional-native-libraries

Bug: 205164833
Test: libcuttlefish_fs.so is loaded when built with the other CLs in the
same topic

Change-Id: Id92c59642773851d70d05a05f43eb5873e9de86b
2021-11-18 23:09:27 +09:00
Maciej Żenczykowski
7069443319 switch to using OWNERS from master branch of Connectivity module
Test: N/A
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ifa4a38522ac3aa830e2a7f8b23ad190a334458bc
2021-11-17 00:37:40 -08:00
Treehugger Robot
b2f814064e Merge "Fix typo in BaseIWindow.java owners file" 2021-11-16 17:57:38 +00:00
Vishnu Nair
8cd9256c50 Fix typo in BaseIWindow.java owners file
Change-Id: I7ea7fb4a9fc16aa007e4a6970d550f906da202f7
2021-11-15 23:38:05 +00:00
Maciej Żenczykowski
cb6164c141 remove PROP_QTAGUID_ENABLED
Remaining hits:
  $ repo grep 'net.qtaguid_enabled|PROP_QTAGUID_ENABLED' | egrep -v '^external/cpuinfo/test/mock/'
  art/Binary file tools/ahat/etc/L.hprof matches
  cts/Binary file tools/release-parser/tests/resources/boot-framework.art matches
  external/cpuinfo/test/dmesg/oppo-r9.log:2212:<14>[   12.785966] (6)[1:init]init: [PropSet]: pid:887 uid:1000 gid:1000 set net.qtaguid_enabled=1
  prebuilts/runtime/appcompat/hiddenapi-flags.csv:412141:Lcom/android/server/NetworkManagementSocketTagger;->PROP_QTAGUID_ENABLED:Ljava/lang/String;,blocked

Bug: 161325508
Test: atest, TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ifa30a7549396312a970fc07c37e8fa8ed85abec0
2021-11-10 15:52:30 -08:00
satayev
73c5df816c Update compat owners.
Bug: N/A
Test: N/A
Change-Id: I548b7310c7b77fbcdf3c6f7d85bde8d0129cf460
2021-11-10 15:35:30 +00:00
kwekua
5aacac2a71 Create dedicated long variables.
Bug: 194532703
Bug: 204459169
Change-Id: Ic4c57d3797b19869e5c9151ccb183543ba5f6df0
2021-10-28 19:33:25 +00:00
Brad Stenning
89dfd0902e Allow a shared library to be positioned after the application on the classpath
This is useful if/when it's desired that an application contains the same
fully qualified class name that's also in the library.

The shared libraries that are treated in this manor are controlled by the resource
com.android.internal.R.config_shared_libraries_loaded_after_app

Bug: 179429740

Test: atest SharedLibraryLoadingTests

Change-Id: Ia37ff9bd545918d1e0f1f38548dcd86f177559d5
2021-10-27 10:06:16 -07:00
Daniel Norman
653a1c1a28 Fix RRO loading from inside APEXes.
APEXes can already contain RRO APKs by using the 'rro' apex Soong
module field. However, these RROs were not being loaded properly by
Zygote or PackageManagerService.

For all RROs inside APEXes, the RRO uses the same overlay config that
is used for other RROs on the APEX's preinstalled partition.

For RROs targeting 'android', which are installed by Zygote
using AssetManager:
1. OverlayConfig looks for active APEXes in the apex-info-list file,
   which is already accessible to Zygote.
2. OverlayConfig passes the APEX module names to OverlayConfigParser,
   for each preinstalled-partition.
3. OverlayConfigParser uses OverlayScanner to scan the
   each /apex/<APEX>/overlay directory.

For other RROs:
1. PackageManagerService already parses and provides RROs inside APEXes
   to OverlayConfig.
2. RROs inside APEXes used to have no config rule applied because their
   path prefix (/apex/) did not match any partition rule. Now, their
   preinstalled path is used instead.

Bug: 199200417
Test: Define a static RRO targeting 'android' inside a /vendor APEX.
      Define a static RRO for settings provider inside a /vendor APEX.
      Observe APEXes are enabled by default.
Test: Make a change to an RRO inside a /vendor APEX.
      m <apex>; adb install <apex artifact>; adb reboot;
      Observe change has taken effect.
Change-Id: I2bce9bc704789329b8c6aac6d476f17ff6718e0f
Merged-In: I2bce9bc704789329b8c6aac6d476f17ff6718e0f
2021-10-25 13:04:24 -07:00
Etienne Ruffieux
d372361fe3 Adding @SystemApi annotation to Bluetooth energy stats.
Added @SystemApi annotation to BluetoothActivityEnergyInfo
and UidTraffic getters for mainline compatibility. Replaced
raw array by List. Deleted unused constructors.

Tag: #feature
Bug: 200201373
Test: Manual
Change-Id: Id93215f48bf08d31ac269af9e064cf598f50b6d3
2021-10-21 20:39:31 +00:00
Xin Li
8891d70334 Merge SP1A.210812.016
Merged-In: I8b62b9b9d7ae271bc623764d545db1320b4dc64f
Change-Id: I458ed7f2eb8603f5e89c1d73bc0f0d52b826973e
2021-09-28 19:26:36 +00:00
Dmitri Plotnikov
cc225325e3 Merge "Add OWNERS for BatteryStats related files" am: a84bdc93a8
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1822145

Change-Id: If3cc87baf6a2249634e3f35ea8683177d9ace1c9
2021-09-10 18:20:32 +00:00
Dmitri Plotnikov
9fca835a97 Add OWNERS for BatteryStats related files
Test: N/A

Change-Id: I6b17062eaf538849389528619067504f18e7b2ab
2021-09-09 18:24:17 -07:00
Hall Liu
f4fe3ac665 Update and expose ModemActivityInfo
Update ModemActivityInfo to present a nicer API surface and expose it as
a SystemApi. Also change clients in BatteryStats to match the new
surface.

This is part 1. Part 2 will modify the methods in TelephonyManager to
use a more up-to-standards threading model.

Bug: 170427831
Test: atest ModemActivityInfoTest
Change-Id: I762ed949342861c75d94eafce88335e7bd8c9139
Merged-In: I762ed949342861c75d94eafce88335e7bd8c9139
2021-09-07 11:40:55 -07:00
Treehugger Robot
0fa9d2ef6b Merge "Add suppressLintAnnotation on state.java" 2021-09-07 15:51:39 +00:00
wescande
4d65834880 Add suppressLintAnnotation on state.java
Test: Build
Merged-In: I02aa127e8e07f239561f4f2a3bbdfc6fccb82f7f
Change-Id: I5a22ebe6473fbf38494e20d629e763c331b1e1e6
2021-09-07 16:43:09 +02:00
Treehugger Robot
26531301a0 Merge "create library for mainline module" am: c59870928e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1818896

Change-Id: I048c27593314c00706f29db19b6d20ed4b899ae2
2021-09-07 14:00:18 +00:00
William Escande
a6fb9459cc create library for mainline module
This library is a temporary work to link all mainline module using
statemachine.
Once this is done, we will be able to move the library to
frameworks/libs/modules-utils

also fix some typo in state* files

Bug: 198418216
Tag: #refactor
Test: None
Change-Id: I1bec7c7bdb25bf3397a742a356aa1f18fddf7d89
2021-09-06 15:28:09 +00:00
Daniel Norman
2b3dbdd95b Merge "Allow APEXes permission XMLs to declare features." am: ada5fb65b5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1810683

Change-Id: I2385e0b45e15f204382ec5eeee24ce3d62b17064
2021-08-30 19:11:58 +00:00
Daniel Norman
ada5fb65b5 Merge "Allow APEXes permission XMLs to declare features." 2021-08-30 19:09:21 +00:00
Daniel Norman
5f0797723c Allow APEXes permission XMLs to declare features.
This allows APEXes to include permission XMLs like the NFC XMLs in
frameworks/native/data/etc which declare NFC features.

(This also enables `unavailable-feature` declarations.)

Bug: 197680726
Test: Include an NFC permission XML in an APEX.
      Observe feature is set correctly in logs and by
      enabling NFC in Settings app.
Change-Id: Ied425b8897ab80df250d42cfbf0525634ed948aa
2021-08-26 11:57:23 -07:00
Orion Hodson
b55a7938a6 Merge "Drop system_server dexopt in ZygoteInit" am: 5e1c9fe7fc
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1806016

Change-Id: Icf16da811d100df9dcc6c91a2fa9b2e4a76f9654
2021-08-26 14:51:20 +00:00
Orion Hodson
5e1c9fe7fc Merge "Drop system_server dexopt in ZygoteInit" 2021-08-26 14:35:24 +00:00
Jooyung Han
7c15aa4254 Merge "telephony: suppress warnings in AIDL" am: 6dff9dce0f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1808127

Change-Id: I26c3e6899c9126f54e8914997f347ebb34654ef6
2021-08-26 00:15:42 +00:00
Jooyung Han
e53a76adec telephony: suppress warnings in AIDL
This was missed in 133879b683.

Emergency number list is internally represented as Map<Integer,
List<EmergencyNumber>>, which is not supported by AIDL.

Bug: 192615532
Test: m
Change-Id: I5dc8b0f94b13b6625bb31933c6488dc87c9db713
2021-08-25 15:17:56 +09:00
Pavan Kumar M
ec46a0c994 ims: Version support for uce feature tags
Add version support for uce feature tags

Bug: 175092320
Bug: 193992611
Bug: 193543670
Change-Id: I8b62b9b9d7ae271bc623764d545db1320b4dc64f
(cherry picked from commit 6624e2aa57)
2021-08-24 18:43:31 +00:00
Jeff DeCew
bce9262c0d Merge "Add notifications team as OWNERS of notification-related utilities and their tests" am: 39366563d3
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1796768

Change-Id: I6bd3759e5e7e37aaa1a2dbcda3b0ecba073a67a0
2021-08-24 17:13:15 +00:00
Orion Hodson
c3e8e916eb Drop system_server dexopt in ZygoteInit
system_server artifacts should be present in the system image or
generated by on-device signing.

Bug: 187711479
Fix: 163019104
Test: m & boot
Change-Id: I19094e1a60b903d04cf7ba23e65cc9ef10f7f243
2021-08-23 10:52:41 +01:00
Jeff DeCew
1cbc573b93 Add notifications team as OWNERS of notification-related utilities and their tests
Change-Id: I153ab4e182a0843706c25f03c891a92eb48eea9c
2021-08-16 14:56:48 +00:00
Xin Li
773a9dfba7 Merge sc-dev-plus-aosp-without-vendor@7634622
Merged-In: I661f5fb6b1f3f6ce4322fab8fa84a7ab364c65b1
Change-Id: I16482b494ff4821016aabbb646e495d616c630ac
2021-08-14 07:23:27 +00:00
Nate Myren
9d1a9399b8 Merge "Add attribution info to start callbacks" into sc-dev am: 5d97f29218
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15446590

Change-Id: I42bdf188ec74c9d3a7179f717a08c7fec7f33833
2021-08-03 20:06:34 +00:00
Nate Myren
06d07d54db Add attribution info to start callbacks
Add attribution flags and chain IDs to start callbacks, and have the
PermissionUsageHelper listen for starts. This ensures that, if another
start happens while an op is already running, and has chain information,
then this chain information will be recorded.

Test: manual
Bug: 194198234
Change-Id: I0ab1aa0969b70e18001f4a814ea5689f9329a019
2021-08-03 08:25:31 -07:00
Li Li
f97b1decee Merge "Freezer: fix exception when parsing /proc/locks" into sc-dev am: ef12967b75
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15395534

Change-Id: I997b46822bd83f9c9f7dc6a02e9514a95b3758a1
2021-07-30 16:49:33 +00:00
Li Li
ef12967b75 Merge "Freezer: fix exception when parsing /proc/locks" into sc-dev 2021-07-30 16:35:16 +00:00
lucaslin
4396c1b244 Fix Ikev2 vpn cannot establish through startLegacyVpn()
Settings will also call startLegacyVpn() to bring up Ikev2 VPN,
so it's needed to add a vpn type check in startLegacyVpn().
Otherwise, UnsupportedOperationException will be thrown when
Settings tries to bring up Ikev2 VPN.

Bug: 191937302
Bug: 188749090
Bug: 189808606
Test: 1. make gts && gts-tradefed
      2. run gts --module GtsNetworkStackHostTestCases
Change-Id: I752c39bd1bf953a11bdf62e6f02f99f48fef23c4
Merged-In: I752c39bd1bf953a11bdf62e6f02f99f48fef23c4
2021-07-30 06:25:21 +00:00
Li Li
bbe06e7b59 Freezer: fix exception when parsing /proc/locks
The original code is based on /proc/locks manpage. Unfortunately, that
manpage is never correctly updated to include the new field for blocked
locks. The new code detects the extra field. As StringTokenizer is too
heavy, ProcFileReader is used for better performance.

Bug: 194756340
Test: FrameworksUtilTests com.android.internal.util.ProcFileReaderTest
Test: FrameworksCoreTests com.android.internal.os.ProcLocksReaderTest
Test: No /proc/locks parsing exception with blocked locks
Change-Id: I4c9763f9d3091f7d84d2e4b672d7e5cb78b33f59
2021-07-29 09:18:53 -07:00
Daniel Solomon
ae50161de8 Merge "Revert "SCREEN_BRIGHTNESS - map 255 to current max"" into sc-dev am: d5e1458566
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15404418

Change-Id: I7782fd8704f1b7c2444b6630ce001875b19d6931
2021-07-28 17:58:09 +00:00
Daniel Solomon
d5e1458566 Merge "Revert "SCREEN_BRIGHTNESS - map 255 to current max"" into sc-dev 2021-07-28 17:42:43 +00:00
Daniel Solomon
792229b553 Revert "SCREEN_BRIGHTNESS - map 255 to current max"
This reverts commit 002e656a51.

Reason for revert: Setting brightness using adb (adb shell settings put system screen_brightness ...) results in different brightness being set by DisplayPowerController each time.

Bug: 194791517
Test: atest HighBrightnessModeControllerTest
Test: manually test `settings put system screen_brightness 23` yields
      consistent results
Change-Id: I6b49253b46e4d09a1f4129d3df950c9d36eb6ede
2021-07-28 17:17:15 +00:00
Hai Zhang
831f5db04f Merge "Only construct real Throwable objects in AndroidFuture.readThrowable()." into sc-dev am: af04dd2ad5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15302018

Change-Id: I2afc85c266bebcb88848c57a094ed0af757b277e
2021-07-28 01:41:05 +00:00
Hai Zhang
af04dd2ad5 Merge "Only construct real Throwable objects in AndroidFuture.readThrowable()." into sc-dev 2021-07-28 01:23:12 +00:00
Siim Sammul
b77fb08506 Merge "Do not make a getThreadTimeMicro() call when it is not needed. This was accidentally changed with https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15080830" into sc-dev am: 6c852aeabc
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15346904

Change-Id: I73089da899cfe25a90f5d52d894ab3ba0291ef1b
2021-07-26 09:25:51 +00:00
Siim Sammul
6c852aeabc Merge "Do not make a getThreadTimeMicro() call when it is not needed. This was accidentally changed with https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15080830" into sc-dev 2021-07-26 09:14:43 +00:00
Alison Cichowlas
fa25c27e48 Merge "Sharesheet: remove 2 separators, restyle the 3rd." into sc-dev am: 832779a555
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15377016

Change-Id: I0c1df12a77fdfafe0ab87d28400a77c84b42ceb6
2021-07-24 06:06:52 +00:00
Alison Cichowlas
832779a555 Merge "Sharesheet: remove 2 separators, restyle the 3rd." into sc-dev 2021-07-24 05:53:04 +00:00