286 Commits

Author SHA1 Message Date
Hall Liu
49d1cb4770 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
Merged-In: Ifd5289038ffd66eef8bd7916f5256205b49be5f9
2018-03-26 21:45:21 +00:00
Hall Liu
3f65260be7 Merge "Split the DownloadStateCallback class into two" into pi-dev
am: ecd4709573

Change-Id: I09cdcd69729ac917ac7290d4e1efcf4d9dbc0530
2018-03-24 00:31:02 +00:00
Hall Liu
ecd4709573 Merge "Split the DownloadStateCallback class into two" into pi-dev 2018-03-23 23:11:46 +00:00
Nan Zhang
f33e1947b7 Add additional droiddoc options for stubs-api
There's slightly different for droiddoc options between AOSP and
internal Master. So set droiddoc options to be consistent with current
ones in internal Master.

Test: m android_stubs_current
Bug: b/70351683 b/76179848
Change-Id: I3b87021b8a882e0934faedf51a9f84c996654c1f
2018-03-23 01:04:02 -07:00
Jiyong Park
189cc7df45 Merge changes I7f413e38,I20aba7e9 into pi-dev
am: 4d6dc48d24

Change-Id: Ib63541d0924b400580d62513864d790a02021de9
2018-03-22 00:46: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
Philip P. Moltmann
9dd3e7d300 Add SoundTriggerDetectionService
am: 18e3eb8168

Change-Id: I4bb7ada74c36df4a64956c9c36a1675aad1f6645
2018-03-21 06:00:01 +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
Nan Zhang
7bfac8dce2 Remove Make side (system/test-)api-stubs droiddoc targets
Remove old droiddoc targets for api-stubs, system-api-stubs, and test-api-stubs.

And also set api_tag_name, api_filename, private_api_filename, and etc.
properties in Android.bp for new droiddoc.
Test: manually compare if dependencies change after Soong based droiddoc runs.
Bug: b/70351683

Change-Id: I8d944c83de120ec8148276adc1c9872113d9d29b
Merged-In: I8d944c83de120ec8148276adc1c9872113d9d29b
2018-03-20 16:22:30 -07: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
Nan Zhang
54963cba91 Remove Make side (system/test-)api-stubs droiddoc targets
Remove old droiddoc targets for api-stubs, system-api-stubs, and test-api-stubs.

And also set api_tag_name, api_filename, private_api_filename, and etc.
properties in Android.bp for new droiddoc.
Test: manually compare if dependencies change after Soong based droiddoc runs.
Bug: b/70351683

Change-Id: I8d944c83de120ec8148276adc1c9872113d9d29b
Merged-In: I8d944c83de120ec8148276adc1c9872113d9d29b
2018-03-20 11:43:51 -07:00
Nan Zhang
538e615919 Remove test/* from API stubs jars generation.
Test: Generated old and new API stubs jars. And
cd /tmp/new/; find . -type f -name "*.class" -exec md5sum {} \+ | ( cd /tmp/old; md5sum -c --quiet )

Bug: b/70351683
Change-Id: If5e668cca483f54646fb64776b24c95044092620
2018-03-12 14:11:57 -07:00
Nan Zhang
f9ac62dddb Merge "Convert api-stubs, system-api-stubs, and test-api-stubs target" am: baa37dbbad
am: 5a4b586e28

Change-Id: I880168e468e06a0351ad9e084e108cd46f8ca1d3
2018-03-10 00:38:00 +00: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 5c804e2b9893c7892900148229cf19fa6268e7dc)
2018-03-07 21:50:12 +00:00
Nan Zhang
172875bdd2 Convert api-stubs, system-api-stubs, and test-api-stubs target
The output generate a .srcsjar instead of a directory of java files.

Bug: b/70351683
Test: compare source-file-list, and ninja rule.

Change-Id: I987601c4baa6f94b5208d3d4106cf60323329af8
2018-03-05 16:23:50 -08: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
Calin Juravle
1d875ad3ae Add SystemApis to expose runtime profile information
The API allows a system apps which acquired
{@code android.permission.READ_RUNTIME_PROFILE} to snapshot the runtime
profiles of installed packages.

The API is implemented in a new service class (AndroidRuntimeManager)
accessible from the context using
context().getPackageManager().getAndroidRuntimeManager().

The main functionality is exposed as a one way call into the
AndroidRuntimeManager with the result being posted on a callback. The
profile is available to the caller as a read-only ParcelFileDescriptor.

This CL only adds the API interfaces and validation. It does not fully
implement the functionality.

oneway void snapshotRuntimeProfile(in String packageName,
  in String codePath, in ISnapshotRuntimeProfileCallback callback)

(cherry picked from commit 45f8b29ce0ca9f80c586850c4be3a1e552bc6c2f)

Bug: 30934496
Test: gts-tradefed -m GtsAndroidRuntimeManagerHostTestCases

Merged-In: Iaa6be4715840f24508acba3162ea9c1ab725bd38
Change-Id: Iaa6be4715840f24508acba3162ea9c1ab725bd38
2018-02-14 08:00:56 -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 ee47dea99adebb4b10ad95b744bb53b5d5f5b606.

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
Brad Ebinger
5b1883b5f1 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
Merged-In: Icc9ecfdad000f42399beeac142083e62962c12d3
Change-Id: Icc9ecfdad000f42399beeac142083e62962c12d3
2018-02-01 15:45:29 -08:00
Brad Ebinger
6ed4ee6847 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
Merged-In: I4378c0b1d68ff4f5f21815c81af52c03a66f81c5
Change-Id: Id0cc43e9c97abb6f2776d8ad1cf599353b71e4b7
2018-02-01 15:45:28 -08:00
Mohamed Abdalkader
7073c075fb Remove internal version of SMS apis
Test: manual
BUG=69846044
Merged-In: Ie084ea67c460c686bd587e4b36f8c1579517ea7f
Change-Id: Ie084ea67c460c686bd587e4b36f8c1579517ea7f
2018-01-31 11:55:39 -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
Mohamed Abdalkader
6e545d5892 Move Sms API to proper MMTelFeature class
- while here remove unnecessary call to ackSms from
  SmsImplBase as this is handled by ImsSmsDispatcher

Test: None, APIs not exercised yet.
BUG=69846044
Merged-In: Iec4bbd07a67502dbbfb2142a7bc95f51be0cb377
Change-Id: Iec4bbd07a67502dbbfb2142a7bc95f51be0cb377
2018-01-31 11:24:31 -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 9f8518e532e41ba57916afc49bba72bc23ad3eda.

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