Commit Graph

2020 Commits

Author SHA1 Message Date
Joanne Chung
b50ab4bab8 Allow to use ExtService as TextClassifierService
1. Define a trust TextClassifierService list which contains ExtService. And
also define a DeviceConfig flag which can be set to the TextClassifierService
we would like to use. Because the TextClassfierService can be set to a side-load
app, e.g. CTS tests. If the override flag is not one of the packages in the
trust TextClassifierService list, it should be able to see only text from
its own UID.
2. Made TextClassifierService available for testing.
3. Fix the incoreect order for onConnected().
4. Fix API Lint errors.

Bug: 141111813
Bug: 143249163
Test: atest FrameworksCoreTests:android.view.textclassifier
Test: Manual. dumpsys to check current TextClassifierService. Change flag
to another service, and then check TextClassifierService changing to
expected TextClassifierService.
Test: Manual. Use local TextClassifierService to make sure the service
call order of connection callback and API call is correct.
Change-Id: I37ff298f0c65ae0469bd54e30f1ebf48b77c126c
2019-11-06 13:38:56 +08:00
Amit Mahajan
531b169d30 Merge "Create @SystemApi CarrierMessagingServiceWrapper." 2019-10-31 17:06:40 +00:00
Amit Mahajan
92642659e8 Create @SystemApi CarrierMessagingServiceWrapper.
This is primarily a wrapper over ICarrierMessagingService
that to create a stable API to communicate with CarrierMessagingService.

Test: basic messaging sanity
Bug: 143609473
Change-Id: I67fda8bab3902b358c483f992633dbdfe3a8cda2
2019-10-30 13:31:25 -07:00
Joanne Chung
f1533e7294 Merge "Add callbacks when TextClassifierService connection status change" 2019-10-29 02:06:51 +00:00
Satakshi Rana
70694b005d Merge "Allow passing the bitmap to ContentSuggestionsService via the extras Bundle" 2019-10-25 14:59:15 +00:00
TreeHugger Robot
ddd425e522 Merge "change KeyphraseEnrollmentInfo to store services" 2019-10-25 03:08:40 +00:00
Satakshi
c45d86fc15 Allow passing the bitmap to ContentSuggestionsService via the extras Bundle
This change creates a constant in ContentSuggestionsManager, which will
be used to pass a hardware bitmap to ContentSuggestionsService.
In the presence of this key in the request extras, we skip taking a
snapshot in ContentSuggestionsPerUserService.
Bitmap is extracted from reading this value from extras in
ContentSuggestionsService.

Test: Manually tested this code in the debugger to verify that snapshot
is not taken when constant is provided in extras.

Change-Id: I4a464d5188bd3eac9afb4ac223611dccab01510f
2019-10-24 17:46:22 +00:00
Joanne Chung
0b7c0d4e32 Add callbacks when TextClassifierService connection status change
Add onConnected() and onDisconnected() when TextClassifierService
connect status change. TextClassifierService can do initialization
in onConnected() and do cleanup work in onDisconnected(). These
callbacks also benefit tests to test some behavior after service
connected/disconnected.

Bug: 141111813
Test: Manual. Bind service and make sure onConnected() is called,
unbind service and make sure onDisconnected() is called.
Change-Id: Ic87f00e8fd6679ef8606feba728ad9db6ae6285e
2019-10-24 10:15:17 +08:00
Peter Wang
f5b33dff5e Merge "Fixed java doc for EuiccService#eraseSubscriptions" 2019-10-22 20:36:28 +00:00
Peter Wang
fac73bd00b Fixed java doc for EuiccService#eraseSubscriptions
Bug: 143138878
Test: on device
Change-Id: I2a9ab4fe4e1c48fc7e7178b1de9b1f72b0408183
2019-10-22 11:36:42 -07:00
TreeHugger Robot
42d4afcd45 Merge "Enhances the title and the positive button style on the save UI" 2019-10-22 03:21:34 +00:00
Chen Xu
3321171cc7 Merge "non-mainline telephony related AIDL refactor/decoupling" 2019-10-17 18:27:13 +00:00
Chen Xu
1f6cfa5399 non-mainline telephony related AIDL refactor/decoupling
1. decouple IOnSubscriptionChangedListener AIDL from telephonyMainline
2. other refactor. moving APIs which will not be included in
telephony mainline to frameworks/base/core/java/android/telephony.
Moving internal classes like AIDL which will not be included in
telephony mainline to
framework/base/core/java/com/android/internal/telephony

Bug: 140908357
Test: Build & unit test
Change-Id: I9413ef758cceadd251d03f3b5ea1054cc48ef044
2019-10-16 15:30:24 -07:00
Fabian Kozynski
d115b75c4d Merge "Add support for BooleanState in CustomTile" 2019-10-16 13:07:49 +00:00
TYM Tsai
7d1a44ec71 Enhances the title and the positive button style on the save UI
1. Provides new types for save UI title which makes the user easier to
distinguish between credit and debit cards.
2. Provides new styles when the autofill service requires next action
before saving the filled content.

Bug: 133515042
Test: manual
Test: atest CtsAutoFillServiceTestCases
Change-Id: I4583d98c1d585eeaa9ac36081d6e3f667a0c408c
2019-10-16 19:59:49 +08:00
Peter Wang
95c3d10f3a Merge "Add EuiccCardManager.ResetOption to eraseSubscriptions" 2019-10-09 22:45:11 +00:00
Nicholas Ambur
af25ee2978 change KeyphraseEnrollmentInfo to store services
Revert "Revert "change KeyphraseEnrollmentInfo to store services""
This reverts commit f2c31a51ee.

Bug: 139954183
Test: confirmed hotword enrollment is successful as a service after
device factory reset.
Change-Id: I41b78ba2b15c30c62d4ead55610fe44913741f2d
2019-10-08 13:24:23 -07:00
Peter Wang
0c1297b2d7 Add EuiccCardManager.ResetOption to eraseSubscriptions
Bug: 139474431
Test: on device
Change-Id: Ib8496ed6dbc6179940892de8df7901e84dd67d76
2019-10-07 17:25:18 -07:00
TreeHugger Robot
b63f979a6a Merge "Added REQUIRED_ALGO_CREDIT_CARD to field classification." 2019-10-04 04:33:10 +00:00
Adam He
345055d59c Added REQUIRED_ALGO_CREDIT_CARD to field classification.
Bug: 135629019
Test: atest ExtServicesUnitTests
Change-Id: I26cc3663ab7c8eb04ce89ff1d77a507e684a87a8
2019-10-02 13:33:58 -07:00
Beverly
85dfc2e225 Ringer toggle always affects system sounds
Background:
- When DND is on, users can allow "touch sounds" (system sounds) to bypass DND
- The user-visible ringer stream and toggle controls notification,
ringer, and system sounds

Previously, allowing system sounds to bypass DND overrode the ringer
from affecting the system sound stream which made the volume
functionality of touch sounds different from in/out of DND.

This fix ensures that DND always respects the fact that the ringer toggle and stream
controls notifications, ringer, and system sounds at all times (whether in/out of DND).

Test: atest ZenModeHelperTest
Test: atest ZenModeConfigTest
Test: atest AudioManagerTest
Test: atest AudioManagerTest#testPriorityOnlySystemDisallowedWithRingerMuted
Test: atest AudioManagerTest#testPriorityOnlySystemAllowed
Fixes: 141292611
Change-Id: I6e36097f18a93ce554b3fad7e1a2bd1057ac9e1d
2019-09-27 20:06:11 +00:00
TreeHugger Robot
109d8ab84a Merge "Fix reference to config property in TextClassifierService javadoc" 2019-09-27 11:41:37 +00:00
Chen Xu
a56786981e Merge "new TelephonyRegistryManager" 2019-09-24 18:32:48 +00:00
Nikita Dubrovsky
942db108c3 Fix reference to config property in TextClassifierService javadoc
The javadoc referenced "config_defaultTextClassifierService" but the
correct property name is "config_defaultTextClassifierPackage".

Test: build (javadoc-only change)
Change-Id: I2e3b19563d94cdede9498782dc840e04a85c25c1
2019-09-24 10:49:19 -07:00
Fabian Kozynski
05843f07cc Add support for BooleanState in CustomTile
Added API for a TileService to declare that they are a boolean tile. In
that case, the tiles behave like frameworks tiles when using TB.

Test: atest CustomTileTest
Test: manual, added to DevelopmentTiles and observe behavior
Test: manual, Grayscale behavior doesn't change
Bug: 138579147
Change-Id: I2f2dae90a49897015138ab9615a4a556da623358
2019-09-23 20:34:15 +00:00
Chen Xu
288b71c8c1 new TelephonyRegistryManager
today telephonyRegistry lives in system process
this is intended to persists all telephony listeners when
phone process crash. Telephony today notify system server by
using AIDL APIs directly. Instead, we are exposing a proper API
surface: telephonyRegistryManager where only phone app and
carrier privileged apps are allowed to use APIs in
TelephonyRegistryManger to notify telephony related status update.

Bug: 140908357
Test: Build & Manaul
Change-Id: I1b750751148925b4a7bd94553318907654012fc1
2019-09-22 19:56:39 -07:00
Nicholas Ambur
c75ccb8903 Merge "Revert "change KeyphraseEnrollmentInfo to store services"" 2019-09-20 22:49:03 +00:00
Nicholas Ambur
f2c31a51ee Revert "change KeyphraseEnrollmentInfo to store services"
This reverts commit 07ba2b7f83.

This change is being reverted because it needs to be paired with an AGSA
prebuilt APK update.

Test: Confirm prebuilt AGSA apk does not crash on enrollment
Bug: 141155032
Change-Id: Ie504f125966d38a11c65ae96f39e9a5aa7ce43ed
2019-09-18 08:36:27 -07:00
Lyn Han
405e0b705e Dedup smart reply updates for bubble flyout
Smart reply updates are not visually interruptive and bubbles should not
show flyout for them, since flyout text remains the same.

1) Modify NoMan.isVisuallyInterruptive to skip evaluation of fields
irrelevant to bubbles

2) Modify NotificationComparator to rank interruptive notifs higher

3) Pipe bool (isInterruptive) from system_process to SysUI
	NoMan --- set bool on notif record and ranking
	Ranking --- parcel bool for cross-process transport
	SysUI notif entry --- get bool from ranking
	SysUI bubble data --- on notif entry update, suppress flyout if isInterruptive=false

	Considered adding "isInterruptive" bool to StatusBarNotification.
	Did not because "visually-interruptive" is additional information that the
	system figured out and SBNs should be limited to info from the app.

4) NoMan --- schedule ranking update if interruptive changes for bubble

Fixes: 138755533
Test: manual - send one sms => flyout appears once
Test: manual - send multiple sms in a row => flyout appears for each one
Test: atest FrameworksUiServicesTests
Test: atest NotificationComparatorTest
Test: atest SystemUITests
Change-Id: Id4b855054689ee73a109bb7cd18004531b41f28c
(cherry picked from commit 0dddc61824d091e48962e36939828cae3cde2aa9)
2019-09-18 10:05:50 -04:00
Chen Xu
8474c6b9b4 Merge "move IApnSourceService.aidl to android.service.carrier" 2019-09-18 04:06:44 +00:00
Chen Xu
478ba408d3 move IApnSourceService.aidl to android.service.carrier
Bug: 140908357
Test: Build & Manual
Change-Id: I21b83798f5ecd819627a7168c167cf3cfe99dd68
2019-09-16 18:16:46 -07:00
Nicholas Ambur
07ba2b7f83 change KeyphraseEnrollmentInfo to store services
Current hotword enrollment is done through a transparent activity which
when triggered causes a breif interuption on the UI. Because there is no
actual UI component to this activity, it is being transitioned from an
activity to a service.

applications supporting MANAGE_VOICE_KEYPHRASES are moved from ativity
to service based to allow for enrollment which does not effect the UI

Bug: 139954183
Test: confirmed enrollment and unenrollment intents can start the
registered enrollment service.

Change-Id: I1e2d80e08efaf47a5c1c8760e2979143df436a93
2019-09-16 16:54:43 +00:00
TreeHugger Robot
a3da049fb3 Merge "Fix zen alarms only mode check" 2019-09-05 19:05:06 +00:00
Julia Reynolds
5cb8d5a6c3 Address API review feedback
Make methods fully public, add documentation, swap what method is public

Test: make
Fixes: 139833596
Bug: 138589409
Change-Id: If39d6423efedcf8578dc2942274f6fbb341d164a
2019-09-05 16:22:29 +00:00
Michele
856102468d Removal of usage of hidden APIs
Moved RESOLUTION_ACTIONS from EuiccService to EuiccResolutionUiDispatcherActivity,
so that it does not need to be made public.

Bug: 137202333
Test: compilation
Change-Id: If8011bbe6af32c038f55d851acc2406eba208de6
2019-09-04 13:52:31 -07:00
Beverly
1f11492ea7 Fix zen alarms only mode check
Also fixes setting the consolidated zen policy logging.

Fixes: 140329813
Test: android.app.cts.NotificationManagerTest#testTotalSilenceOnlyMuteStreams
Test: android.app.cts.NotificationManagerTest#testAlarmsOnlyMuteStreams
Change-Id: I43d503ac23d7b0b141930d77cb76f1f589b22525
2019-09-04 14:11:14 +00:00
Aurimas Liutikas
4d1699da48 Add missing nullability annotations.
To prepare for enabling MissingNullability Metalava check this CL
works on adding missing nullability issues that metalava flags if
we tell it to flag new things since API 29.

This is not a complete CL, mostly addresses public api and
toString/equals for @SystemApi

Exempt-From-Owner-Approval: Large scale nullability clean up
Bug: 124515653
Test: make -j checkapi
Change-Id: I109260842cfc25f06e40694997fcbb4afa02c867
2019-08-29 17:15:44 -07:00
Tony Mak
cdc81e8aff Hold a strong reference to the callback in TextClassifierService
Issue:
TextClassifierService failed to invoke the callback to send the result back
to client occasionally because  the callback object may be GCed.
And thus smart selection failed occasionally, as the client doesn't get
a response back when it hits this issue. It won't fallback to local
textclassifier due to the timeout specified in TextView.

Cause:
We thought that ITextClassifierCallback is a "cross process" reference, and
so we only store a weak reference of it to avoid leak.
And it turns out that it is wrong. As soon as the weak ref gets GCed in
the service, that counts as dropping the callback. The service doesn't
know about any strong references the client has.

Bug: 138865849

Test: Try smart selection over 30 times, make sure smart action is shown
for every single time.

Change-Id: Ia9218cf67e8d67697a0fdff22c7918a55efc39ca
2019-08-22 15:17:09 +01:00
Joanne Chung
d38b888249 Merge "Log the error of TCS, TCMS and SysTC." 2019-08-22 02:03:14 +00:00
Julia Reynolds
9ef59c953d Merge "Make some APIs used by ExtService module @SystemApi" 2019-08-21 13:05:11 +00:00
Joanne Chung
0b7c2c4135 Log the error of TCS, TCMS and SysTC.
TextClassifierService passes the error message to onFailure() when it fails
to process the task. But the error message was dropped at TextClassifierService
right away which makes debugging hard. Log the error at the place where the
error happens to help debugging.

Bug: 139114128
Test: Manual. Use DefaultTCService to pass error message and make sure
the error log is printed.

Change-Id: I7c848a6e96db85d6e5b4f90ee9677dfe5b703149
2019-08-21 16:47:53 +08:00
Zim
e1c49ce35d Add ExternalStorageService API
The ExternalStorageService implementation will live in android.process.media
It will orchestrate filesystem IO from apps coming from an upper filesystem
to a lower filesystem

Test: m
Bug: 135341433
Change-Id: I9b132ce7e5e5985ef3307c75ce7db50affc65a8e
2019-08-21 08:02:47 +01:00
Julia Reynolds
a10437f460 Make some APIs used by ExtService module @SystemApi
These are all pieces of data apps could get anyway;
these are code nice-to-haves to reduce code replication

Test: make
Bug: 122138479
Bug: 138589409
Change-Id: Ie8ffacb6c28840f779c68f7aa95f1405e70f5ce5
2019-08-19 11:32:12 -04:00
Rubin Xu
ca6ece54cc Clean up exception usage in LockSettingsService (part 1)
RemoteException are thrown when someone invokes a binder call
but the binder calls fails due to technical reasons (the remote
process died; data sent through binder is too big etc). Right now
in LockSettingsService most RemoteExceptions are just blindly
bubbled up through the call chain. This has the issue that it
will be silently ignored if this is part of some app calling into
LSS via binder, because RemoteException cannot be propagated
across binder at the moment. To fix this, we look at each place
within LSS where RemoteException is thrown and take the following
action:

* If the RemoteException is not critical, just swallow it in place
  and emit a log.
* If it's critical (LSS cannot carry on with the failed invocation):
  ** Rethrow as IllegalStateException (which is binder-compatible)
     so it fails fast.
  ** Unless the surronding method has appropriate error return semantics
     which can be adopted instead. In this case, swallow the exception,
     return error code, and emit log.

Bug: 128831839
Test: atest frameworks/base/services/tests/servicestests/src/com/android/server/locksettings

Change-Id: I4e19b8e63a86e5477933bf21c718771e9018e718
2019-08-14 17:03:38 +01:00
Narayan Kamath
bb748c592b Merge "AutofillFieldClassificationService: Mark constructor as @SystemApi" 2019-08-12 12:34:12 +00:00
Narayan Kamath
51f3f610f9 AutofillFieldClassificationService: Mark constructor as @SystemApi
The class is abstract and marked as a SystemApi, but there's real
way to use it while compiling against the system_sdk unless the
constructor is also public.

Test: make update-api
Test: make
Bug: 138589409
Change-Id: Id1fe158ec55b299325bfbc16ab1ea33cd53fc123
2019-08-09 15:17:26 +01:00
Eugene Susla
f366188dac Merge "Use dataclass codegen on a few initial framework classes" 2019-08-07 22:51:23 +00:00
Julia Reynolds
c562fc6937 Prevent NPEs in NLSes
NLSs (rightly) assume that the SBN they get from
onNotification[X] calls will not be null. If it is, log and bail early.

Bug: 78279961
Test: reboot device
Change-Id: Id2bba6b15aeea2d701d92d6c63022463f0f8c1df
2019-08-07 10:50:44 -04:00
Eugene Susla
3b2fe616fd Use dataclass codegen on a few initial framework classes
Test: presubmit
Change-Id: Ide3c21596f6489fdb1db8f72e1436a01b10f56ed
2019-08-06 21:29:29 -07:00
TreeHugger Robot
f80171ef5c Merge "Dispose InputChannel when dispose InputEventReceiver" 2019-08-05 05:28:21 +00:00