Commit Graph

98 Commits

Author SHA1 Message Date
Julia Reynolds
99a5975af8 Update logic about parent and convo channels
To handle the case where an app sends a notification directly
to a custom channel, and to properly show priority markings
on conversation tiles

Test: atest; manually ensure convo tiles are marked as priority
Fixes: 184709662
Change-Id: I8f9b6169943da5670bc09fd16bbe692fd43d2cf6
2021-06-09 14:28:17 +00:00
Flavio Fiszman
d9d1e8e6d6 Hide demoted conversations from People service
Change-Id: I8b2c3810aeca388a6fa7235f853458ef1fd474b6
Test: DataManagerTest
Bug: 181929846
2021-06-04 14:47:20 +01:00
Anna Zappone
7673e9e278 Fixes for Test App e2e working and UX polish.
- Clears binder identity before scheduling status expiry to avoid
SecurityException crash.
- Fixes duplicate "days days" on last interaction.
- Allows the "name" to wrap lines on 2x1 if there is no last interaciton
time showing.
- Update story ring to correct colors

Bug: 183084168
Fixes: 189095017, 180839900
Test: PeopleTileViewHelperTest
Change-Id: I7adc3d6608ffe8c3626b03f411650271de10cb8b
2021-05-24 22:08:39 +01:00
Anna Zappone
5bed8adb76 Update last interaction storage notification clear
Add debug logging as well, and mimic the same logic in
PeopleSpaceWidgetManager to avoid the extra Binder call

Bug: 182195735
Test: DataManagerTest
Change-Id: I4d042e26d00f421a24203cc659fb3a376f9df033
2021-05-06 15:49:03 +01:00
Anna Zappone
6de947c807 Update on shortcut changes and statuses cleared
Test: DataManagerTest
Bug: 178792356
Change-Id: I75499d7fe856222499689ef4b5c5be1c064211a9
2021-04-16 16:51:54 +00:00
Anna Zappone
8ebe79c94e Add more logging to confirm storage issue
Discovered bug that shortcuts sometimes disappear. Add logging so we
can confirm this root cause consistently causes the storage loss, or
find out there's more storage issues to investigate.

Test: local
Bug: 182286433
Change-Id: If2d4ac0d6960d57bb53193dc063a6fd85c620396
2021-04-07 21:52:00 +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
Anna Zappone
4b65ce05ca Add listener for conversation changes
Add hidden ConversationListener and registration in PeopleManager
for People Tiles to register a listener to individual
conversation storage changes for targetted updates.

Test: DataManagerTest, PeopleServiceTest, PeopleManagerTest
Bug: 178792356
Change-Id: I0cab6913c138d6ac515fed74741dd62bf967772b
2021-02-17 21:49:32 +00:00
Flavio Fiszman
d243c60e63 Creates PeopleManager API isConversation
Change-Id: I075cd72363ba0ea0e84bb57fe017fce20e051862
Test: atest DataManagerTest
Bug: 180122164
2021-02-17 10:51:12 +00:00
Anna Zappone
5e0e2cbeae Fill Status data in ConversationChannel
For People Tiles to access the statuses associated with the
conversation.

Bug: 178792356
Test: DataManagerTest
Change-Id: I10763861f6ec4bf010be27b7aa0baa1038a0f087
2021-02-01 12:00:48 +00:00
Anna Zappone
30ebaa214a Expose new PeopleService API for People Tiles
Avoid over-querying data by returning a single ConversationChannel when
requested by shortcut ID.

Test: DataManagerTest
Bug: 178792356
Change-Id: I181682b70022d1ce0b055ce1e7c97f5b84c6f1f0
(cherry picked from commit d546f62063)
2021-01-29 14:49:55 +00:00
Danning Chen
805b216fa9 Merge "Reduce the lock protected scope in People Service ConversationStore" 2021-01-15 20:44:00 +00:00
Danning Chen
f7eba62bef Reduce the lock protected scope in People Service ConversationStore
This is to decrease the chance of ANR.

Bug: 177487386
Change-Id: I4b96e56f588c4c20c0878de9c02e6ed65c505063
Test: Manual test
2021-01-14 16:22:46 -08:00
Julia Reynolds
dfbdf8bc8b Handle start and end times of convo statuses
Test: atest DataManagerTest
Bug: 163617224
Change-Id: Iab2139740d427001f64b5666f791ba8890ea9cf9
2021-01-12 16:40:12 -05:00
Julia Reynolds
071f0a46fc Add a status API for conversations
Status are transient pices of information about the current
activities or availability of someone in a conversation. They
may be shown in places where conversations are shown.

Test: atest, cts
Bug: 163617224
Change-Id: I4b61bc3b7f338e9c8cae2c6142622a7040547ddb
2021-01-11 10:15:08 -05:00
Flavio Fiszman
95db66d97e Merge "Populate Persons data in ShortcutInfo." 2020-12-03 18:47:29 +00:00
Danning Chen
90235274e7 Merge "Fix the SecurityException in PeopleServiceTest" 2020-12-01 21:58:54 +00:00
Flavio Fiszman
3d40eeb9a3 Populate Persons data in ShortcutInfo.
Test: ShortcutHelperTest & verified manually that calls returns Persons
Change-Id: I3f36fd29894d9581af433a4b77caa346f5df2041
2020-12-01 14:17:13 +00:00
Danning Chen
80e5830e7c Fix the SecurityException in PeopleServiceTest
Test: atest FrameworksServicesTests:PeopleServiceTest
Bug: 174044734

Change-Id: I1ece77b363dae0a81687eff20e43a51918956d5a
2020-11-23 16:22:16 -08:00
Trung Lam
04b12fdaf8 Merge "Fix issue with saving protos to disk during shutdown." am: 68e0de029a am: 26fcba8c97 am: 32d142933e am: 043ebe229e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1492076

Change-Id: Iab62af81ff2aafba850f93f40d2e29f358754591
2020-11-10 18:05:49 +00:00
Trung Lam
043ebe229e Merge "Fix issue with saving protos to disk during shutdown." am: 68e0de029a am: 26fcba8c97 am: 32d142933e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1492076

Change-Id: I49f5241d403b5f2b959a2967612e0c5790076c29
2020-11-10 06:50:31 +00:00
Trung Lam
f1ab984b11 Fix issue with saving protos to disk during shutdown.
Test: Built and tested on device.
Bug: 172789268
Change-Id: I9cb65e7560f92387e92234929a0b7881f84d7b8f
2020-11-09 08:27:39 +00:00
Julia Reynolds
61bf3a9e8e Support for "recent conversations"
- Provide some extra information needed to display conversations
and to create their conversation specific channels
- Uncache unmodified recent conversations after 10 days

Test: atest
Bug: 171191376
Change-Id: I33ddc2485d560b7252b99af02ed796b667ec02e7
2020-10-22 12:16:22 -04:00
TreeHugger Robot
1a15f8de00 Merge "Add Tiles for all Recent Conversations via flag" 2020-10-19 12:43:13 +00:00
Anna Zappone
331215b4d8 Add Tiles for all Recent Conversations via flag
Based on the CONVERSATION_TYPE flag, shows only priority conversations
or all conversations. Defaults to showing all conversations.

Test: locally
Bug: 169783793
Change-Id: I4cb62cc9e4f9e5e488247d97b5624be97a94f8b0
2020-10-15 17:38:09 +01:00
Danning Chen
59c9b6da36 Count the in-app conversations (locus ID) in the recent conversations
A conversation still needs to post a notification in order to be showing
in the recent conversations list. But couting the in-app conversations
will update their last usage timestamp whch affects the order of each
conversation in the list.

Bug: 162593584
Test: manual test + atest
Change-Id: I8ceeb4f39d525c9137abaf01bd54cd873cb07bde
2020-10-14 10:52:03 -07:00
Julia Reynolds
becd7bf4f5 Update how PeopleService is published
To match notifications and other services.

Test: IPeopleManager.Stub.asInterface(
                ServiceManager.getService(Context.PEOPLE_SERVICE)) does
		not return null
Bug: 169783793
Change-Id: Ib3956af71a0c02478c3f91aa5b20eb2628ce93a4
2020-10-05 12:08:48 -04:00
Beverly
8fbe29a00b Let sysUI call PeopleService#getLastInteraction
Test: manual
Bug: 169412531
Change-Id: Iac329d2c92048932ec468d7eb4d37c5c51e3e7c5
2020-09-28 16:52:48 -04:00
Beverly
feb12590d3 Add getLastInteraction API to PeopleManager
Retrieves the last interaction for a given conversation (provided
package, userId and shortcutId).

Test: atest DataManagerTest
Bug: 169412531
Change-Id: Ie6f6d87e9ade78b99a18deb2959d0c699579c5f2
2020-09-28 10:19:46 -04:00
Danning Chen
28f578a21a Implement the get/remove recent conversations APIs in PeopleService
A conversation is a cached recent conversation if all below conditions
are met:
1) its shortcut is cached
2) its notification setting is not customized
3) it has recent notifications

A recent conversation can only be removed if it does not have any
active notifications.

Bug: 162593584
Test: atest + manual test
Change-Id: I0d820a6a2bb82ceb238c3f559e108829d1547291
2020-09-25 10:47:03 -04:00
Song Hu
943c807473 DO NOT MERGE Put parameterized weights on top two sharing shortcuts of each app as per shortcuts native ranking in PeopleService Sharesheet model. am: eedf47cbf5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12684673

Change-Id: I29e0c19f954fc6ce8538a2300279a42120569106
2020-09-25 07:50:55 +00:00
Song Hu
eedf47cbf5 DO NOT MERGE Put parameterized weights on top two sharing shortcuts of each app as per shortcuts native ranking in PeopleService Sharesheet model.
By default weights are 0 which ensures ranking same as what it is now.

Bug: 168212835
Test: atest com.android.server.people.prediction.SharesheetModelScorerTest
Change-Id: I02eaa5b6a448c33b51e5f4c6acaba93e7a2bd995
2020-09-24 22:18:49 -07:00
Julia Reynolds
2b38187538 Bulk process shortcut removals
This will reduce file writes for notification history

Test: atest
Bug: 169100698
Change-Id: If6488808087ad06023a994d51e00fb739ef11bd1
2020-09-23 17:01:07 -04:00
Jeff Sharkey
4b5b0174d0 Merge changes from topic "sep11" am: c0b288133a am: 69e6f07347 am: 741c0a78cc am: da7478b570 am: 487d394296
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1426195

Change-Id: Id01f468b43fd5b2aada78608010625b392c1b647
2020-09-15 21:01:48 +00:00
Jeff Sharkey
05e513d1c5 Update language to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for reference

Test: none
Bug: 168334533
Exempt-From-Owner-Approval: docs updates
Change-Id: I8aa4186f44957fc69aebceeeff1e6584b4eebd5a
2020-09-14 10:00:12 -06:00
Danning Chen
144e6b344c Add @hide people service API to access the recent conversations
This @hide API allows the settings to retrieve and remove recent cached
conversations from people service.

Bug: 162593584
Test: test on device
Change-Id: I176d87a0fb1ca3ebcc24bdb1cebcb6d8f4c9bb53
2020-07-31 14:28:10 -07:00
TreeHugger Robot
d5fe3bf3ac Merge "Factor native ranks provided by apps into shortcut targets ranking. This would help rank shortcuts targets properly when there is no enough sharing history on them." into rvc-dev 2020-06-11 13:56:11 +00:00
Song Hu
a4157a3b3b Factor native ranks provided by apps into shortcut targets ranking.
This would help rank shortcuts targets properly when there is no enough sharing history on them.

Bug: 158022238
Test: atest com.android.server.people.prediction.ShareTargetPredictorTest
Change-Id: If802dcfea5c9c8442349c2c67fa71bb4b431cca9
2020-06-10 15:42:56 -07:00
Song Hu
005ce7cae6 Merge "Return empty map when queryUsageStatsForUser returns null in UsageStatsQueryHelper#queryAppUsageStats." into rvc-dev 2020-06-01 18:05:09 +00:00
Song Hu
0c1b59a83a Return empty map when queryUsageStatsForUser returns null in UsageStatsQueryHelper#queryAppUsageStats.
Bug: 157877874
Test: atest com.android.server.people.data.UsageStatsQueryHelperTest
Change-Id: Ib6574d18d42f6d2bd9041b53d43abcbb1db99323
2020-06-01 05:41:10 -07:00
Song Hu
f9d930b8e4 File 'open with' flow would trigger sharesheet with null intentFilter,
In this case, return empty list for direct share, default list for app share, skip
reporting sharing targets.

Bug: 157647326
Test: manually test File 'open with' flow
Change-Id: I3efb87a84048e5d1b2d58b1cc9669eb4568956dd
2020-05-29 16:53:51 -07:00
Mehdi Alizadeh
a3d22cec32 Adds cacheFlags parameter to cache/uncacheShortcuts() methods
Bug: 155135890
Test: atest ShortcutManagerTest1 ShortcutManagerTest11 \
            ConversationInfoTest DataManagerTest \
            NotificationManagerServiceTest
Change-Id: Idda777ba032546bd616ee3079b9c8dc8676dc589
2020-05-26 03:30:55 +00:00
Song Hu
bf9cb7e6e3 Promote frequently sharing apps as per monthly stats fetched from UsageStatsManager, in case PeopleService does not store enough sharing events when users just swicth to Sharesheet ranking in PeopleService.
Bug: 156320324
Test: atest com.android.server.people.prediction.ShareTargetPredictorTest
Test: atest com.android.server.people.prediction.SharesheetModelScorerTest
Test: atest com.android.server.people.data.UsageStatsQueryHelperTest

Change-Id: Iae7a3a8195ae4901cd1d9d673fe0cf8a27845488
2020-05-20 15:37:26 -07:00
Song Hu
c0128fa07d Merge "Changes in PeopleService to supprot ChooserTarget ranking. 1. Pass app share score from PeopleService to Aosp. 2. Skip storing ChooserTargets sharing event in PeopleService. 3. Adjust frequest used app promo decay." into rvc-dev 2020-05-05 07:08:26 +00:00
Song Hu
7e134c22eb Changes in PeopleService to supprot ChooserTarget ranking.
1. Pass app share score from PeopleService to Aosp.
2. Skip storing ChooserTargets sharing event in PeopleService.
3. Adjust frequest used app promo decay.

Bug: 151112858
Test: atest com.android.server.people.prediction.ShareTargetPredictorTest
Test: atest com.android.server.people.prediction.SharesheetModelScorerTest
Change-Id: If27d0c914b9f156403950e7ea601b4a7ad35b27f
2020-05-04 15:58:26 -07:00
Danning Chen
f4ba1c22a6 Uncache the shortcuts when Android system shuts down if the notification settings are not changed
Change-Id: Ib7e23f4b15ccca9c162cea187a26e7d89b8976a8
Test: Manual test
Test: atest DataManagerTest
Bug: 153357090
2020-04-30 23:37:56 -07:00
Danning Chen
28410f3def Cache the shortcut when the associated notifications are posted and uncache when they are gone
Change-Id: Ia569f9b31a0fe73242f2e6350805afe7c06d2cdf
Bug: 153357090
Test: Manual test
Test: atest DataManagerTest
Test: atest NotificationManagerServiceTest
2020-04-23 13:52:44 -07:00
Danning Chen
07cfaa6b08 Keep the conversation shortcut criteria in People Service consistent with the one in Notification Manager
Before this change, People Service uses the presence of the Person object
in ShortcutInfo as the criteria of conversation shortcut. This changes
the criteria that the shortcut needs to be a share shortcut instead of having Person object.

Change-Id: I1ea52a50c909ca96365c1d4e55af97931d048d8f
Test: atest ShortcutHelperTest
Test: atest DataManagerTest
Bug: 154254830
2020-04-21 10:51:20 -07:00
Susi Kharraz-Post
dde9c3afc8 Add sharesheet statsd logging
Add a Logger for sharesheet and add calls into ChooserActivity.java

Bug: 147508495
Test: manual testing and added unit tests into ChooserActivityTests.
Change-Id: I0024b5020f47475a28c4745af4d8ef268e5f85be
2020-04-03 11:07:19 +00:00
Song Hu
1d73eaf431 Factor freqeuncy and mimetype of past sharings, foreground app into
sharesheet model. Promote most frequent sharable apps to tackle cold
start issue when device doesn't hold enough sharing history.

Bug: 149822311
Test: manual test Sharesheet ranking on device
Test: atest com.android.server.people.prediction.ShareTargetPredictorTest
Test: atest com.android.server.people.prediction.SharesheetModelHelperTest
Test: atest com.android.server.people.data.UsageStatsQueryHelperTest
Change-Id: I6eb764448c0619cbc3b320b5f6432f559d1a15e1
2020-03-26 06:18:52 -07:00