Commit Graph

26 Commits

Author SHA1 Message Date
Song Hu
468e4332eb Fix sharesheet timeout by sending CreatePredictionSession request immediately instead of pushing it to the main thread Looper queue. CreatePredictionSession request is latency-sensitive.Its sendImmediately flag was flipped to be false accidentally in I937cdaa6081d2b85d27ee0192f6af7f197b8e102.
Bug: 195411307
Test: atest CtsSharesheetTestCases:android.sharesheet.cts.CtsSharesheetDeviceTest
Test: manually test on the device
Change-Id: If7d3f7acadcbed3340616b0ab239c776dedf7af7
(cherry picked from commit 13b9f947e0)
2021-08-06 00:04:20 +00:00
Song Hu
4d4121f85c Implement dark launch logic for sharesheet aiai model.
Route the sharesheet user interaction from PeopleService to Remote Prediction Service, while PeopleService is making inference for sharesheet.
It is guarded by the flag "adb shell device_config put systemui dark_launch_remote_prediction_service_enabled true"

Test: test on local device
Bug: 180933488
Change-Id: I7db52c69224e69ad3125362185e2ffd1a474bb78
Merged-In: I7db52c69224e69ad3125362185e2ffd1a474bb78
(cherry picked from commit 51daca2ea3)
2021-03-22 17:45:00 +00:00
Jeff Sharkey
2d2e07e2ff Tighten up Binder.clearCallingIdentity() usage.
The recently added AndroidFrameworkBinderIdentity Error Prone checker
examines code to ensure that any cleared identities are restored to
avoid obscure security vulnerabilities.

This change is a purely mechanical refactoring that adds the "final"
keyword to the cleared identity to ensure that it's not accidentally
modified before eventually being cleared.  Here's the exact command
used to generate this CL:

$ find . -name "*.java" -exec sed -Ei \
    's/    (long \w+ = .+?clearCallingIdentity)/    final \1/' \
    {} \;

Bug: 155703208
Test: make
Exempt-From-Owner-Approval: trivial refactoring
Change-Id: I832c9d70c3dfcd8d669cf71939d97837becc973a
2020-10-06 11:18:09 -06:00
TreeHugger Robot
e548482d8d Merge "fix app prediction service doesn't clean-up properly." into rvc-qpr-dev am: 4cb7d8c878
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12221409

Change-Id: I880aa857e53bc499837b8cb2c1eeff84137a55be
2020-08-24 18:57:50 +00:00
Treehugger Robot
f2f4e95bac Merge "Update language to comply with Android's inclusive language guidance" am: b6488ac518 am: 1f27abf523
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1375936

Change-Id: Id5597b0e732c599413b60bc5c3e739a53f3fe720
2020-07-29 22:34:17 +00:00
Saint Chou
318bf6cbf7 Update language to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for reference

#inclusivefixit

Bug: 161896447
Change-Id: I81c993e09ccf32b715d1d4df8735a4bd11f53749
Test: NA (Comment only)
2020-07-29 09:35:06 +00:00
Pinyao Ting
d0dd38c4d4 fix app prediction service doesn't clean-up properly.
Currently new app prediction session will be created each time
launcher crashes, this introduces some memory impact since the
existing callbacks are not released after the crash.

The root cause being random UUID was used to create the session,
as a result app prediction service is not able to dedupe it with
against existing sessions.

Bug: 161391868
Test: manual
Change-Id: I937cdaa6081d2b85d27ee0192f6af7f197b8e102
2020-07-27 14:53:32 -07:00
TreeHugger Robot
d48a06e6d9 Merge "Revert "Enable Sharesheet ranking using PeopleService by default to test in Droidfood"" into rvc-dev 2020-06-12 01:31:53 +00:00
Song Hu
80c1856cf6 Revert "Enable Sharesheet ranking using PeopleService by default to test in Droidfood"
This reverts commit 2327596f51.

Reason for revert: <The flag has been propogated from server side to Droidfood devices>

Bug: 157500121
Change-Id: Ic96789cffd6c307147f5a6e279e0729450d4f8c2
2020-06-12 00:12:10 +00:00
TreeHugger Robot
68348d03e3 Merge "Enable Sharesheet ranking using PeopleService by default to test in Droidfood" into rvc-dev 2020-05-27 19:03:57 +00:00
Song Hu
2327596f51 Enable Sharesheet ranking using PeopleService by default to test in Droidfood
The CL would be rolled back after testing PeopleService on Droidfood for
2 weeks.

Bug: 157500121
Test: manual test on the phone.
Change-Id: Icf9c19b1c7c6673226c3fb9eab8c649807696c96
2020-05-27 10:30:12 -07:00
Pinyao Ting
2bc9e49c67 Resurrect app prediciton sessions after destroy and rebind
After App Prediction service restarts, existing app prediction sessions
will be inactive and needs to be resurrected.

Test: flash to physical device and
1. Open a couple of Personal Profile and Work Profile apps and observe
that they make it to the prediction row.
2. Clear storage via the Settings > Privacy > Device Personalization
Services > Personal > Clear data > All time
3. Verify prediction row should start getting updated again for
subsequently opened apps
Bug: 146802640

Change-Id: I74d87e374806b92649a9a3436926fb5bd5572874
2020-05-13 15:06:26 -07:00
Song Hu
d52863d12b Send onCreatePredictionSession, sortAppTargets, requestPredictionUpdate
immediately instead of sending them to main thread Looper queue of
ChooserActivity.

These methods are relatively latency-sensitive. When main thread Looper queue has many backlogs, it takes long time
to dispatch requests.

Bug: 155551642
Test: atest CtsSharesheetTestCases:android.sharesheet.cts.CtsSharesheetDeviceTest
Test: manually test on the device
Change-Id: I7d00e49c6a30fec478e620bc98180d379f801fc8
2020-05-06 10:17:29 -07:00
Pinyao Ting
cfd980acd9 route prediction service session based on device config
Bug: 148173565
Change-Id: I83c100d315609095b427b096d8a1215949849c42
Test: manual override the flag to force routing through
people service, and verify it works.
2020-02-13 18:28:56 +00:00
TreeHugger Robot
5f212d0010 Merge "Revert "enable dynamic binding in AppPredictionSession"" 2020-02-12 08:05:03 +00:00
Pinyao Ting
5052796bf0 Revert "enable dynamic binding in AppPredictionSession"
This reverts commit 6b172567d5.

Reason for revert: Unexpected Crash

Bug: 149282975
Change-Id: I674397398ae40d106f84e6a650f75e77769e9de1
2020-02-11 22:30:42 +00:00
Pinyao Ting
ac68aac0ac Enable App Prediction for Work Profile
call to different instance of AppPredictionPerUserService based on
calling context.

Bug: 148230574
Test: Manual
Change-Id: I5987ed6a80155a8aed7c1985e8edd1ba98e51149
2020-02-10 17:13:32 -08:00
Pinyao Ting
6b172567d5 enable dynamic binding in AppPredictionSession
Before AppPredictionPerUserService instantiates an instance of
RemoteAppPredictionService based on default componentName, do a
component lookup based on app prediction context and session id,
and switches to different service dynamically.

original architecure:
https://sequencediagram.googleplex.com/view/4764463320268800
proposed chages:
https://sequencediagram.googleplex.com/view/6517721785171968

Bug: 148173565
Test: atest AppPredictionServiceTest
Change-Id: Ic522d7ed76adafe06813ba488b83e222d61b23c1
2020-02-03 14:39:47 -08:00
Mehdi Alizadeh
23e044d09d Rebind to the remote service if AppPrediction is restarted or updated
Rebind to the remote AppPredictionService when the service package is
updated. Also adds new restart policy flags in
AbstractMasterSystemService to be able to keep per-user instances in the
cache when service restarts as a result of package data getting cleared,
so that we can revive the existing sessions. This would potentially fix
the issue for other services that try to keep the sessions over data
resets.

Bug: 139445447
Test: Reinstall the AiAi package and verify that suggested apps in launcher are getting updated
Test: Clear data for Device Personalization Services and verify that suggested apps in launcher are getting updated
Test: atest CtsAppPredictionServiceTestCases CtsContentCaptureServiceTestCases

Change-Id: Ie835cb159faa9c0718cd63a3045251444b89e505
2019-08-28 20:21:49 +00:00
Mehdi Alizadeh
8b6d5a36ee Use RemoteCallbackList to store registered callbacks
Bug: 134680085
Test: Verified no errors in logcat while closing the ShareSheet
Test: Enable debug flag and verify the logs by killing the client and the servicer
Kill launcher: adb shell killall com.google.android.apps.nexuslauncher
Kill service: adb shell killall com.google.android.as

Change-Id: I706bd0f7224f24bd774ed009babc5f73e12629ca
2019-06-19 15:35:25 -07:00
Mehdi Alizadeh
056ac838fe Restores state of AppPredictionService after remote service crash
Bug: 130183389
Test: Manual test by killing the remote service (following steps)
  1) adb shell killall com.google.android.as
  2) Launch a few apps on the test device
  3) Verify that the suggested apps in All Apps has been updated

Change-Id: Ia96ece071b3c9fb22564e7367e9bad66828385c0
2019-05-30 12:28:37 -07:00
Sunny Goyal
a58d916a69 Protecting AppPrediciton API behind usage stats permission
Bug: 130556904
Test: atest CtsAppPredictionServiceTestCases:AppPredictionServiceTest
Change-Id: I1033e12f5c75ab085d1a0ebff81437ee141528ea
2019-04-24 13:32:52 -07:00
Michal Karpinski
322df0bb74 Modify AbstractRemoteService#mBindInstantServiceAllowed to #mBindingFlags
in order to support multiple binding flags

And supply BIND_ALLOW_BACKGROUND_ACTIVITY_STARTS for RemoteFillService.

Test: atest CtsAutoFillServiceTestCases
Test: atest AutofillManagerServiceTest
Bug: 126267782
Change-Id: Id5262d6a4e0fde0ad874020f783cfbf72fe201f4
2019-03-26 11:07:33 +00:00
Sunny Goyal
c2baa4d724 Updating onLocation related APIs to onLaunchLocation as per API review
Bug: 126179809
Bug: 126180256
Test: everything compiles

Change-Id: I583f96bd5f5b5042131488a9ad5950cbad298071
2019-03-21 18:03:48 +00:00
Hai Zhang
a4959e569d Add RoleControllerManager for role controller service.
This allows us to expose both system-only and app available APIs for
role in RoleControllerService.

Bug: 127691087
Test: manual
Change-Id: I86fe3736fc28516aae25d48efe3ba599ffdf45d5
2019-03-07 21:33:12 -08:00
Sunny Goyal
54e91344e2 Adding initial implementation of Prediction client/service API
Test: Build sample app, ensure that app prediction service gets client
      requests
Bug: 111701043
Change-Id: I33aceb2de31552b2d740dc333559d68728753e40
Signed-off-by: Winson Chung <winsonc@google.com>
2019-01-10 15:53:25 -08:00