Commit Graph

17888 Commits

Author SHA1 Message Date
Songchun Fan
5e303008b4 Merge "[pm] new APIs for ApplictaionInfo/PackageInfo/ComponentInfo/ResolveInfo flags" 2021-12-10 16:08:09 +00:00
Miranda Kephart
e3c03312e4 Merge "Update sharesheet for large devices" 2021-12-10 03:17:41 +00:00
Miranda Kephart
140166fd73 Update sharesheet for large devices
Switches to a wrapped sharesheet (instead of filling the screen)
and 6 columns instead of 8 for large screens. Also fixes some
small details with the appearance (see
https://docs.google.com/presentation/d/1WDbmWx6uXaFi8jos7Sp6ZUmBh24Y5Bj5G7dW78LxE40/edit#slide=id.gb836e06a0c_0_0)

Bug: 195102471
Test: manual (visual changes)
Change-Id: I5d84dce0aea7657a50dc3376be9d8b5e41b907db
2021-12-09 15:45:45 +00:00
Joshua Trask
06f9cccecf Merge "Query "post" targets only when rebuild complete." 2021-12-08 20:38:15 +00:00
Dmitri Plotnikov
5ffeb52135 Merge "Run per procstate CPU time-in-state tracking on the main thread" 2021-12-08 18:05:36 +00:00
Joshua Trask
dad1cd6fdf Query "post" targets only when rebuild complete.
When we perform our initial query and then kick off an
async sorting task, we predictably see two list-ready
callbacks, both with doPostProcessing=true, first with
rebuildCompleted=false, then true. If we perform the
post-processing step both times, we'll double-log events,
double-query app prediction, etc. This is described in
more detail in b/209018315.

In this CL, we specifically ensure that the logging & APS
query only occur when the async rebuild is complete. This
is the minimal change to address the duplication while
restoring the general conditions of how this flow worked
prior to the introduction of the async step. In subsequent
CLs, there's room to optimize this flow or polish other
bugs that may have been introduced along with the async
step; for more discussion see the comments on this CL.

Note that we still have some disabled logging tests that
were supposed to assert the correct flow step-by-step,
but that regressed over time. Those tests will be
re-enabled in a subsequent CL, where we'll presumably need
to update the assertions to match the current flow.

Test: manual + `atest ChooserActivityTest`
Bug: 209018315
Change-Id: Ie1b786c46b4204ede26ab1face3f040dad77d26e
2021-12-08 11:54:00 -05:00
Dmitri Plotnikov
3818a53e7e Run per procstate CPU time-in-state tracking on the main thread
Procstate tracking will now be enabled unconditionally
when eBPF is supported by the kernel. Otherwise, it will be disabled.

Bug: 197162116
Test: atest FrameworksCoreTests:BatteryStatsTests

Change-Id: I200ef51b92aa19d42a10966aa6fea6f99d741f3f
2021-12-07 19:09:05 -08:00
Rhed Jao
2f653107cc Ignore prebuilt shared library if it doesn't exist on device
Bug: 191232777
Test: atest PackageManagerTest
Test: atest SystemConfigTest
Change-Id: I756e2c909af6ad0dcf8f1857ba398cfe07862b29
2021-12-07 20:37:53 +08:00
Chris Li
22d2a97dd8 Merge "Use the current dimensions instead of relying on onConfigurationChanged" into sc-v2-dev am: fb1aca8138 am: af34c807e4
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16361589

Change-Id: Ie360ad800a938660632ca7d7f0b29d9c3b29ad17
2021-12-07 06:23:32 +00:00
Chris Li
af34c807e4 Merge "Use the current dimensions instead of relying on onConfigurationChanged" into sc-v2-dev am: fb1aca8138
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16361589

Change-Id: I14b5a046c0c784f8e8b34267487fca0810faa5d0
2021-12-07 06:08:53 +00:00
Ioannis Ilkos
fce46978ff Merge "Read per-process GPU memory when pulling ProcessMemorySnapshot" 2021-12-06 21:13:03 +00:00
TreeHugger Robot
1934e69afb Merge "Prefetch standalone system server jars before switching domain." 2021-12-03 22:10:37 +00:00
Songchun Fan
cf3f673b48 [pm] new APIs for ApplictaionInfo/PackageInfo/ComponentInfo/ResolveInfo flags
We are running out of int flags for public API methods such as
PackageManager.getPackageInfo(String packageName, int flags). As a
solution, we will change the flags param to Flags objects. At the
same time, we deprecate the old methods that directly use int flags.

The new flags classes are: ApplicationInfoFlags, PackageInfoFlags,
ComponentInfoFlags and ResolveInfoFlags. Because there are already
annotations of the same names, we renamed the annotations to *FlagsBits.

Old API usage example:
getPackageInfo(pkgName, MATCH_UNINSTALLED_PACKAGES)

New API usage example:
getPackageInfo(pkgName, PackageInfoFlags.of(MATCH_UNINSTALLED_PACKAGES))

See b/204433742 for discussions.

CTS-Coverage-Bug: 206147270
BUG: 204432643
BUG: 204433659
Test: manual
Change-Id: I8ab2adad6907670c5879c043d170c950afefe46c
2021-12-02 15:35:51 -08:00
Dmitri Plotnikov
690f06ab1e Merge "Fix IndexOutOfBounds exception in dumpsys batterystats" 2021-12-02 21:48:14 +00:00
Dmitri Plotnikov
11f8f5267b Fix IndexOutOfBounds exception in dumpsys batterystats
Also, fix NPE caused by PowerProfile not being set on
BatteryStats during `dumpsys batterystats --checkout`

Bug: 208701409
Test: dumpsys batterystats --checkout
Change-Id: I2ec914610f9d61567eba8d4ff53e384f8390ceaa
2021-12-01 18:21:08 -08:00
Andrei-Valentin Onea
7c19895276 Merge "Allow privapp permission allowlist in apex" 2021-12-01 16:18:43 +00:00
TreeHugger Robot
99d84d42cd Merge "Add IMM#invalidateInput()" 2021-12-01 16:18:05 +00:00
Jiakai Zhang
281a2dfaa1 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: I365be766cfb77c6e240d5871f1b3d8ed7abae6f5
2021-12-01 13:54:30 +00:00
Dmitri Plotnikov
fd79667461 Merge "Drop TAG_FIRST_OCCURRENCE_FLAG when populating history tag array" 2021-11-30 19:34:30 +00:00
Ioannis Ilkos
cc793ab608 Read per-process GPU memory when pulling ProcessMemorySnapshot
This is an eBPF usermap read via libmeminfo. System server
already has permissions to do so (as it already does so for the
total GPU mem stats).

Change-Id: I9e3c4dc9144708c630215e309b7ff394abbdcd76
Test: manual, statsd_testdrive 10064
Bug: 208440056
2021-11-30 17:24:48 +00:00
Evan Severson
e068cd5544 Merge "Implement Task Manager UI" 2021-11-30 12:27:04 +00:00
Chris Li
e40ee51d37 Use the current dimensions instead of relying on onConfigurationChanged
There are some cases when the View will not receive
onConfigurationChanged event (such as DialogFragment). Always use the
current dimensions instead.

Fix: 205251075
Test: test with Settings app
Change-Id: If626fe597c02efcb480c05ca88cffbfae1b21a89
2021-11-30 17:39:00 +08:00
Dmitri Plotnikov
8af4657207 Drop TAG_FIRST_OCCURRENCE_FLAG when populating history tag array
When there are more than MAX_HISTORY_BUFFER of history events,
we store the history buffer and create a new one.  At that point,
we set the TAG_FIRST_OCCURRENCE_FLAG flag on all pre-existing indexes
in the history tag pool to indicate that those tags have not yet
occurred in the current history buffer and therefore would still
need to be written into the buffer if they occur in the future.
As a result, we end up with some indexes in the history tag pool
having the TAG_FIRST_OCCURRENCE_FLAG set.  We need to reset this flag
when adding tags to mHistoryTags in order to restore the natural
sequence of indexes.

Bug: 206823946
Test: atest CtsDumpsysHostTestCases:BatteryStatsDumpsysTest
Change-Id: I3affd09ea45accf3ac8706bd8114d0d7ca385a69
2021-11-29 18:13:22 -08:00
Evan Severson
1f6bb02a63 Implement Task Manager UI
This adds the dialog and a quicksettings tile entrypoint to show the
user apps which have foreground services running.

TODOs: Use security footer instead of quicksettings tile
       Implement the missing UX of the stopped FGS
       Tests

Test: atest SysetmUITests
Bug: 201579707

Change-Id: I2185a22b789404b97e98a16c11c0a296159ddd89
2021-11-29 17:39:40 -08:00
TreeHugger Robot
7a3825459d Merge "Adds the basic API of the attestation verification framework." 2021-11-29 23:15:34 +00:00
Dmitri Plotnikov
ae0596ccb0 Merge "Fix NPE caused by a null battery history tag" 2021-11-29 21:02:00 +00:00
Dave McCloskey
b9b25ef742 Adds the basic API of the attestation verification framework.
Bug: 201696614
Change-Id: I59d90091106db6e6343f3a6fb698f01559841137
Test: N/A (non-functional API definition)
CTS-Coverage-Bug: 201337503
2021-11-29 10:08:41 -08:00
Dmitri Plotnikov
b6d0af354b Fix NPE caused by a null battery history tag
Bug: 206823946
Test: atest CtsDumpsysHostTestCases:BatteryStatsDumpsysTest
Change-Id: I7a5d70137608bf80ec8a0ca4ee161a42a0d96f95
2021-11-29 09:56:06 -08:00
Treehugger Robot
250c59b35f Merge "Fix an issue when empty the usap pool." am: faf1b1cf0b am: 9078248b75 am: 80f41edf05 am: 81dd7537eb
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1893002

Change-Id: Ib59b0793f1bbcbb1a39ae15417598161550c95ff
2021-11-29 08:42:59 +00:00
Treehugger Robot
81dd7537eb Merge "Fix an issue when empty the usap pool." am: faf1b1cf0b am: 9078248b75 am: 80f41edf05
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1893002

Change-Id: Idbaa45d4871c7e6c1e15d7af4fb432a2b24a49cf
2021-11-29 08:28:34 +00:00
Treehugger Robot
80f41edf05 Merge "Fix an issue when empty the usap pool." am: faf1b1cf0b am: 9078248b75
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1893002

Change-Id: Id444bd4f7b15a985fa026bde136a15c0efab7d38
2021-11-29 08:14:54 +00:00
Treehugger Robot
9078248b75 Merge "Fix an issue when empty the usap pool." am: faf1b1cf0b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1893002

Change-Id: I6d5e04471f756ee5544bb1f77cf1927f44d7715a
2021-11-29 08:00:57 +00:00
Treehugger Robot
faf1b1cf0b Merge "Fix an issue when empty the usap pool." 2021-11-29 07:46:36 +00:00
Adam Bookatz
67639c67e1 Merge "UM.canAddMoreUsers(userType)" 2021-11-24 18:51:14 +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
Adam Bookatz
ac0a1235ee UM.canAddMoreUsers(userType)
Introduces an API for whether more users can be added of the given user
type.

Bug: 192577100
Bug: 175795666
Bug: 189937255
Bug: 205100630
Test: atest com.android.server.pm.UserManagerTest#testAddTooManyUsers
Change-Id: I1c705d65d1c083a60fd4e058456dcdc4ffa0fffb
2021-11-23 10:14:29 -08:00
Joshua Trask
554dcb5a72 System->Unbundled, AppPrediction availability bit.
The current logic in ChooserActivity depends on checking
for the presence of a particular AppPredictionService
component in AiAi, but that check always fails in the
unbundled Chooser. Instead, only check when we're
running on the system side, and hand off the bit in an
extra on the delegation intent.

Test: trivial (needs other changes for meaningful behavior)
Bug: 206831012
Change-Id: I86919d962ac25fc1a4dd4a25d672d400abc64ff2
2021-11-19 14:39:03 -05:00
Treehugger Robot
32928fecf0 Merge "Framework and system_server classes can access public vendor libraries" am: 8cb6d28329 am: 1f479b99ce am: 6d0d1ff1e6 am: aad398ed08
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1885792

Change-Id: Ie41aef3be08b7a579e3fa24a1b21bd9057c9a45a
2021-11-19 01:22:56 +00:00
Treehugger Robot
aad398ed08 Merge "Framework and system_server classes can access public vendor libraries" am: 8cb6d28329 am: 1f479b99ce am: 6d0d1ff1e6
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1885792

Change-Id: I46c8afc6889b9e01e0d48e011092b49f5cee5a12
2021-11-19 01:05:19 +00:00
Treehugger Robot
6d0d1ff1e6 Merge "Framework and system_server classes can access public vendor libraries" am: 8cb6d28329 am: 1f479b99ce
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1885792

Change-Id: I924242f514458f53cfb71ef83b5084646c8b1b73
2021-11-19 00:47:09 +00:00
Treehugger Robot
1f479b99ce Merge "Framework and system_server classes can access public vendor libraries" am: 8cb6d28329
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1885792

Change-Id: Ia8fe285e3668fac4c2d6ca8ffff2976df88f90c3
2021-11-19 00:29:06 +00:00
Treehugger Robot
8cb6d28329 Merge "Framework and system_server classes can access public vendor libraries" 2021-11-19 00:08:57 +00:00
Joshua Trask
622adb8ffe Merge ""Springboard" from system to new chooser." 2021-11-18 22:41:14 +00:00
Issei Suzuki
69700e2f2b Merge "Stop output WM_DEBUG_WALLPAPER logs to logcat" into sc-v2-dev am: 8dfb06f117 am: b6bb0424f0
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16283220

Change-Id: If81d94312dfbaf5814ab8b4256626a03e2bb4591
2021-11-18 20:31:53 +00:00
Issei Suzuki
b6bb0424f0 Merge "Stop output WM_DEBUG_WALLPAPER logs to logcat" into sc-v2-dev am: 8dfb06f117
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16283220

Change-Id: I2e622e390e341f1ef11088eff9265bb53ed39ed1
2021-11-18 19:51:05 +00:00
Joshua Trask
83c3ba2809 "Springboard" from system to new chooser.
These changes are somewhat hacky, but they allow
us to conditionally hand over to the new unbundled
chooser with minimal impact if the experiment
is disabled.

For a safer implementation, we could consider
starting with a separate springboard activity that
launches a normal (reverted) version of the
"bundled" chooser if we intend to show the UI
from the system side, but that would incur some
latency even when the flag is disabled.

Test: manual, as described in ag/16286296.
Bug: 202165481
Change-Id: I4073776b293806052e9ff66c50fea1181afd642a
2021-11-18 12:24:16 -05:00
Xin Li
10d9972786 Merge sc-qpr1-dev-plus-aosp-without-vendor@7810918
Bug: 205056467
Merged-In: I13199bc39e9445929195f3d15579cbffe94e92b0
Change-Id: I35fa3c6c2abf679c51033f1395a08d511ed8739f
2021-11-18 17:00:37 +00:00
Prabir Pradhan
be380be6dd Remove focus change callbacks from IWindow
Since window focus changes are dispatched by InputDispatcher, remove
focus change callbacks from IWindow so that WM cannot dispatch focus
changes without going through InputDispatcher.

Bug: None
Test: presubmit
Change-Id: Idff4c18084f35febf2bb6e5622b7e987130e8c76
2021-11-18 08:38:34 -08:00
Andrei Onea
13673883d7 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
2021-11-18 15:09:07 +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