Commit Graph

174 Commits

Author SHA1 Message Date
Makoto Onuki
49392d335a Add stats logging to ServiceManager and NPMS
ServiceManager:
- Do an event log every N getService() calls with total time spent
in getService().
where N = 100 for core UIDs and 200 for other apps.

- Do an event log if getService() takes longer than N ms.
where N = 10 for core UIDs and 50 for other apps.

... with some extra throttling.

NPMS:
- Do the basic "stats logger" log for updateNetworkEnabledNL() and
isUidNetworkingBlocked()

This CL also enhances StatsLogegr so it now can show the slowest call
and the max # of calls per-second.

Bug: 77853238
Test: Manual test:
- Insert a SIM card
- Set data limit
- toggle airplane mode
- toggle wifi
- toggle mobile data

Then
- "dumpsys netpolicy" and "dumpsys activity processes" and check the stats
- also check "adb logcat -b all | grep ' service_manager'"

Change-Id: I5789541063f95d0eac501189816c8604a4571ba0
2018-04-11 16:37:57 -07:00
Vishwath Mohan
ecf00cedb6 Rename BiometricDialog to BiometricPrompt.
Renamed to BiometricPrompt per API-council feedback.

Bug: 77494933
Test: m -j70
Change-Id: Ifed2b8f3439a7e671e0ce46d3a7db9f24871b16a
2018-04-05 10:41:19 -07:00
Vishwath Mohan
cf87df1531 Refactor FingerprintDialog to BiometricDialog
This CL changes FingerprintDialog into the more generic
BiometricDialog, which OEMs will be able to extend as necessary to
provide support for alternate biometric modalities.

Bug: 74831038
Test: m -j50 FingerprintDialog (from the associated CL on this topic)
      The app works and authenticates successfully.
Test: make update-api -j56

Change-Id: Ic398ef0a0b448be68dbe3330b30779f93f567243
2018-03-27 13:15:01 -07:00
Hall Liu
ecd4709573 Merge "Split the DownloadStateCallback class into two" into pi-dev 2018-03-23 23:11:46 +00:00
TreeHugger Robot
4d6dc48d24 Merge changes I7f413e38,I20aba7e9 into pi-dev
* changes:
  Remove FlpHardwareProvider
  Create the stubs lib for com.android.location.provider
2018-03-22 00:29:38 +00:00
Hall Liu
7953997160 Split the DownloadStateCallback class into two
Use individually-registered DownloadStatusListener and
DownloadProgressListener instead to listen for download status and
progress, respectively.

Bug: 74409377
Test: cts
Change-Id: Ifd5289038ffd66eef8bd7916f5256205b49be5f9
2018-03-21 23:39:07 +00:00
Jiyong Park
4cc3a1c056 Remove FlpHardwareProvider
After Treble's FLP merge into GNSS HAL, the FlpHardwareProvider is just
an empty shell. Removing FusedLocation and/or Flp + Hardware classes
altogether.

Bug: 35726697
Test: m -j
Test: Open Google Map and then walk around. The dot moves as I walk.
Change-Id: I7f413e38b57424e8ebb9d7d14d94f145a48d10f8
2018-03-21 10:36:44 +09:00
Philip P. Moltmann
18e3eb8168 Add SoundTriggerDetectionService
The service is meant to replace the PendingIntent based API. Once all
users of the PendingIntent based API switched the PendingIntent based API
will be removed.

To have as little as possible impact on the whole SoundTrigger framework
the RemoteSoundTriggerDetectionService class implements the same
interface as the PendingIntent based class. Hence the exising code has
very little change. Further once the old code can be removed the amount
of changed (and added) code is limited.

The RemoteSoundTriggerDetectionService -> SoundTriggerDetectionService
is a vanilla as possible service implementation. The special behaviors
are:
- The system holds a wakelock while service operations are in progress
and the service is bound as foreground. Hence the service can e.g.
listen to the microphone.
- Service operations have a certain amount of time they are allowed to
run. Once every operation is either finished or the the operation
exceeded the allotted time, the system calls onStopOperation for each
still pending operation. This is a similar model as for the commonly
used JobService.
  Please note that if the time allowed for an operation is 15s and
op1 was run as 0si, and op1 was run at 5s, the service is allowed to run
until 20s. Hence _both_ onStopOperations will happen at 20s. This is
done for ease of implementation but should not give the service more
power than calling onStopOperation exactly 15s after each operation is
triggered.
- If an operation is done before the allotted time is reached, the
service can declare the operation as finished manually by calling
onOperationFinished. This is a call back into the system, hence a
'client' binder is sent to the service. If the operation is finished
by calling this method onStopOperation will not be called.
- As the service instance might be killed and restored between
operations we add a opaque bundle 'params' to each operations. The users
of the API can use this to send data from the start command to the
operations. It can also just be set to null. The params are not meant to
store changing state in between operations. Such state needs to be
persisted using the regular methods (e.g. write it to disk)
- A service can be used for multiple recognition sessions. Each
recognition is uniquelity defined by its sound model UUID. Hence each
operation gets at least tree arguments: Operation ID, sound mode UUID, params
- As a small optimization the params are cached inside of the service
instance.

The time allowed for each operation is in a @SystemAPI global setting,
so the service can make sure it finishes the operations before they are
stopped. It might take some time to deliver the operations via the
binder, hence it is not recommended to try to use every last ms of
allotted time.

Test: atest SoundTriggerDetectionServiceTest (added in separate CL)
      atest android.provider.SettingsBackupTest
Change-Id: I47f813b7a5138a6f24732197813a605d29f85a93
Fixes: 73829108
2018-03-20 13:57:14 -07:00
Kweku Adams
eadd123d68 Dumping stack traces to proto.
Bug: 72177715
Test: flash device and check incident.proto output
Change-Id: Id2a15e0fc62b66efe875949af97f0eb651c7e322
(cherry picked from commit 5c804e2b98)
2018-03-07 21:50:12 +00:00
Logan Chien
71ddfeaf14 Reformat Android.bp file
This commit replaces `=` with `:`, which is more idiomatic.

Test: walleye-userdebug builds
Change-Id: I8fe71e53a4005e44c4bdee2ee23220997b6c3e4f
2018-02-27 16:43:50 +08:00
Svetoslav Ganov
2d20fb47f4 APIs to watch active op changes
System singed components can watch for starting/finishing of
long running app ops. Also protected the APIs to watch op mode
changes with a singature permission for the cross-uid use case.

Test: atest com.android.server.appops.AppOpsActiveWatcherTest

bug:64085448

Change-Id: Id7fe79ce1de4c5690b4f52786424ec5a5d9eb0fa
2018-02-16 18:29:04 -08:00
Logan Chien
404eb2bcd5 Fix PDK build
This commit moves "IConfirmationPromptCallback.aidl" and
"IKeystoreService.aidl" to "system/security/keystore/binder" so that
"libkeystore_aidl" can be built in PDK builds.

Test: Run `cts-tradefed run cts -m CtsKeystoreTestCases` on Pixel 2017
and the test results are idential with and without this CL.

Test: Build PDK with special manifest described in
http://b/69539820#comment18 and http://b/69539820#comment19.

Test: Build a target (described in http://b/72961456) with
`platform.zip` built from master FSK source tree.

Bug: 69539820
Bug: 72961456
Change-Id: I7350f0ca943b15a6f3e40023a6cc299bdf8aed0e
2018-02-14 15:46:50 +08:00
Eric Laurent
1d3cdce9b0 Add audioserver state callback
Add system APIs for components (e.g rild) to monitor native audioserver
state and be able to reaply states after a native audioserver
crash and restart.

Bug: 67317552
Test: manual test.

Change-Id: I2afba9da5fc32b3768ca5ca0d5f97cc68707c408
2018-02-09 18:14:58 -08:00
TreeHugger Robot
4f07fa4e74 Merge "Add support for vibrator HAL 1.2 effects." 2018-02-09 16:36:13 +00:00
Michael Wright
f268bf573f Add support for vibrator HAL 1.2 effects.
Test: atest android.os.VibrationEffectTest
Bug: 64184692
Bug: 64185677
Change-Id: I0b3f9caa04b3e7bdadba5c44188120ac14943f82
2018-02-08 21:24:02 +00:00
Etan Cohen
9accbba1b7 [RTT] Remove the legacy RTT service
Remove the legacy RTT service. RTT requests are already directed to
the new API by a previous CL.

Bug: 65108579
Test: unit tests
Test: WifiRttManagerTest:test_regular_scan_then_rtt_ranging_stress
Change-Id: I436e8bcd2f4e2ba6056870d887eea141fbebae85
2018-02-07 12:36:05 -08:00
Steve Paik
94292a388c Move CarServiceHelperService (again)
Move CarServiceHelperService.java and ICarServiceHelper.aidl from
frameworks/base to frameworks/opt/car/services.

Bug: 72571496
Test: Complies and runs
Change-Id: I0f09c84e25a372dab3f170bd623f25a92f9b0f73
2018-02-06 11:55:10 -08:00
Steve Paik
d2fecf34f9 Revert "Move CarServiceHelperService"
This reverts commit ee47dea99a.

Reason for revert: <INSERT REASONING HERE>

Change-Id: Ie26a7b08cb2d86c71f3d8c8c509d9803d0ad293b
2018-02-03 01:54:11 +00:00
Steve Paik
ee47dea99a Move CarServiceHelperService
Move CarServiceHelperService.java and ICarServiceHelper.aidl from
frameworks/base to frameworks/opt/car/services.

Bug: 72571496
Test: Complies and runs
Change-Id: I3e25cec3db75b5250a0dec4959c32526d6553da6
2018-02-01 17:46:52 -08:00
Jerry Zhang
327b809ad1 Refactor and clean up USB, add tests
Change UsbManager apis to use long instead of string, to match
usb hal. Change UsbDeviceManager internals to match as well.

Remove isFunctionEnabled and add getEnabledFunctions. Callers
would often call isFunctionEnabled for every possible function
to get the list of functions, so getEnabledFunctions reduces the
number of aidl calls.

Separate out dependencies between UsbHandler and UsbDeviceManager
and staticize the UsbHandler classes. Add unit tests with
mocked out dependencies to test state transitions for UsbHandler.

Bug: 62876645
Test: atest UsbTests
Change-Id: I785c4c24121a70e725de9742c6af50a6bf1baea0
2018-01-31 11:40:48 -08:00
TreeHugger Robot
8420d5e596 Merge "Introduce a TextClassifierManagerService." 2018-01-31 05:26:27 +00:00
Brad Ebinger
98e3150570 Merge changes from topic "ims_imsservice_apis"
* changes:
  Modify ImsService API to accomodate compat
  Make ImsService API @SystemApi
  Integrate new MMTel APIs into the framework
  Integrate ImsCallSessionListener API changes
2018-01-30 16:19:42 +00:00
Paul Duffin
2a9cd14900 Merge "Conditionally remove android.test.base from bootclasspath" 2018-01-30 11:20:50 +00:00
Abodunrinwa Toki
d32906c202 Introduce a TextClassifierManagerService.
Apps wanting to use a TextClassifier service (instead of an
in-app-process TextClassifier) bind to this service. The service
binds to and reroutes calls to a configured system TextClassifierService.

TextClassifierManagerService manages the lifecycle of the configured
TextClassifierService and binds/unbinds to preserve system health.

A configurable TextClassifierService extends TextClassifierService,
declares an android.textclassifier.TextClassifierService intent, and
requires a permission that is only granted to the system so only the
system may bind to it.

The TextClassifierManagerService implements a similar interface to
TextClassifierService (i.e. ITextClassifierService) but doesn't have to.
This is done for simplicity sake and things may change in the future.

The configuration of the default service is in config.xml.
OEMs may change this with a config overlay.
If no TextClassifierService is specified, the default in app process
TextClassifierImpl is used.

Bug: 67609167
Test: bit FrameworksCoreTests:android.view.textclassifier.TextClassificationManagerTest
Test: tbd
Change-Id: I8e7bd6d12aa1a772897529c3b12f47f48757cfe6
2018-01-29 17:16:21 -08:00
Jaewan Kim
c599ba36e3 MediaSession2: Move binder interfaces into the updatable
Test: Run all MediaComponents tests once
Change-Id: I29a7aa9d649ea212ad4728ebabff40ec0d47ecb1
2018-01-29 22:43:06 +09:00
Paul Duffin
a3b692113c Conditionally remove android.test.base from bootclasspath
This makes the runtime handling of the android.test.base library
conditional based on a build flag REMOVE_ATB_FROM_BCP.

When REMOVE_ATB_FROM_BCP=true:
* The framework-atb-backward-compatibility is added to the
  bootclasspath instead of android.test.base.
* Any APK that targets pre-P (or has a dependency on android.test.runner)
  has android.test.base added to their library list.

Otherwise:
* The android.test.base library is added to the bootclasspath.
* Any APK that explicitly specifies that it depends on the
  android.test.base library has the library removed as the classes
  are available at runtime.

Added android.test.base to platform libraries so it can be used when
not on the bootclasspath.

Tested both cases by building with or without the build flag, flashing,
setting up, adding an account, adding a trusted place.

Also, tested that all combinations of REMOVE_ATB_FROM_BCP and
REMOVE_OAHL_FROM_BCP work.

adb install -r -g out/target/product/marlin/testcases/FrameworksCoreTests/FrameworksCoreTests.apk
adb shell am instrument -w -e class android.content.pm.PackageBackwardCompatibilityTest,android.content.pm.AndroidTestRunnerSplitUpdaterTest,android.content.pm.OrgApacheHttpLegacyUpdaterTest,android.content.pm.RemoveUnnecessaryOrgApacheHttpLegacyLibraryTest,android.content.pm.RemoveUnnecessaryAndroidTestBaseLibraryTest,android.content.pm.AndroidTestBaseUpdaterTest com.android.frameworks.coretests/android.support.test.runner.AndroidJUnitRunner

Bug: 30188076
Test: as above
Change-Id: I4b9d8a5bed6787cd334c2b13a458bbc0efc3f3b6
2018-01-29 11:48:44 +00:00
Jaewan Kim
379e30d90d MediaSession2: Add listeners for change in session token
Test: Run all MediaComponents tests once
Change-Id: Ic46ad9e4e4c9e1ce43b3dbad904eae7fc30d52a0
2018-01-29 11:57:04 +09:00
Ben Gruver
fbf5892f15 Merge "Implement UI for warn-on-launch" 2018-01-26 18:44:11 +00:00
Ruchi Kandoi
05d7bebe23 Merge "Open Mobile API for frameworks/base" am: 183865f3e1 am: ab8328c047
am: 2729909ab6

Change-Id: Iee488feed404819e487f3ae87b3e71f531fe69a4
2018-01-26 01:43:05 +00:00
Winson Chung
66f0026f3f Merge changes from topics "reland_recents_animation", " reland_recents_animation"
* changes:
  Fix issue with reparenting stacks on displays.
  Revert "Revert "4/ Update SysUI shared lib for Recents transition""
  Revert "Revert "3/ Add input consumer to capture touches during a Recents transition""
  Revert "Revert "2/ Add support for remote Recents animation""
  Revert "Revert "1/ Create display content window controller to position stacks in the display""
2018-01-26 00:46:34 +00:00
TreeHugger Robot
5815664d4b Merge "Add AbstractThreadedSyncAdapter#onUnsyncableAccount API" 2018-01-25 22:47:54 +00:00
Winson Chung
e2d721781f Revert "Revert "2/ Add support for remote Recents animation""
This reverts commit 9f8518e532.

Reason for revert: Testing relanding changes with ag/3515280

Change-Id: I410bd752c815a5b998a719453def01e00a9d47c8
2018-01-25 13:44:44 -08:00
Brad Ebinger
112c36d39f Integrate new MMTel APIs into the framework
Performs the bulk of the work of:
1) Moving the old MMTel APIs to a hidden
.compat namespace to support older vendor
versions of the code.

2) Replace the compat MMTel APIs with the
new ImsService APIs and integrate them
into existing code.

This is one of two CLs, this CL
integrates the new APIs, the next CL
creates the compat layer in telephony
to translate the .compat APIs to the new
APIs to allow Telephony to work with
older versions of the API.

Before commit, the corresponding vendor
changes will have to be submitted as well.

Bug: 63987047
Test: Telephony Unit tests
Change-Id: Icc9ecfdad000f42399beeac142083e62962c12d3
2018-01-25 10:51:27 -08:00
Brad Ebinger
264625486b Integrate ImsCallSessionListener API changes
Integrates the ImsCallSessionListener API changes.
This involves:

1) Moving the ImsCallSessionListener to the
android.telephony.ims namespace.
2) Creating a compat layer between the old
IImsCallSessionListener AIDL and the new one
for vendors using the old implementation.
3) Modify ImsCallSession to only use
setListener to set ImsCallSessionListener
(other method was never used in our code).

Test: Telephony Unit Tests, Manual IMS Tests
Bug: 63987047

Change-Id: I4378c0b1d68ff4f5f21815c81af52c03a66f81c5
2018-01-25 10:50:43 -08:00
Ruchi Kandoi
a1f9401a22 Open Mobile API for frameworks/base
This contribution is an implementation of the GlobalPlatform
Open Mobile API for Android with some modifications to
namespaces and packages to make it suitable as a core
Android component.

This contribution is based on
0001-Open-Source-Contribution-of-Smartcard-Service-for-fr.patch
which can be found in
https://portland.source.codeaurora.org/patches/quic/la/PATCH_217881_OpenMobileAPI_20171206.tar.gz

The submitted patch was derived from
https://source.codeaurora.org/quic/la/platform/packages/apps/SmartCardService/commit/?h=LA.BF64.1.2.1&id=06ecea9abb8264049f52c7e31c0bc13330a425d5.

Test: Sample Application; open Channels and transmit APDUs

Change-Id: Iac5206bd84798ca0fcdb504c89e1da5383012a5a
Signed-off-by: Jeremy O'Donoghue <jodonogh@codeaurora.org>
2018-01-25 18:04:17 +00:00
Philip P. Moltmann
486b24179f Add AbstractThreadedSyncAdapter#onUnsyncableAccount API
This allows for an SyncAdapter to defer all onPerformSync calls (and the
admission check for those) until the adapter is ready to accept those
calls.

Test: atest android.content.cts.AccountAccessSameCertTest
      atest android.content.cts.ContentResolverSyncTestCase
      atest android.content.cts.DeferSyncTest
      atest com.android.cts.content.CtsSyncAccountAccessOtherCertTestCases
      Set up a user and work account and waited until their gmail
      synced.

Bug: 72459220
Change-Id: I8f9ab735d64189578ccdd1c3e1d7b7c5383b8ee9
2018-01-25 00:37:48 +00:00
Janis Danisevskis
7dacad8dc8 Add confirmation UI protocol to Keystore AIDL definition
Test: Manually tested
Bug: 63928580
Change-Id: Ief1cdb9a64737d5aac08aa1c48ff60c34218d5ba
2018-01-24 15:45:08 -08:00
Steven Moreland
cb15919569 Merge "Allow HIDL to be used in priv-apps." 2018-01-24 23:32:38 +00:00
Ben Gruver
c7ffbe636a Implement UI for warn-on-launch
Bug: 63909431
Test: atest CtsHarmfulAppWarningHostTestCases
Change-Id: Icabe31f3fb04692bac0313cbeb1cafb64388d5f1
2018-01-24 14:49:16 -08:00
Wei Jia
8069cd9861 Merge "add MediaPlayer2" 2018-01-24 22:35:43 +00:00
Android Build Merger (Role)
71df9bf176 Merge "Merge "Added network service interface" am: 71793be6bb am: 2b06789511 am: 3748d15321" 2018-01-24 22:33:21 +00:00
Xiangyu/Malcolm Chen
7783ecd755 Merge "Added network service interface" am: 71793be6bb am: 2b06789511
am: 3748d15321

Change-Id: Ia08a840e47d3372772a105ef7b65bb259d07e7f8
2018-01-24 22:32:56 +00:00
Mohamed Abdalkader
41db489a43 Merge "Remove internal version of SMS apis" 2018-01-24 22:32:39 +00:00
Jack Yu
d5f1de19f4 Added network service interface
The interface for mobile network service. This is the base class
for vendor or first party data service provider to implement
the network service for cellular or IWLAN network support.

Test: Manual
bug: 64132030
Change-Id: Ia358cbb18fc6d15dcc45c75f14b7c952f899e101
2018-01-24 19:13:45 +00:00
Wei Jia
0a8a8f0b26 add MediaPlayer2
Forked from 9070e29586
Test: plays local files, callback source and streaming.
Bug: 63934228
Change-Id: I692007c07eb2819f8ad1d843e4e2b1fc96fbecca
2018-01-24 11:03:37 -08:00
TreeHugger Robot
ff73b83831 Merge changes Ia3065eb5,I602e8bb0
* changes:
  Update ProgramInfo to match HAL 2.0 changes.
  Implement front-end APIs for announcements.
2018-01-24 19:00:39 +00:00
Mohamed Abdalkader
48e18c5b4f Remove internal version of SMS apis
Test: manual
BUG=69846044
Change-Id: Ie084ea67c460c686bd587e4b36f8c1579517ea7f
2018-01-24 17:57:26 +00:00
TreeHugger Robot
19630d165e Merge "Support conditional removal of oahl from bootclasspath" 2018-01-24 09:04:39 +00:00
Kevin Chyn
179e117cbe Merge changes from topic "fingerprint-dialog"
* changes:
  Add Fingerprint Dialog to SysUI
  Add FingerprintDialog API and related plumbing
2018-01-24 02:07:54 +00:00
Kevin Chyn
aae4a15a22 Add FingerprintDialog API and related plumbing
This commit adds the plumbing which sends the signals from the API
to the component in SysUI. The dialog will be implemented in another
CL in this topic.

Bug: 67497360

Test: Modify Settings to use the new API
Test: FingerprintDialogImpl is able to notify FingerprintDialog clients
      of user events
Test: System dialog is dismissed when client application is killed
      unexpectedly
Test: Open FP settings, lock device, authenticate, authenticate. Repeat

Change-Id: Id28ec9691646bed765dc069cceb4678d9f6db92e
2018-01-23 14:54:48 -08:00