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
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
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
Also, fix NPE caused by PowerProfile not being set on
BatteryStats during `dumpsys batterystats --checkout`
Bug: 208701409
Test: dumpsys batterystats --checkout
Change-Id: I2ec914610f9d61567eba8d4ff53e384f8390ceaa
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
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
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
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
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
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
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
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
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
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
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
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