Commit Graph

9838 Commits

Author SHA1 Message Date
Hui Yu
420ed9ef22 Fix the memory leak in BatteryStatsImpl.Timebase.mObservers.
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
2018-06-28 20:09:12 +00:00
Dan Sandler
d1f9f5338f P is for PAINT.
Bug: 109925861
Test: adb shell am start \
        -a android.intent.action.MAIN \
        -c com.android.internal.category.PLATLOGO
Change-Id: Ic3020007c716be264e9523d6dbae9e13a95fa571
2018-06-27 18:58:14 -04:00
Yohei Yukawa
99e1f6e04b Notify new IME target before IME starts interacting
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
2018-06-22 17:33:19 -07:00
TreeHugger Robot
abe78cd313 Merge changes from topic "biometrics-face"
* changes:
  5/n: Move FaceService to biometrics directory
  4/n: Add face authentication framework
2018-06-22 18:44:27 +00:00
Gilad Bretter
cb51b8b847 4/n: Add face authentication framework
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>
2018-06-21 17:00:07 -07:00
Arthur Hung
b03ab2eea1 Merge "Get mime type from getDocumentType instead of from file name" 2018-06-20 03:57:50 +00:00
Yohei Yukawa
1235c24a0f Remove unused parameter from TSMS IPC
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
2018-06-17 20:52:37 -07:00
Bernie Innocenti
e00ce5e9ea Merge "Make dumpHexString() tolerate null arrays." am: a917c1db32 am: 7bb253d078
am: 3e0f3ef8ad

Change-Id: I1fbea877d10b4f270fc1722ec1c14e9bd8f131a3
2018-06-14 22:12:11 -07:00
Bernie Innocenti
3e0f3ef8ad Merge "Make dumpHexString() tolerate null arrays." am: a917c1db32
am: 7bb253d078

Change-Id: Id58b8039510baa518d8d10b03237681a7b842d0f
2018-06-14 22:02:58 -07:00
Bernie Innocenti
7bb253d078 Merge "Make dumpHexString() tolerate null arrays."
am: a917c1db32

Change-Id: Ib0160e232cab0a713853a65eef26f7a02d65c1f1
2018-06-14 21:55:53 -07:00
Android Build Merger (Role)
c67466a507 [automerger] Fix solid circle show on message notification am: 1250cd1407 am: 51e6cce63c
Change-Id: I20b8317a34eac3642ec6054f5f2332d1e001a7ab
2018-06-15 03:14:48 +00:00
Tony Huang
cb74f9c13d Fix solid circle show on message notification
am: 1250cd1407

Change-Id: I9742ab1f93c797e23d4545d6659efcfa4808b03c
2018-06-14 20:13:32 -07:00
Tony Huang
51e6cce63c Fix solid circle show on message notification
am: 1250cd1407

Change-Id: I805908a107f7e082a0f5c3294a777235efa74b16
2018-06-14 20:13:30 -07:00
Tony Huang
1250cd1407 Fix solid circle show on message notification
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
2018-06-15 02:59:57 +00:00
Bernie Innocenti
dee4e0bde4 Make dumpHexString() tolerate null arrays.
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
2018-06-14 22:59:08 +09:00
Android Build Merger (Role)
df81db8a2d [automerger] Merge "Config to enable/disable AOD via overlay" into pi-dev am: b784e6f7bc am: dbaa859020
Change-Id: I28f94afdf78fd73fb32963106ba0ab36d6f30cdd
2018-06-14 01:31:22 +00:00
Lucas Dupin
dbaa859020 Merge "Config to enable/disable AOD via overlay" into pi-dev
am: b784e6f7bc

Change-Id: Ice4c1384b236f6d1fe2756ff44fdaec4200f4218
2018-06-13 18:30:25 -07:00
Lucas Dupin
89cdaab2ab Merge "Config to enable/disable AOD via overlay" into pi-dev
am: b784e6f7bc

Change-Id: I7e6d629b9ca6e87a48c332dab470771c4564985d
2018-06-13 18:30:24 -07:00
Lucas Dupin
1e02f340e0 Config to enable/disable AOD via overlay
Bug: 109894567
Test: mp droid; fastboot -w
Change-Id: I3fda0bf486ae0c4b795ce34ba6823d8dc36a3796
2018-06-13 15:36:04 -07:00
Wale Ogunwale
04d9cb5f40 Moved some activities implementation to ActivityTaskManagerService (2/n)
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
2018-06-12 13:38:39 -07:00
TreeHugger Robot
07082dfe17 Merge "DO NOT MERGE Update battery stats buffer on wear branch." into pi-wear-dev 2018-06-08 20:24:07 +00:00
Svet Ganov
398780aee6 Merge "Don't access keyguard from instant apps." into pi-dev am: e7bd4e7e8f
am: cbd47f7937

Change-Id: Ia58918ec4c66f9263ad7d0e27e74ae1b87402ba4
2018-06-07 23:19:40 -07:00
Svet Ganov
cbd47f7937 Merge "Don't access keyguard from instant apps." into pi-dev
am: e7bd4e7e8f

Change-Id: I5d5d8ea0c7b5756143b5140e4cf16ae584147345
2018-06-07 22:12:45 -07:00
TreeHugger Robot
7231e7b6ce Merge "More conservative dark text calculation" 2018-06-08 04:33:50 +00:00
Svet Ganov
3ea66c319c Don't access keyguard from instant apps.
Test: cts-instant-tradefed run cts-instant -m CtsViewTestCases

bug:109652548

Change-Id: I6f8bb714bd98fd53068b2662633a9155d64b274c
2018-06-07 20:20:38 -07:00
Lucas Dupin
a291d19e47 More conservative dark text calculation
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
2018-06-07 16:33:09 -07:00
TreeHugger Robot
300a14eb98 Merge "PointerLocationView: Add top padding to header if there is a cutout" 2018-06-07 10:06:17 +00:00
Arthur Hung
430c6e6ebb Get mime type from getDocumentType instead of from file name
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
2018-06-07 04:54:37 +00:00
Andrew Zeng
fddae04794 DO NOT MERGE Update battery stats buffer on wear branch.
Bug: 77325007

Change-Id: I9b78dfc01cb2f224645cddab7902123f374cc9a0
2018-06-07 00:17:02 +00:00
TreeHugger Robot
346b70df9f Merge "Wean Statsd off BatteryStats: WakeupAlarm" 2018-06-06 18:33:45 +00:00
Adrian Roos
de5c3dac25 PointerLocationView: Add top padding to header if there is a cutout
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.
2018-06-06 18:58:58 +02:00
Dan Sandler
76c76d5b7e Merge "Delay pruning direct share targets." into pi-dev am: 22385d9d4e
am: 396330a584

Change-Id: I9fe64d0896db76b06c2dbeca706795f280b058f3
2018-06-05 17:35:49 -07:00
Dan Sandler
396330a584 Merge "Delay pruning direct share targets." into pi-dev
am: 22385d9d4e

Change-Id: Ic94163018248073c54416a2196591af98e22e944
2018-06-05 16:55:06 -07:00
TreeHugger Robot
22385d9d4e Merge "Delay pruning direct share targets." into pi-dev 2018-06-05 22:55:44 +00:00
Svet Ganov
aa5d9beecc Don't access keyguard from instant apps. am: e5a3125c1c
am: 54f78810cc

Change-Id: I916c50f5e0c27a17b1e7dc284b5544b920fc20e8
2018-06-05 14:41:20 -07:00
Svet Ganov
54f78810cc Don't access keyguard from instant apps.
am: e5a3125c1c

Change-Id: I1a6574d771f3e94727d85d24eb5f1abe1a0f388d
2018-06-05 14:34:22 -07:00
Svet Ganov
e5a3125c1c Don't access keyguard from instant apps.
Test: manual

bug:109652548

Change-Id: Ife1302e39e4f71f66d032619068a7e0214856b32
2018-06-05 20:29:40 +00:00
TreeHugger Robot
6976b764ad Merge "Wean Statsd off BatteryStats: Network Power" 2018-06-05 19:57:10 +00:00
Dan Sandler
f5e17699e3 Delay pruning direct share targets.
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
2018-06-05 15:31:46 -04:00
Lucas Dupin
2d1ef0bf60 Clear all fade-out timeouts
Change-Id: Id549d70836ca73ff7a079c41ac9793b64281bc84
Fixes: 80554360
Test: visual
2018-06-04 17:51:37 -07:00
TreeHugger Robot
bc9a02b998 Merge "Wean statsd off batterystats: workchain, longPW" 2018-06-04 17:22:28 +00:00
Bookatz
9b2199bdac Wean Statsd off BatteryStats: WakeupAlarm
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
2018-06-01 23:46:05 +00:00
Olivier Gaillard
58b56e3720 Collect a few more binder stats when detailed tracking is enabled.
Test: unit tested

Change-Id: Ibdbbd2b9b60dbc6fa375d60c76f04d42392d6bd3
2018-06-01 21:25:53 +01:00
Bookatz
d888df2ba9 Wean statsd off batterystats: workchain, longPW
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
2018-06-01 11:12:41 -07:00
Bookatz
0b028b1dc0 Wean Statsd off BatteryStats: Network Power
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
2018-06-01 10:52:36 -07:00
Fyodor Kupolov
01f9711dd0 Merge "Use sampling for faster measuring of CPU time" 2018-06-01 01:06:23 +00:00
TreeHugger Robot
3795062f23 Merge "Protect usage data with OP_GET_USAGE_STATS." 2018-05-31 19:21:14 +00:00
Fyodor Kupolov
cf0fe2d456 Use sampling for faster measuring of CPU time
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
2018-05-31 11:16:37 -07:00
Evan Rosky
ee4376a290 Merge "Fixed a bug where sometimes unhandled handler would consume all keys" into pi-dev am: 7ba4c2b254
am: 9bf11ede69

Change-Id: I3e1eb6884cedb86ec144e5ada09b4252ee266c96
2018-05-30 15:10:41 -07:00
Evan Rosky
9bf11ede69 Merge "Fixed a bug where sometimes unhandled handler would consume all keys" into pi-dev
am: 7ba4c2b254

Change-Id: Ia7fab42d36c8b58b05656cc2e5d1253449becf96
2018-05-30 15:02:51 -07:00