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
The tool that generates StatsLogInternal.java now includes the following
type of code, to accomodate WorkSources automatically.
public static void write(int code, WorkSource ws, int arg2) {
for (int i = 0; i < ws.size(); ++i) {
write_non_chained(code, ws.get(i), ws.getName(i), arg2);
}
ArrayList<WorkSource.WorkChain> workChains = ws.getWorkChains();
if (workChains != null) {
for (WorkSource.WorkChain wc : workChains) {
write(code, wc.getUids(), wc.getTags(), arg2);
}
}
}
This will reduce a lot of code repitition for the StatsLog.write calls
in BatteryStats. Consequently, doing so will make it easier to remove
these StatsLog.write calls out of BatteryStats. We start in this cl with
LongPartialWakelock (as proof of principle).
Bug: 80308558
Bug: 80314737
Test: manual verification
Test: com.android.internal.os.BatteryStatsTests
Change-Id: Ibd28297345f4ab926dec01a89de0f1bfff9f8871
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: I54fa54a2dc59dfa68f0e063d7063fac423bf0bf4
Calling SystemClock.currentThreadTimeMicro() is expensive (order of
1 microsecond).
To mitigate that, we use sampling by measuring every 10th call for the
given class/transaction combination and extrapolate results.
Sampling is not used when --enable-detailed-tracking option is set,
For more compact output, only 90th percentile is printed, unless -a
option is set. Example output:
Per-UID Summary (cpu_time, % of total cpu_time, call_count, exception_count, package/uid):
13095032 43% 44663 0 com.package1/u0a35
8872156 29% 5831 0 com.package2/u0a75
2379684 8% 1549 0 com.package3/u0a23
Test: manual dumpsys binder_calls_stats
Test: BinderCallsStatsTest + BinderCallsStatsPerfTest
Bug: 75318418
Change-Id: I535e796c17e75d70970e227411cdf0e1a4afd81c