We require binder calls detailed tracking to be enabled to collect the
stats (in addition to enabling it in WestWorld).
Test: unit test + manual
adb shell cmd stats pull-source 10022
Pull from 10022: { 1531240941000000000 25807560798 (10022)0x10000->0[I]
0x20000->com.android.server.StorageManagerService$3[S]
0x30000->onVolumePathChanged[S] 0x40000->1[L] 0x50000->0[L]
0x60000->18490[L] 0x70000->18490[L] 0x80000->2611[L] 0x90000->2611[L]
0xa0000->0[L] } ...
Change-Id: I07cad5d8678426cdac45872cda028ea7a85d7d81
Associations now keep track of the time they are
actively involved in impacting their target application.
This is based on the procstate propagating through the
association being the same as the procstate of its target
process... so it may count as active when there is
another reason for that process to be in the same state.
To do this, we now maintain a set of "tracking
associations" -- these are in-use associations that
we know we need to be tracking to determine whether
they are active. This list is built based on whether
we at all consider an association during an oom_adj
computation, and at the end of that walked to determine
which of those associations are currently active.
Also add tracking of associations through external
provider references, with a tag name now needing to be
passed through so we can mark up the reason for the
external reference.
Test: manual
Bug: 110957691
Change-Id: I426a499834e20a9d7f2b439faf9cb398d9792fa2
For instance, to enabled detailed tracking locally.
adb shell settings put global binder_calls_stats detailed_tracking=true
Also adds the ability to turn off data collection completely and
changing the sampling interval. Uploading data through westworld can
re-use the same flag once implemented.
Test: Unit tested
Change-Id: I808c9902b8124ab643d9b197703d537da040ae3e
Track changes in libcore to remove a constructor + lint
import order changes. Instead of the constructor a utility
method is introduced.
Test: Build / boot
Bug: 111055375
Change-Id: Id683a9d9d6e27d4c8df623dae189da9e74a6d410
For testing we often need to run shell commands. This can be done
today via running a shell command from an instrumentation test
started from the shell. However, this requires adding shell commands
which are not in the API contract, involve boilerplate code, require
string parsing, etc.
This change allows an instrumentation started from the shell to
adopt the shell UID permission state. As a result one can call APIs
protected by permissions normal apps cannot get by are granted to
the shell. This enables adding dedicated test APIs protected by
signatures permissions granted to the shell.
Test: cts-tradefed run cts-dev -m CtsUiAutomationTestCases
-t android.app.uiautomation.cts.UiAutomationTest#testAdoptShellPermissions
bug:80415658
Change-Id: I4bfd4b475225125512abf80ea98cd8fcacb6a1be
Currently mMinLearnedBatteryCapacity is only updated once (when it's
-1). We check the minimum of mMinLearnedBatteryCapacity and the new
chargeFullUah reading but never update mMinLearnedBatteryCapacity to the
new value.
Bug: 111132682
Test: manual
Change-Id: I1680e7a4bdf9176feb2a2dcc9f2c10c829202bda
The goal is to figure out if it would be worth monitoring these
exceptions. If exception types are only caller issues like
SecurityException and IllegalArgumentException, it is probably not worth
it. If we can find NPE or internal exceptions it would be worth
uploading the exceptions through dropbox.
Test: unit test
Change-Id: I779d43a0e6ca1a33535b90809491675420a51726
ServiceManager.getService("batteryproperties")) may return null for some
devices right after boot. (We don't know why, need further investigation)
This causes async batterystats update to crash, leaving BatteryStats in a
bad state (OnBattery() == true, but mOnBatteryTimeBase is not running),
which does not accept aggregated stats update anymore.
Bug: 109930230
Test: manual
Change-Id: I0654beff95f0a2b9df2567f1a2efffd3330e58ff
- Keep track of foreground services.
- Keep track of associations between processes.
The big part of this is the second, tracking associations.
We have have procstats keeping continual track of associations
between processes, much like the "am track-associations"
command. Currently the data kept on them is very minimal
(just the count and total duration, not separated by other
states) due to the potential number of them that there can be,
but we can look in to trying to maintain more data going
forward if it is feasible.
The way this is incorporated into the activity manager makes
it a little different than "am track-associations," with
potentially some new interesting data available. These
associations are tied with the connection objects in the
activity manager, so they only count while the target
process is actually running (so their duration should match
with the lifecycle of the target). They are tied to the
target package, since that is what we know all of the
information we need for rooting data in procstats (package
name, uid, and version code of that package); only the process
name and uid are available for the source of the association
Since these are tied to the connection components, it is
possible that we could even maintain data on the duration per
proc state that is flowing from that association in to the
target process. That would be very useful, but would add
a fair amount more overhead in data being tracked.
English output of the new association data looks like:
* com.android.providers.downloads / u0a17 / v28:
* Prc android.process.media / u0a17 / v28:
TOTAL: 0.45%
Imp Bg: 0.26%
Service: 0.18%
Receiver: 0.01%
(Last Act): 0.78%
(Cached): 37% (5.2MB-5.8MB-8.2MB/3.9MB-4.4MB-6.0MB/3.9MB-7.0MB-50MB over 18)
* Svc com.android.providers.downloads.DownloadIdleService:
Process: android.process.media
Running count 3 / time 0.01%
Bound count 3 / time 0.01%
Executing count 6 / time 0.00%
* Svc com.android.providers.downloads.DownloadJobService:
Process: android.process.media
Running count 6 / time 0.21%
Bound count 6 / time 0.21%
Executing count 12 / time 0.00%
* Asc com.android.providers.downloads.DownloadIdleService:
Process: android.process.media
<- system / 1000:
Count 3 / time 0.01%
* Asc com.android.providers.downloads.DownloadStorageProvider:
Process: android.process.media
<- com.android.documentsui / u0a10:
Count 1 / time 0.00%
* Asc com.android.providers.downloads.DownloadProvider:
Process: android.process.media
<- com.android.vending / u0a11:
Count 39 / time 2.6%
<- system / 1000:
Count 3 / time 0.00%
<- com.google.android.gms / u0a36:
Count 8 / time 0.01%
* Asc com.android.providers.downloads.DownloadJobService:
Process: android.process.media
<- system / 1000:
Count 6 / time 0.21%
And the corresponding checkin:
pkgproc,com.android.providers.downloads,10017,28,android.process.media,0nf:717,0nb:71332,0ns:48335,0nr:3652,0nl:218034,0ne:10103500,0mf:21,0ms:614,0me:185,1ne:100236
pkgpss,com.android.providers.downloads,10017,28,android.process.media,0ne:18:5310:5950:8434:4036:4522:6140:4036:7127:51056
pkgsvc-run,com.android.providers.downloads,10017,28,.DownloadIdleService,3,0n:1849
pkgsvc-bound,com.android.providers.downloads,10017,28,.DownloadIdleService,3,0n:1794
pkgsvc-exec,com.android.providers.downloads,10017,28,.DownloadIdleService,6,0n:89
pkgsvc-run,com.android.providers.downloads,10017,28,.DownloadJobService,6,0n:58224
pkgsvc-bound,com.android.providers.downloads,10017,28,.DownloadJobService,6,0n:58154
pkgsvc-exec,com.android.providers.downloads,10017,28,.DownloadJobService,12,0n:187
pkgasc,com.android.providers.downloads,10017,28,.DownloadIdleService,system,1000,3,1790
pkgasc,com.android.providers.downloads,10017,28,.DownloadStorageProvider,com.android.documentsui,10010,1,80
pkgasc,com.android.providers.downloads,10017,28,.DownloadProvider,com.android.vending,10011,39,1067022
pkgasc,com.android.providers.downloads,10017,28,.DownloadProvider,system,1000,3,96
pkgasc,com.android.providers.downloads,10017,28,.DownloadProvider,com.google.android.gms,10036,8,1951
pkgasc,com.android.providers.downloads,10017,28,.DownloadJobService,system,1000,6,58149
Bug: 110957691
Test: manual
Change-Id: Id466b085303527e7bf7354f7f33a0fbaa768fb7b
The observer does not always remove themself after adding themself into
mObservers list. The strong reference in mObservers causes memory leak.
The fix is to change mObservers to hold WeakReference.
Fix: 80443940
Test: "adb shell cmd battery unplug" and "adb shell cmd battery set ac",
observe memory usage from Android Monitor.
Change-Id: I27436e350fa0d211c4c64114411a6603824ce599
Previously, there was a time window between when an IME starts new
input and when the IME issues an IPC IMM#setImeWindowStatus() so that
WindowManagerService (WMS) can be notified about the new IME target
window.
With this CL, it is now guaranteed that WindowManagerService (WMS) is
always notified about the new IME target window before IME starts
interacting with that window.
Note that WMS is not using notified IME target window yet hence there
should be no user-visible behavior change.
Bug: 110531072
Test: atest CtsInputMethodTestCases CtsInputMethodServiceHostTestCases
Change-Id: I032b91ce722a16b17518a5d88015c574d7d3e51b
This change is cherry-picked and rebased from AOSP
https://android-review.googlesource.com/c/platform/frameworks/base/+/660242
Add face recognition as an identification method, following fingerprint
design. Unlike fingerprint, only one face template can be enrolled per
user, and a vendor message is passed from the HAL all the way to the
client callback to allow GUI indication about the enrolled face
templates.
Add FaceAuthenticationManager and FaceService.
Add face authentication capability to TrustManager and Keyguard.
Modify TrustManager and KeyguardUpdateMonitorCallback fingerprint code
to support generic biometric method to eliminate duplications.
Add BiometricSourceType enum to keep track of the specific biometric
method.
Test: biometric authentication still works on the device
Fixes: 110385761
Change-Id: I5d04fe69a112c13d3ef7330b9c08c146e36c5335
Signed-off-by: Gilad Bretter <gilad.bretter@intel.com>
TextServicesManager always sets null to the "locale" parameter in
ITextServicesManager#getCurrentSpellCheckerSubtype then
TextServicesManagerService always ignores that parameter. It can be
safely removed.
Bug: 110275412
Test: Manually verified that spell checker still works
Change-Id: I5d85089899b0bd077f69971d77095859086a8d52
Message app or other apps will use some format code or controll
code on SenderName to fit RTL or other design, and symbols will
produced by these code. The special code pattern not include these
code, so it will go charIcon flow.
Although these code is not visible, we should just ignore them to
get symbol strings
Change-Id: I20ef459b10ba7504ec0c997ed815cb485817d2bc
Fixes: 109746235
Test: Check notification form message app on RTL
Test: atest SystemUITests
Rationale: hexdumps are mainly used when verbose logging is enabled,
which means that callers are rarely exercised (let alone tested).
Crashing on unchecked null pointers doesn't make debugging any easier,
nor production code any more robust.
Moreover, this is the behavior of system.out.println() and other
logging APIs.
Test: runtest -x core/tests/coretests/src/com/android/internal/util/HexDumpTest.java
Bug: 110177912
Change-Id: Idccd81a5654ed0f7fee6b27177941bf8c311973e
Second step in unifying the window hierarchy that is currently split
within AM and WM packages. We move some of the API implementation for
activities from ActivityManagerService.java to
ActivityTaskManagerService.java.
Test: Existing tests pass
Test: go/wm-smoke-auto
Bug: 80414790
Change-Id: I23dcd924493d8ad1e0b6e3a55386fd72b0146605