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
Refactored WallpaperColors to use constrast ratio instead of luminance
for detecting dark pixels. Also using a contrast more conservative than
what GAR requires while decreasing the dark area threshold.
Change-Id: I67b799be4b7ccd50bb3e63c6179d513b9b76446b
Fixes: 76435920
Test: manually set various wallpapers
Test: use new debug flag to verify which pixel is actually dark
DownloadProvider and FileSystemProvide will decide mime type
in different way, so if some function like getDocumentMetadata
will try to get mime type and do some loading. It may reurn unsupported
Bug: 80454526
Test: Download jpg file, remove .jpg extension, get info
Change-Id: Ia8d237181eba51005981ba46a1be3a43af0f249c
Prevents the header of the pointer location view from overlapping with the display
cutout by padding it at the top.
Change-Id: I3ec574ba24a832044260218d96018c5e08024425
Fixes: 109759319
Test: enable display cutout, enable pointer location view, verify cutout does not overlap with the pointer location header.
Pruning was intended to remove targets corresponding to
now-missing packages, but in practice causes the list to
briefly disappear any time packages change:
PACKAGE_CHANGED ->
ResolverActivity.rebuildList() ->
ChooserActivity.onListRebuilt() with an empty
ResolverActivity.mDisplayList
In practice package changes happen all the time, so this
jank happens fairly often. (It contributed to b/67622422 as
well, since all this list rebuilding started animations that
locked out user input.)
This CL removes the old pruning process (comparing targets
against mDisplayList). Instead, we note that mDisplayList
got emptied, and lazily empty our own mServiceTargets once
we start getting responses back from all the services we
just re-queried.
The long-term fix here is to just rebuild all of this stuff.
Test: (1) share from Chrome
(2) toggle the enable state of some random package
to trigger PACKAGE_CHANGED, e.g.
adb shell pm (enable|disable) com.android.egg
(3) watch for jank
Bug: 109676071
Change-Id: Ie9d59b8f4b8cc8343beb40cbad6b8d52e5639082
Statsd calls were sometimes made from BatteryStats, instead of directly
from the source, as a way of getting it running quickly in P. These must
now be done properly and separately.
Note that Statsd needs to be independent of BatteryStats, in preparation
for deprecating large parts of BatteryStats.
Bug: 80308558
Test: cts-tradefed run cts-dev -m CtsStatsdHostTestCases
Change-Id: I9e10672dd701adfbdd5a296c909e44fb17824cd1