Fix app stack issue: send the selected target info into AppPredictionService and

UsageStatsManager, when user share from app stack on sharesheet.

Fix: 157917956
Test: atest CtsSharesheetTestCases:android.sharesheet.cts.CtsSharesheetDeviceTest
Change-Id: I268af5d996dcca275014fba1cace2c54930b9b0c
This commit is contained in:
Song Hu
2020-06-01 11:35:28 -07:00
parent 93cefaac1c
commit b6039994d2
2 changed files with 10 additions and 0 deletions

View File

@@ -2182,6 +2182,9 @@ public class ChooserActivity extends ResolverActivity implements
}
void updateModelAndChooserCounts(TargetInfo info) {
if (info != null && info instanceof MultiDisplayResolveInfo) {
info = ((MultiDisplayResolveInfo) info).getSelectedTarget();
}
if (info != null) {
sendClickToAppPredictor(info);
final ResolveInfo ri = info.getResolveInfo();

View File

@@ -69,6 +69,13 @@ public class MultiDisplayResolveInfo extends DisplayResolveInfo {
mSelected = selected;
}
/**
* Return selected target.
*/
public DisplayResolveInfo getSelectedTarget() {
return hasSelected() ? mTargetInfos.get(mSelected) : null;
}
/**
* Whether or not the user has selected a specific target for this MultiInfo.
*/