Commit Graph

911 Commits

Author SHA1 Message Date
Suprabh Shukla
6226c2ff3c Injecting system calls into alarm manager
Injecting and mocking dependencies to make the service unit testable.
Shuffled around initialization to make that possible.

Also added the first batch of unit tests. The idea is to have extensive
coverage of minute pieces of alarm manager logic, which should help us
catch any regressions caused by future changes to the code.

Test: atest com.android.server.AlarmManagerServiceTest
atest CtsAlarmManagerTestCases

Bug: 111454659
Change-Id: Ifa1c09646f688cf5c41abe17d98dbc19978eac70
2018-09-06 16:20:30 -07:00
Marcin Oczeretko
d8cc8593c0 Collect telemetry data for System Server Loopers.
Adds LooperStats and LooperStatsService which set a static
Looper.Observer to record the count of dispatched messages and
cpu/latency information. The aggregated stats are collected by
Westworld as pulled atoms.

The collection is disabled by default and requires a manual call to
enable:

adb shell cmd looper_stats enable

Test: Unit tests and tested manually that the collected data seems
reasonable.

Change-Id: I7162fbca4e324f62887f95df3405205cbe4416ca
2018-09-03 16:06:06 +01:00
TreeHugger Robot
49fa609ba0 Merge changes from topic "biometric-prompt-service"
* changes:
  Add BiometricPromptService
  Remove common biometric directory
2018-08-31 01:21:07 +00:00
Kevin Chyn
a24e9fd9ac Add BiometricPromptService
The change introduces the following:
  - BiometricPrompt communicatates with BiometricPromptService (new)
    system service. The service does the decision making for which
    biometric modality to use.
  - As a result, a lot of logic is moved from <Biometric>Manager
    to BiometricPrompt. FingerprintManager now does not care about
    BiometricPrompt logic anymore (reverts several P changes).

Face, and all future <Biometric>Service interfaces must be protected by
the signature-only MANAGE_BIOMETRIC permission. Settings, SystemUI, and
BiometricPromptService are their only clients.

Bug: 72825012

Test: BiometricPromptDemo works
Test: Keyguard works
Test: Settings works

Change-Id: I2b7d6eff81bc07950202c50e592d733032523bf0
2018-08-30 14:49:32 -07:00
Yohei Yukawa
e24ed79edb Hide IInputMethodManager.{add,remove}Client() from apps
Since IInputMethodManager.{add,remove}Client() are just callbacks from
WindowManagerService to InputMethodManagerService, we can simply move
those two methods to InputMethodManagerInternal instead of having them
in IInputMethodManager.aidl, which ends up exposing those methods to
any random user process.

This enables us to clean up WindowManagerService because it is no
longer responsible for obtaining IInputMethodManager and passing it to
each Session instance.

This also allows us to get rid of several RemoteException handlers
from Session class, because now the complier knows that those
callbacks will never throw RemoteException.

Fix: 112670859
Test: atest CtsInputMethodTestCases CtsInputMethodServiceHostTestCases
Test: prebuilts/checkstyle/checkstyle.py -f frameworks/base/services/core/java/com/android/server/inputmethod/InputMethodManagerInternal.java
Change-Id: I453200fd5847e9a78876affb6a1caec221525e1d
2018-08-28 19:10:32 -07:00
Jorim Jaggi
acfabaa32b Merge "BootAnimation: Fix boot animation with hidden cutout" into pi-dev am: e387ce18d8
am: 2c68abc9fc

Change-Id: I1a0db9f30f7270d49136fa3984dc8d9633ead690
2018-08-22 16:38:27 -07:00
Jorim Jaggi
2c68abc9fc Merge "BootAnimation: Fix boot animation with hidden cutout" into pi-dev
am: e387ce18d8

Change-Id: I55c32ef69c4bb565376946ce65101f37ef0cce8a
2018-08-22 16:20:32 -07:00
Adrian Roos
9ee5dff83c BootAnimation: Fix boot animation with hidden cutout
We do this by storing the masking inset in a persistent property.
The boot animation then animates itself to where it would be if that
masking inset were applied, then changes the viewport.

For this to work, we also need to make sure the DisplayManagerService
has the right overlay right at the start.

Bug: 112876936
Test: Hide cutout, then reboot. Verify boot animation is smooth.
Change-Id: I3e988b2340b2e0d2be3939bdc6878704c234ccc8
2018-08-22 21:37:39 +01:00
Makoto Onuki
2132e0814c Merge "Default to FULL synchronous mode for sqlite DBs in system server" into pi-dev
am: 30fdcbad94

Change-Id: I0f4b5f91cf0a877bc518b555abb8380487c68d31
2018-08-17 16:48:09 -07:00
Makoto Onuki
3729e9ce4e Default to FULL synchronous mode for sqlite DBs in system server
Test: change pin and immediately crash the kernel with
adb shell 'su root sh -c "echo c >/proc/sysrq-trigger"' and boot
Bug: 112175067

Change-Id: Ia5f43f3118e2297fbea43c805ef2f4577bf8a9bf
(cherry picked from commit 50e00c8dc4)
2018-08-17 21:09:03 +00:00
Makoto Onuki
50e00c8dc4 Default to FULL synchronous mode for sqlite DBs in system server
Test: change pin and immediately crash the kernel with
adb shell 'su root sh -c "echo c >/proc/sysrq-trigger"' and boot
Bug: 112175067

Change-Id: Ia5f43f3118e2297fbea43c805ef2f4577bf8a9bf
2018-08-09 11:00:54 -07:00
TreeHugger Robot
f618905a6e Merge "Fix WM input limitations on secondary displays (1/N)" 2018-07-26 12:06:28 +00:00
Wale Ogunwale
590c716f8c Merge "Moved URI grants code out of ActivityManagerService to its own service (13/n)" 2018-07-26 03:56:08 +00:00
Arthur Hung
95b38a906f Fix WM input limitations on secondary displays (1/N)
- One DisplayContent include one InputMonitor.
- For customized inputconsumers, they can be handled by DisplayContent.
- Extract InputManagerCallback to communicated InputManagerService.
- All windows need pass displayId to InputWindowHandle.

Bug: 111363643
Test: atest WindowManagerSmokeTest
Test: atest DisplayContentTests
Change-Id: Iaaca7d135a11c55a78bcf1f81918599b3d160106
2018-07-25 17:47:51 +08:00
Michael Kwan
7f70fc7bef Watch type devices currently do not support instant apps, prevent
related services from launching.

Bug: 111598607
Test: manual test
Change-Id: I5cc6909ecb287ece5b964ea6c7c685dbe767c895
2018-07-24 17:15:05 +00:00
Wale Ogunwale
6d50dcc8af Moved URI grants code out of ActivityManagerService to its own service (13/n)
Allows for other services like window manager to call uri grants without
holding AM service lock.

Bug: 80414790
Test: Existing tests pass.
Change-Id: Ie5b4ddb19a2cedff09332dbeb56bcd9292fd18ac
2018-07-23 16:37:46 -07:00
Rhed Jao
8a39cef7f8 Update AccessibilityManagerService to use SystemService
Bug: 70221242
Test: atest CtsAccessibilityServiceTestCases
Change-Id: Icdf0772d0be93168a954fdd746cada4d5d507eb4
2018-07-18 13:42:35 +08:00
Olivier Gaillard
1d7f615eec Add experiment flag to control binder call stats.
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
2018-07-04 13:36:46 +01:00
Neil Fuller
ca48eb7fa9 resolve merge conflicts of bc38909bf3 to stage-aosp-master
BUG: None
Test: I solemnly swear I tested this conflict resolution.
Change-Id: Ib06f2869e5aa1788c8d5fc281a8565420e93d8f7
2018-06-27 11:40:06 +01:00
Neil Fuller
e01a7adf5a resolve merge conflicts of 55c0a66825 to stage-aosp-master
BUG: None
Test: I solemnly swear I tested this conflict resolution.
Change-Id: Ie524607cabc6688911eee7e4f61c50fd406c71f4
2018-06-26 11:55:46 +01:00
Neil Fuller
0e44c66e08 Prepare for migration to the time detector service
Paves the way for moving more behavior to the time detector
service from the NetworkTimeUpdateService.

The NewNetworkTimeUpdateService is effectively identical to
the OldNetworkTimeUpdateService in this initial commit.

Bug: 78217059
Test: build / boot
Merged-In: Ica9fa9b61c849e034d76c0faae5693b60a4a197f
Change-Id: Ica9fa9b61c849e034d76c0faae5693b60a4a197f
2018-06-26 10:14:17 +01:00
Neil Fuller
b3d6abbe6f Prepare for migration to the time detector service
Paves the way for moving more behavior to the time detector
service from the NetworkTimeUpdateService.

The NewNetworkTimeUpdateService is effectively identical to
the OldNetworkTimeUpdateService in this initial commit.

Bug: 78217059
Test: build / boot
Merged-In: Ica9fa9b61c849e034d76c0faae5693b60a4a197f
Change-Id: Ica9fa9b61c849e034d76c0faae5693b60a4a197f
2018-06-26 09:46:32 +01:00
Neil Fuller
4d9f7a8bc3 Merge "Minimum viable TimeZoneDetectorService" 2018-06-25 18:47:39 +00:00
TreeHugger Robot
1248d0db95 Merge "Introduced WindowProcessController/Listener (10/n)" 2018-06-23 05:52:22 +00:00
Wale Ogunwale
9e4f3e077f Introduced WindowProcessController/Listener (10/n)
One heavy dependence between the current AMS service and activities
is process management which is heavy affected by activities and their
current state. We introduce WindowProcessController and WindowProcessListener
objects as a structured way for the process changes in AM package to
be communicated to the WM package and WindowProcessListner for activity
changes in the WM package to the communicated back to the AM package.
The ProcessRecord object in AM will own the WindowProcessController object
and also implement the WindowProcessListener.

Test: Existing tests pass
Test: go/wm-smoke-auto
Bug: 80414790
Change-Id: I9e96e841b0f95e99a597cb4629fa5d2fe45760b6
2018-06-22 14:26:24 -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
Kevin Chyn
2ffadb38bc 5/n: Move FaceService to biometrics directory
Bug: 110387294

Test: builds, observable effect on devices (as expected)
Change-Id: Iaf0814c3c19aa9fa448e250cb3a161bd11fd935e
2018-06-21 17:00:07 -07: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
Neil Fuller
cccc48d0fe Minimum viable TimeZoneDetectorService
This is a do-nothing TimeZoneDetectorService that can be
populated in following commits. A temporary method has been
added so the service has one method.

Unit tests can be run with:

atest FrameworksServicesTests:TimeZoneDetectorServiceTest

Test: build / boot
Test: See above
Merged-In: I565fb5dd2f18b7aac2e5779d346bfe69e9da02af
Change-Id: I565fb5dd2f18b7aac2e5779d346bfe69e9da02af
2018-06-21 09:30:34 +00:00
Neil Fuller
7fb88c3928 Minimum viable TimeZoneDetectorService
This is a do-nothing TimeZoneDetectorService that can be
populated in following commits. A temporary method has been
added so the service has one method.

Unit tests can be run with:

atest FrameworksServicesTests:TimeZoneDetectorServiceTest

Test: build / boot
Test: See above
Change-Id: I565fb5dd2f18b7aac2e5779d346bfe69e9da02af
2018-06-21 10:28:47 +01:00
Kevin Chyn
551767618e Merge changes from topic "biometric-refactor"
* changes:
  2/n: Refactor out common BiometricService code
  1/n: Move fingerprint-service related code to biometrics/fingerprint
2018-06-20 03:47:53 +00:00
Kevin Chyn
95d628ef86 1/n: Move fingerprint-service related code to biometrics/fingerprint
Bug: 109900227

Test: builds
Change-Id: I973c816d75c48ed838c1638c45d728b9df4d11ef
2018-06-19 16:09:06 -07:00
Wale Ogunwale
16e505a326 Moved mRecentTasks to ActivityManagerTaskService (4/n)
Test: Existing tests pass
Test: go/wm-smoke-auto
Bug: 80414790
Change-Id: I7e48eaf66200f689757578461076e9288b862b33
2018-06-17 09:39:46 -07:00
TreeHugger Robot
6006f76ad7 Merge "Split interfaces and service for activities from current AM interfaces (1/n)" 2018-06-12 18:18:48 +00:00
Neil Fuller
79d42a61e4 resolve merge conflicts of 5e1d95b0cc to stage-aosp-master
BUG: None
Test: I solemnly swear I tested this conflict resolution.
Change-Id: Ic5527b29cbe8c84d2053be849cf09df5341e4790
2018-06-12 14:23:51 +01:00
Neil Fuller
b557907f51 Minimum viable TimeDetectorService
This is a do-nothing TimeDetectorService that can be
populated in following commits. A temporary method has been
added so the service has one method.

Unit tests can be run with:

atest FrameworksServicesTests:TimeDetectorServiceTest

Test: build / boot
Test: See above
Merged-In: I9e4eac70b944441f34491315cd1ce7fa2b9ae150
Change-Id: I9e4eac70b944441f34491315cd1ce7fa2b9ae150
(cherry picked from commit feeee682a2)
2018-06-11 15:29:57 +01:00
Damien Bargiacchi
ae4cb67343 Start the WearPowerService with the other Wear system services
The WearPowerService is in charge of coordinating and keeping track of devices and state concerned
with power.

Bug: 77293569
Change-Id: Ia40ad44a53ef6872dd7ebefd58e17179126dde92
2018-06-07 16:11:34 -07:00
Neil Fuller
7dbefdcb92 resolve merge conflicts of 26119befba to pi-dev-plus-aosp
BUG: None
Test: I solemnly swear I tested this conflict resolution.
Change-Id: Iea64af5a88c9bf399fb26468e931be3c73061bac
2018-06-07 20:02:59 +01:00
Wale Ogunwale
65ebd955e1 Split interfaces and service for activities from current AM interfaces (1/n)
First step in unifying the window hierarchy that is currently split
within AM and WM packages. We separate the interfaces and service dealing
with activities and their containers (tasks, stack, display) from the
rest of AM interfaces and services. This will allow us to move the new
interfaces and services to WM when the internal states are cleaned-up.

Test: Existing tests pass
Test: go/wm-smoke-auto
Bug: 80414790
Change-Id: Ide9b3f89123b768cdbd3e3878113c7a8021187f3
2018-06-06 18:26:21 -07:00
Alice Sheng
59ca58c1f5 Merge "Clean up Wear CPU scaling and swap experiments." 2018-06-06 21:35:01 +00:00
Alice Sheng
8385c0d5b5 Clean up Wear CPU scaling and swap experiments.
The experiments are over now, cleaning up code.

Change-Id: I145b66415d96112535b93385bd0613c2d3d33e46
2018-06-06 09:42:25 -07:00
Neil Fuller
d2f29d7a6f Remove CommonClock / CommonTimeManagementService
The service and associated code is unused.

Bug: 80462439
Test: build / boot
Merged-In: Ibdfab1b7d2951a0c45e07bd47850af037990841b
Change-Id: Ibdfab1b7d2951a0c45e07bd47850af037990841b
2018-06-06 17:03:55 +01:00
Neil Fuller
7bb9fcbc45 Merge "Remove CommonClock / CommonTimeManagementService" 2018-06-06 15:59:44 +00:00
Neil Fuller
ea8a738581 Remove CommonClock / CommonTimeManagementService
The service and associated code is unused.

Bug: 80462439
Test: build / boot
Change-Id: Ibdfab1b7d2951a0c45e07bd47850af037990841b
2018-06-04 19:26:29 +01:00
Neil Fuller
feeee682a2 Minimum viable TimeDetectorService
This is a do-nothing DeviceContextualizerService that can be
populated in following commits. A temporary method has been
added so the service has one method.

Unit tests can be run with:

atest FrameworksServicesTests:TimeDetectorServiceTest

Test: build / boot
Test: See above
Change-Id: I9e4eac70b944441f34491315cd1ce7fa2b9ae150
2018-05-31 09:44:21 +01:00
Ng Zhi An
da44a06ad5 Fix typo in trace tag
Bug: None
Test: logcat
Change-Id: I592e075f4de911d39ccea967e1b3c0c7dd27fd02
2018-05-09 22:34:53 -07:00
Makoto Onuki
d2c6d48fba Merge "Log slow message delivery on Looper" into pi-dev am: 14186bfe08
am: d539b18694

Change-Id: I9a5e02f7b18c63e463d6ff3c4c80d74d18ee7a74
2018-04-30 11:13:25 -07:00
Makoto Onuki
712886fd97 Log slow message delivery on Looper
Sample log:
04-27 15:30:17.306  1000   942   942 W Looper  : Dispatch took 222ms on main, h=Handler (com.android.server.job.JobSchedulerService$JobHandler) {42042fc} cb=null msg=7 start=48162 end=48384
04-27 15:30:17.306  1000   942   942 W Looper  : Delivery took 235ms on main, h=Handler (com.android.server.job.JobSchedulerService$JobHandler) {42042fc} cb=null msg=4 start=48149 end=48384
04-27 15:30:17.773  1000   942   942 W Looper  : Dispatch took 445ms on main, h=Handler (android.app.ActivityThread$H) {5df4c77} cb=android.app.-$$Lambda$LoadedApk$ReceiverDispatcher$Args$_BumDX2UKsnxLVrE6UJsJZkotuA@badd538 msg=0 start=48406 end=48851
04-27 15:30:17.828  1000   942   942 W Looper  : Drained
04-27 15:30:24.389  1000   942   942 W Looper  : Dispatch took 718ms on main, h=Handler (android.hardware.soundtrigger.SoundTriggerModule$NativeEventHandlerDelegate$1) {d7e9947} cb=null msg=4 start=54749 end=55467
04-27 15:30:24.389  1000   942   942 W Looper  : Delivery took 621ms on main, h=Handler (com.android.server.media.MediaSessionRecord$MessageHandler) {5851574} cb=null msg=7 start=54846 end=55467
04-27 15:30:24.499  1000   942   942 W Looper  : Drained

Bug: 78590632
Test: Boot and check log
Test: setprop log.looper.1000.android.bg 1 and runtime-restart and check log
Change-Id: Ief1fc65b40b8a3d583879f55a76288e3dba6be7d
2018-04-27 17:15:46 -07:00
Ralph Nathan
090c2c37ca Udpate package name for IoTSystemServer.
Bug: 78302987
Test: imx7d boots
Change-Id: Idd07a54afae95d982a8bfa621e881a9a83f09d1d
2018-04-23 09:17:00 -07:00
Paul Lawrence
54271901cd Fix FDE
Wifi services crash if run during crypto bounce and are
unnecessary. Disable.

Test: Cherry-pick ag/3898232. System boots, can set pattern, system
      reboots. Wifi works at all points.
Bug: 76452634

Change-Id: Id345082f455617386de7fac23fe84e44a8dee6d9
2018-04-13 21:21:45 +00:00