History log of /frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
08adbfed3a3c291a3c9f1cb1af77dd5930a17dd1 10-May-2017 Adam Powell <adamp@google.com> Lock out ResolverDrawerLayout dismissals during animations

Due to views being offset during the ChooserActivity animating in
direct share targets, it was possible to touch down on the sheet
attempting to tap, but have it be interpreted as a fling downward as
the relative touch position within the parent was moving. Lock the
dismiss gesture during animations to prevent this.

Bug: 36032762
Test: manual
Change-Id: I18b6f03148cbf402efc23e873262927e412ea7b7
/frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
99302b55c6a960c9078ad2c84ae9be3296bd32f3 29-Mar-2017 Makoto Onuki <omakoto@google.com> Revert "Push chooser targets to the shortcut manager."

This reverts commit 58fc95dc578244b7beb687a48184045dcce788b8.

Bug 36186790
Test: cts-tradefed run cts-dev --skip-device-info --skip-preconditions --skip-system-status-check com.android.compatibility.common.tradefed.targetprep.NetworkConnectivityChecker -a armeabi-v7a -l INFO -m CtsShortcutHostTestCases
Test: cts-tradefed run cts-dev --skip-device-info --skip-preconditions --skip-system-status-check com.android.compatibility.common.tradefed.targetprep.NetworkConnectivityChecker -a armeabi-v7a -l INFO -m CtsShortcutManagerTestCases

Also all unit tests, except for the known failrues.
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest1 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest2 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest3 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest4 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest5 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest6 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest7 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest8 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest9 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest10 -w com.android.frameworks.servicestests

Change-Id: I733ee7e12a419ee7ea17ca67c56afe7b039d189a
/frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
3303cd3f9ab7f1b38c7b2854bf908f5dcb2fac36 03-Mar-2017 Makoto Onuki <omakoto@google.com> Fix crash in secondary user

Test: manual test
Change-Id: If406807094f216fd3cfd80db7c6498c954a3fc95
Fix: 35938801
/frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
58fc95dc578244b7beb687a48184045dcce788b8 14-Dec-2016 Hakan Seyalioglu <hseya@google.com> Push chooser targets to the shortcut manager.

More info at go/direct-share-push

Test: Some basic testing currently in, more to be added.

Change-Id: I069f9779988c3eca2c4d8b83ec62501983854355
/frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
f631ef769ad718f9ce52955d67623fa67a942cd5 24-Feb-2017 Jorim Jaggi <jjaggi@google.com> Fix sharing bugreports from lockscreen

When launching ChooserActivity from lockscreen, we will start it
in stopped state because lockscreen is still showing, meaning that
the activity goes through start -> resume -> pause -> stop
immediately after it was launched, and will be later resumed once
Keyguard actually goes away.

However, ResolverActivity finished itself in onStop. We add a
private extra to change this behavior for sharing bugreports.

Test: Take bugreport, double tap on it on lockscreen
Test: com.android.shell.BugreportReceiverTest$1
Bug: 33009364
Change-Id: I973b2c71587950499b7c88b16af9cf1387795e17
/frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
13405c552956eee529462eb8004ca3eab4273a8b 01-Feb-2017 Hakan Seyalioglu <hseya@google.com> Fix interaction w/ work profile & last chosen

bug: 34677697
Test: New unit tests added
Change-Id: Ibb5c804c16a758ff041ce7165fda561d903b5f31
/frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
9fa2a2cd46e11be0ea50ad7be0d3dd2c9273f55a 06-Jan-2017 Kang Li <kanlig@google.com> Adds annotations to Intent, and enables ChooserActivity to rank apps
according to annotations.

Test: Unit tests and manul tests. More unit tests to be added.
Change-Id: I3cbfd0cc10007290585fa3e7e3c92e1731f1f7b8
/frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
64b018e0ebf0408f82a5347ffe695a57dd9f87fa 06-Jan-2017 Kang Li <kanlig@google.com> Adds tests for b/34095835.

Bug: 34095835

Test: reproduced the bug in b/34095835 to ensure that it is covered by
the test. Manually ran the tests.

Change-Id: I28a887341906dc443e1a854ddba51cd1b4daeead
/frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
0cef910d5e159800bacb69310a69ba04eafcd30c 05-Jan-2017 Kang Li <kanlig@google.com> Fix crash when updating ranking model in ChooserActivity.

Bug: 34095835

Test: manual tests (automated tests will be added later): 1. take a
picture and share it to Photos; 2. take a bug report and share it to
Gmail; 3. launch Chrome app, share a webpage to Drive; and 4. launch Contacts
and share a contact to Messenger.

Change-Id: Ie50c8305f90b6df69aa1e47c01d0b2212da0a37a
/frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
a5e50e2612fefd0c50595445dd4f2a68cfa33377 04-Jan-2017 Kang Li <kanlig@google.com> Merge "Log metrics for Smart-Sharing in ChooserActivity."
97a8d7038646c34b25619d2e2ae9d6c7c8104f35 04-Jan-2017 Kang Li <kanlig@google.com> Merge "Rank apps by Logistic Regression for Smart-Sharing."
e1276bfe086a40a0fba7e81dd5db13f95287714d 08-Dec-2016 Hakan Seyalioglu <hseya@google.com> Do the sorting for the ShareSheet asynchronously.

This lets the screen fade out and share sheet start being displayed
before all results are sorted. Based heavily on ag/1126533. There are
two other follow ups that I'd like to do after this that aren't a part
of this change:

1) Investigating images being loaded multiple times (from original
change)
2) Put placeholder space while the sorted images are coming in - at the
moment there's some jank when the list of applications becomes
visible.

Test: Unit tests for ChooserActivityTest (still would like to add tests
for ResolveInfoController and UsbResolverActivity).

Change-Id: I4c4a65fff1b0f17fc52b9bd01c3d5c59d649d119
/frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
a2c7774d218a5c42ea9154a3df122d5275589911 20-Dec-2016 Kang Li <kanlig@google.com> Rank apps by Logistic Regression for Smart-Sharing.

Bug: 30982298
Test: manual - tested by sharing images in Photos and sharing texts in
Chrome.

Change-Id: I9808abdefbc898d3452e684f3462efafdfd53c23
/frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
9082f5b697132e639d7f534017bde9d71f264713 02-Dec-2016 Kang Li <kanlig@google.com> Log metrics for Smart-Sharing in ChooserActivity.

Bug: 33051310, 30982298
Test: manually shared several images in Camera.

Change-Id: I6b147ec89729815931e2b626b7533e1e5b95c819
/frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
b431d715a3f266f0ce76453ec42d96b2763f41a1 14-Dec-2016 Kang Li <kanlig@google.com> Merge "Add Sharing Histories to UsageStatsManager."
53b4314ad9b43b1890cbd765b896ccb0f005fdeb 14-Nov-2016 Kang Li <kanlig@google.com> Add Sharing Histories to UsageStatsManager.

This CL is for Android O Smart-Sharing (b/30982298). By this CL, sharing
counts are logged with UsageStatsManager.

Bug: 30982298
Test: manual - shared images in Camera and texts in Chrome using a mobile device.

Change-Id: I0b4aa0506f99b3083d140a48f7b4bdd5b1c5afb6
/frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
7317e8abcc1d691b77386b9ff5852360dc40cdd4 13-Dec-2016 Hakan Seyalioglu <hseya@google.com> Don't auto-launch if switching to managed account

When the user picks the option to switch to a managed account, avoid
auto-launching the activity if there's only a single activity to pick
from.

Bug: 32669623

Test: Manual
Change-Id: Ieaed5885385929297304506ca2d5839e77043a64
/frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
383db5ebcc3a4a615faf249bf4f126f42e80b82e 22-Jun-2016 Tamas Berghammer <tberghammer@google.com> Update package names to work with the proto3 compiler

Bug: b/28974522
Change-Id: I5f3adf4946ee4ba1e09e4f40afe83c151405972a
/frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
145b0cad4271a25988602b1ae24137319b10fb16 14-Oct-2016 Ben Lin <linben@google.com> Adding an Extra field for Intents so chooser show up even if one app.

By design, ChooserActivity (the activity that shows up when there's an
intent sent that can be handled by multiple apps) always default to not
show if there's only one app available to choose from. This adds the
extra in Intent such that if passed in, the parent activity can choose
to override the behavior and force show the chooser even if there's only
one app. Default is still skipping the chooser.

Bug: 31830662
Change-Id: I17d676e77094cded4af99c7433f511e8c6c58164
(cherry picked from commit 2c5adbdf1942898baa97a3c8a7976fc7c0627902)
/frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
86100d18ad0bd5ae3267a0e0944d15f4fe94078a 13-May-2016 Adam Powell <adamp@google.com> Show package icon/label for resolved package-targeted implicit intents

If we're going to show metadata about a resolved implicit intent that
is targeted to a single package with multiple potential targets,
populate the ResolveInfo with the label and icon of the target
package's ApplicationInfo and set resolvePackageName. This helps use
cases such as EXTRA_INITIAL_INTENTS in ChooserActivity, where
sometimes apps set target packages but not components.

Bug 28739056

Change-Id: I8070d341fccc139463c5ac8d66db45fce02252e5
/frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
52c39215db2a0e1d339733e06284a2ba81e4c794 08-Apr-2016 Adam Powell <adamp@google.com> Chooser filtering and caller direct share targets

Let apps invoking the system chooser specify components to filter out
such as themselves; this will prevent duplicate nonsensical UX where
it doesn't make sense for an app to share to itself.

Similarly, let apps provide their own Direct Share targets for when
they do want to let users share via their own internal services in the
same UI. These options can be used together.

Also fix a bug where a lingering binder reference from a remote
ChooserTargetService that hasn't been GC'd in the remote process could
keep an active reference to a ChooserActivity instance.

Bug 28073484

Change-Id: Ib613b1153b49dfedf79574b1af7c45379eceec24
/frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
4c284d513c30d62c15c8eb576c6a726920c82c6a 19-Mar-2016 Adam Powell <adamp@google.com> Don't bind ChooserTargetServices as user CURRENT

Bug 26151189

Change-Id: I8ea76de499f7a7b9edbf1de3117d34d91bfa36ae
/frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
f5afdb09a64afc5e935ca29e1eeab429d67a3cab 18-Feb-2016 Adam Powell <adamp@google.com> Restore auto-launch behavior for ACTION_CHOOSER with a single choice

For the initial release of Marshmallow auto-launching was suppressed
for ChooserActivity if there was only a single choice in order to let
the user confirm what would be launched. In practice, many apps use
ACTION_CHOOSER when they should probably use implicit intents, but
still others have use cases where setting a default doesn't make sense
and the user should still be able to make a choice when one is
available.

As the user confirmation didn't buy much in terms of developer API
expectations (ACTION_CHOOSER being a forced choice) and it adds
speedbumps to existing apps in the ecosystem, revert this change.

Bug 27243827

Change-Id: Id8fd5385d5b1f459e80b0096efe7e2944264739a
/frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
565943fda5b05ac5514c216effaf76fc98c5b6c0 11-Feb-2016 Adam Powell <adamp@google.com> ChooserActivity direct share jank fixes

Don't show the ChooserTargetService targets until we have all
responses in, or we hit our timeout. This helps prevent targets from
jumping around under the user's finger. We still give bonuses to
services that respond faster.

Bug 26790940

Change-Id: I8a19e19e08eeb502ccc4b4feaa1710ca3315e9f6
/frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
8212ae0aee1700b9c287ebadf15af8dacdc8eae6 10-Feb-2016 Jeff Sharkey <jsharkey@android.com> Consistent naming for internal storage APIs.

Also completely remove a few confusingly named deprecated APIs.

Change-Id: Ia7e4ea3190a97f0a7dfa9bebf2118da0866ec38f
/frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
bba0030a8529fd904056cbb7cfbbe3afbc1c8a95 04-Feb-2016 Adam Powell <adamp@google.com> Restrict ChooserTargets provided by a single service

Only allow one row's worth of targets from any one
ChooserTargetService and lower the weight for app recency in resolver
sorting. Along with a previous change to only consider the past 1 week
of app activity, this is to help improve the quality of direct share
targets shown.

Bug 26562857

Change-Id: I0f9a8ca8ccfb655261421e29fef7909cadd318f1
/frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
2388251fcd8def03a6bbc91382e84db085cf4253 29-Jan-2016 Adam Powell <adamp@google.com> Pinning components in ChooserActivity, take 2

Keep the ChooserActivity in the android:ui process/system.

Change-Id: Ia3ae29a8d629f41a53a066b9fc7ed0b28666b261
/frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
e7c74cc96eeecec52401d9bf720234d1421cfebc 28-Jan-2016 Adam Powell <adamp@google.com> Revert "Pinning components in ChooserActivity"

This reverts commit ec6bc41e1835804533fd21b3ef8047ecd893bcfd.

Bug 26842512

Change-Id: I9fc775d21081885d0e26fca4ade412a18da45b7c
/frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
ec6bc41e1835804533fd21b3ef8047ecd893bcfd 27-Jan-2016 Adam Powell <adamp@google.com> Pinning components in ChooserActivity

Move ChooserActivity to SystemUI. This is a safer place for it to live
and still be able to persist data to storage.

Add a context menu to long press for chooser targets allowing users to
'pin' a target component from an app. This causes it to sort to the
front of the list so that a user's favorite apps are always available
from share UIs, etc. Similarly, all ChooserTargets from a pinned
component receive an impossibly large boost for sorting so that they
will always appear first.

Bug 26791843

Change-Id: Ib4e603d9d4263403e98ce619287452ddab593044
/frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
f6e9228b8a97603d3ceb8f0d61e8d87cf19bd21f 27-Jan-2016 Chris Wren <cwren@android.com> move framework metrics over to new proto

Change-Id: Ie46e946dc787350c15c10aa4385a6b7df7e181a8
/frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
6e461518ab214d01e60a9371c6f65843763731c4 21-Oct-2015 Adam Powell <adamp@google.com> Merge "Don\'t query ChooserTargetService apps that haven\'t been used recently" into mnc-dr-dev am: b8cfc12c3f am: 8c7b3e872b am: f998b602bb
am: d6db05e4b1

* commit 'd6db05e4b1ea2410525f2a3d406d24262e06e7e7':
Don't query ChooserTargetService apps that haven't been used recently
3a09c52914796135159009438a14b51b3e475fb4 21-Oct-2015 Adam Powell <adamp@google.com> Don't query ChooserTargetService apps that haven't been used recently

Resolver/ChooserActivity sort apps based on usage factors for the last
two weeks. A score of zero means no usage data within that timeframe.
For system health and UI relevance, don't bother even waking up apps
that have zero scores.

Bug 25126166

Change-Id: Iae34a9667eb1985d6fe986670f3fb3f1177576da
/frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
8ebd66ca2428a409fe2ae8c077f387242b16a3d6 16-Oct-2015 Adam Powell <adamp@google.com> am 4c0011e9: am 824347dd: am d08f339b: am 749334bf: Merge "Fix ChooserTarget app scoring" into mnc-dr-dev

* commit '4c0011e98212cf2b2a9e0aa2bab32c069de3b253':
Fix ChooserTarget app scoring
77a533f5b2a1640f52fc2ccbcf8c74c9aed94d6e 16-Oct-2015 Adam Powell <adamp@google.com> Fix ChooserTarget app scoring

An initial sorting step before applying modifiers to the ChooserTarget
scores provided by apps was backwards, causing subsequent target
scores to be heavily penalized. Targets are then heavily influenced by
the lowest score in the set relative to the targets from other apps.

Bug 25013559

Change-Id: I39d5d7c601712fc6a19e694d5846d2c8d17a214f
/frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
b60d985561f29b78002fda35a7ae50e02d82ff45 15-Oct-2015 Adam Powell <adamp@google.com> am 2271385a: am bd4d81b0: am b248077a: am 2eac005b: Merge "Fix bugs introduced in ChooserActivity" into mnc-dr-dev

* commit '2271385ad8845d86af2a3aba6b03ec3113e9b9be':
Fix bugs introduced in ChooserActivity
4eb9871ead5fa5f6b86bacee3a18d9ad52ad6d32 14-Oct-2015 Adam Powell <adamp@google.com> Fix bugs introduced in ChooserActivity

* Wait to start animations until all state has been initialized, as
the process of starting an Animator will set initial values,
triggering other events relying on the configured state.

* Correctly track underlying item indexes for columns.

* Do not over-extend the ResolverDrawerLayout when multiple rows
animate in.

Bug 24926885
Bug 24928706

Change-Id: I4772e1a0ba79b17b5dc19c778f3ef0cb5200c533
/frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
11af18783d32f8646428500a0ff3a2a57a77bf95 13-Oct-2015 Adam Powell <adamp@google.com> Merge "Add animation and positional stability to intent chooser UI" into mnc-dr-dev
63b31698452dbc36f6258c980d7a731518bfd6a0 28-Sep-2015 Adam Powell <adamp@google.com> Add animation and positional stability to intent chooser UI

Dejank the process of bringing in new ChooserTargets from queried
services. Animate the service target rows in upward so that if the
user's finger is already headed for a visible choice we don't inject
something wrong right under them at the last second. Keep things sane
if the user is dragging the UI while we're bringing in new items.

To animate this, since we can't use RecyclerView from the framework we
treat the height of rows as a conceptual data set change for
ListView. To get away with doing this per-frame we pre-measure the
item height (which remains constant) instead of doing more expensive
wrap_content calculations. ResolverDrawerLayout is now aware of how to
account for a cheat-measured ListView to compensate.

Bug 24038066

Change-Id: I01414a5746815255ff948a6d0887bb5ad0897285
/frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
6ef8578ef44a69a391861e1103cee0ca9b745775 28-Sep-2015 Adam Powell <adamp@google.com> Add animation and positional stability to intent chooser UI

Dejank the process of bringing in new ChooserTargets from queried
services. Animate the service target rows in upward so that if the
user's finger is already headed for a visible choice we don't inject
something wrong right under them at the last second. Keep things sane
if the user is dragging the UI while we're bringing in new items.

To animate this, since we can't use RecyclerView from the framework we
treat the height of rows as a conceptual data set change for
ListView. To get away with doing this per-frame we pre-measure the
item height (which remains constant) instead of doing more expensive
wrap_content calculations. ResolverDrawerLayout is now aware of how to
account for a cheat-measured ListView to compensate.

Bug 24038066

Change-Id: I01414a5746815255ff948a6d0887bb5ad0897285
/frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
54c331a05b5b593d306b475dbc0aabf8a87b6e6c 30-Sep-2015 Jeff Sharkey <jsharkey@google.com> am 5dfd06f7: am c2fa99ed: am 792a9cc3: am 30fd0628: Merge "Relax auto-launch checks for GET_CONTENT." into mnc-dr-dev

* commit '5dfd06f7d00476dcffb933584ef7e083469215e3':
Relax auto-launch checks for GET_CONTENT.
cc2ae6b421353e03160df3b05ce9042b8a5ff8cc 29-Sep-2015 Jeff Sharkey <jsharkey@android.com> Relax auto-launch checks for GET_CONTENT.

When a developer wraps an intent with Intent.createChooser(), they're
indicating that the user should always be prompted, instead of using
any "always use" defaults. A recent CL changed the chooser behavior
to ensure that UI is always shown in the case where there is only one
match.

However, this caused us to start prompting for the GET_CONTENT intent,
for which there is only ever one DocumentsUI system app. Since that
app delivers on the createChooser() contract described above, we're
okay automatically launching it.

Bug: 24464358
Change-Id: I0279d3343479c134a35f41ddf3cb4204d0ae6a90
/frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
a2d44ea016ba7c87ae0f581ced483c6963fc920c 18-Sep-2015 Adam Powell <adamp@google.com> am 9546d5a2: am 96c95ba5: am 5f22c0b2: am 1b67a6b8: Merge "Badge ChooserActivity choices with their app icon for disambig" into mnc-dr-dev

* commit '9546d5a2ec2598849c2faaa6de998887df9b62f3':
Badge ChooserActivity choices with their app icon for disambig
00f4aad704198a8293b9a1d2b931b8708073fe15 17-Sep-2015 Adam Powell <adamp@google.com> Badge ChooserActivity choices with their app icon for disambig

When two or more activities with the same user-visible label are
shown, we have traditionally shown the app name or package name if the
app names also match. This was to help the user tell the difference
between multiple apps publishing similar activities and avoid
unintentionally starting the wrong one. However, in the case of
explicit choosers (e.g. ACTION_SEND sharing) a few common collisions
occur in practice and falling all the way back to package name isn't
very helpful.

Instead, we now assume that the app icon, which the user has seen
before at install time, is unique enough on its own to disambiguate
these cases and avoid user confusion. We no longer show the app name
or package name as secondary text in the chooser.

In cases where an activity has a different icon from its containing
app, we now badge the activity icon with the app icon so that the user
knows which app a potentially ambiguous choice belongs to.

Bug 24113937

Change-Id: Ie54fbf77bfcc86e50768f93be2be0e53cf2ce7b5
/frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
39e94ebe22d4959facea4c3621a0a5377242a570 09-Sep-2015 Adam Powell <adamp@google.com> Handle single-choice ChooserActivities and bound ChooserTargetServices

Fix cases where we could try to unbind from a ChooserTargetService
that is not connected. This could happen if we still had stale replies
coming back after the activity was destroyed.

Always offer users an explicit choice in ChooserActivity, don't
auto-start a single option.

Make sure we don't allow a wedged ChooserTargetService to hold a hard
reference to the ChooserActivity via its internal result callback.

Bug 23152483

Change-Id: I7c8b1fc9559dcd477702ef582011b088b07d646b
(cherry picked from commit 9761ab2a645a4643bd20619c7c148ef07e0dd39d)
/frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
9761ab2a645a4643bd20619c7c148ef07e0dd39d 09-Sep-2015 Adam Powell <adamp@google.com> Handle single-choice ChooserActivities and bound ChooserTargetServices

Fix cases where we could try to unbind from a ChooserTargetService
that is not connected. This could happen if we still had stale replies
coming back after the activity was destroyed.

Always offer users an explicit choice in ChooserActivity, don't
auto-start a single option.

Make sure we don't allow a wedged ChooserTargetService to hold a hard
reference to the ChooserActivity via its internal result callback.

Bug 23152483

Change-Id: I7c8b1fc9559dcd477702ef582011b088b07d646b
/frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
741abfc12074623d24297ebb67d98cb2d9126add 11-Aug-2015 Nicolas Prevot <nprevot@google.com> Fix cross-profile intent filters with system-user split.

Don't assume that the parent is always the user owner.

BUG:23105562
Change-Id: Ia98ed608e2b6d1d82d95a73110134d85274c6abf
/frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
ce5d92c31370b8c0e6989506e1ee95e181f93c53 31-Jul-2015 Alan Viverette <alanv@google.com> Add badge content description to TargetInfo, use in ResolverActivity

Bug: 22667344
Change-Id: Iee241b9179c74a15b1c635cf90d2f96f6f7b31cd
/frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
666d82a6d5c6a90e87591aea1aabac3d647cd541 16-Jul-2015 Adam Powell <adamp@google.com> Update ChooserTarget constructor to take ComponentName, Bundle

Simplify ChooserTarget handling by requiring a target component and an
extras bundle instead of a full PendingIntent/IntentSender. This
simplifies the handling of URI grants from sending apps.

Prune ChooserTargets that point at ComponentNames that don't share a
package with the original matching Activity target or that aren't
exported so that we don't show the user something they can't launch.

Bug 22516282

Change-Id: I3439c0910b4fa4f95c7a881b529942c96ffc953e
/frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
a182e45c6851a8db89e8b0900f0812806ff295d4 07-Jul-2015 Adam Powell <adamp@google.com> Sort and limit ChooserActivity targets from ChooserTargetServices

Apply an automated decay factor if apps decide to claim all of their
targets are SUPER IMPORTANT. Apply the multiplier from the apps
themselves as well as a penalty for apps that come in late - let's see
how fast developers get their ChooserTargetServices to start!

Also fix a bug with ResolverDrawerLayout where dragging from the title
area wouldn't always work properly.

Bug 22302285

Change-Id: Ib6eb2b6fb92608790b2267c0f671c9ae59b2907e
/frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
4c470d641c6906a742b63273b305695ba575b3e1 20-Jun-2015 Adam Powell <adamp@google.com> Add voice interaction support to ResolverActivity/ChooserActivity

All options are sent to the VoiceInteractor once ChooserTargetServices
have reported in. We don't perform explicit progressive refinement or
filtering, but an explicit option picked will be invoked.

Also fix a lingering bug around being able to nested-fling the
resolver drawer closed.

Bug 21516866

Change-Id: I6b141f5fa87d74dccec9dcb88110630696e9c38e
/frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
98b7f8943080ff4b0c636ad37b62556453018839 19-Jun-2015 Adam Powell <adamp@google.com> Fix regression in viewing app info from ChooserActivity targets

Also add metrics logging to ChooserActivity

Bug 21953567
Bug 21953720

Change-Id: I6bba2cfe9b9e551e6fe6f2d4f92fc040eebf355c
/frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
a408061cc7b5efaf090ce9efd5fd0ba1d95e9c11 19-Jun-2015 Sudheer Shanka <sudheersai@google.com> Merge "Use the intent filter icon in ResolveInfo for managed profile." into mnc-dev
9ded760f6378b79ae5f91fe694744981a4154d0b 19-May-2015 Sudheer Shanka <sudheersai@google.com> Use the intent filter icon in ResolveInfo for managed profile.

Bug: 20753645
Change-Id: Ifed4b498524272517c9f3338ba88fcbcd3b22075
/frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
5007735782ef5b48a5a8b6d317aff693ffad2db9 27-May-2015 Adam Powell <adamp@google.com> Fix one-action choosers with EXTRA_INITIAL_INTENTS

Fix a bug where initial intents weren't respected as valid options
when there is only one choice available.

Bug 21304304

Change-Id: I304ee6acf20a367da6296132f85d913ad9fce127
/frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
13036beab1579fabe1a93e1839c13cb68a49adf6 12-May-2015 Adam Powell <adamp@google.com> Apply API feedback for ChooserTarget

* Add better docs to ChooserTarget
* Change ChooserTarget to use android.graphics.drawable.Icon instead
of Bitmap
* Preserve EXTRA_REFERRER when starting ChooserTargets

Bug 21045119

Change-Id: If859b86344cebaed3eaae477af132e7d7600aba6
/frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
7d7580019e44e2e162df01ffff51de20ed0721b3 07-May-2015 Adam Powell <adamp@google.com> Bringing new Chooser UI closer to spec

Separate the chooser targets into rows by type. Remove some API that
was redundant with LabeledIntent, simplifying ChooserTarget.

Change-Id: I90de471825f05d85e6ffbe72a32fb597be824a30
/frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
2ed547e55f820a9c705872d802b051d8ae9c906b 30-Apr-2015 Adam Powell <adamp@google.com> Add alternate intents and refinement callbacks to ChooserActivity

Allow a calling app to supply an array of additional Intents to the
system ChooserActivity.

The chooser will present a merged list of targets that can handle any
of the Intents supplied, including both the standard EXTRA_INTENT as
well as any of the intents supplied in EXTRA_ALTERNATE_INTENTS. These are
treated as ordered; EXTRA_INTENT is considered the first/primary
Intent and EXTRA_ALTERNATE_INTENTS are sorted most important first.

Targets are queried for all supplied Intents. If the same component is
returned for more than one Intent, the target is associated with the
most important Intent that matched.

This allows calling apps to supply several different payloads for an
action depending on what the intended targets are able to support. For
example, an app performing ACTION_SEND may supply image/jpeg data to
compatible targets or a hosted web link to targets that only support
text/plain. The user will have the opportunity to pick from a single
merged list of choices using the best available payload, and will not
be bothered with the implementation details of how the payload will be
delivered to the recipient.

If the calling app wishes to provide further disambiguation or
refinement after the user makes a choice, for example to let the user
choose which of the source intents to send from the primary or
alternates, show a progress dialog as a full-resolution version of a
photo is downloaded from the server before being sent along or while
reticulating splines, the caller can supply an IntentSender to
ACTION_CHOOSER including the extra EXTRA_REFINEMENT_INTENT_SENDER.
This should be the IntentSender obtained from a PendingIntent pointing
at an activity to launch to perform the refinement.

The refinement activity should report that it is finished by obtaining
the ResultReceiver from EXTRA_RESULT_RECEIVER. Available intents to
send to the selected target will be contained in EXTRA_INTENT and
EXTRA_ALTERNATE_INTENTS.

To complete the refinement and send the result along to the chosen
target, the refinement activity should select one of the supplied
intents and send it to the ResultReceiver in a Bundle with the key
EXTRA_INTENT and the result code RESULT_OK. To cancel the refinement,
and let the user select another choice, send RESULT_CANCEL.

While refinement activities cannot modify the filterEquals-affecting
fields of the Intent they return, they may modify extras to provide
additional or altered details to the final recipient. These extras
will be filled into the Intent sent to the final target.

Change-Id: I7ad4739eadd1a0e307675847ccf47ea948918a3a
/frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
d974c7b4d150661562e341eb743986f06d150298 29-Apr-2015 Adam Powell <adamp@google.com> Fix a bug when constructing a ChooserTargetAdapter without custom
targets

Bug 20667333

Change-Id: Ia35021d12c00f64f5424588f776d79e18e8d518e
/frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
0ccc0e9348e42fd8094bb12324f7c5bb6ca018ad 24-Apr-2015 Adam Powell <adamp@google.com> Wire up caller chooser targets for ChooserActivity

Add the caller-supplied ChooserTargets from EXTRA_CHOOSER_TARGETS in
the default ChooserActivity. These appear before other options.

Change-Id: Ic4d23ae9ecdfd0cc8a5ac077696d7334a8f844a6
/frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
c6d5e3a406c0e80638304980bac13abaa703a9a0 23-Apr-2015 Adam Powell <adamp@google.com> Fixes for ChooserTargetActivity

* Always ensure intent filter is supplied to a ChooserTargetService.
* Add and clarify docs for ChooserTarget constructors.
* Fix a bug where ChooserTargets were being parceled incorrectly.

Change-Id: I32b70c424b0e6bb317e2eeb810566a30c21b9d53
/frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
2442841819f9554f9b5c8b9c147a51b04e50de4d 02-Apr-2015 Adam Powell <adamp@google.com> Implement ChooserTargetService querying for ChooserActivity

First cut at querying services provided by apps that offer
ChooserTargetServices. This first implementation provides no ranking.

Bind to a limit of 5 ChooserTargetServices and offer the
ChooserTargets they provide as options in the system
ChooserActivity. The chooser now presents targets as a grid and
displays the activity icon from the referrer activity.

Change-Id: I45db829f184fc78d4f18d42b2a60b25bc301eba8
/frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
0e2b73f6858479ca963bd53c49f8955d98f14869 27-Oct-2014 Nicolas Prevot <nprevot@google.com> An intent forwarded from a chooser intent will be a chooser too.

If a chooser intent is fired:
If the user picks "work" or "personal apps":
send a chooser intent to the other profile instead of sending a normal intent.

Also using a userId instead of a userHandle for the target user.

BUG:16514027

Change-Id: I2e45cd57ad72e9b7280e772b31fc10938642ba59
/frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
0b3c11260ae5ea09c7e702802b39f77afc74f35f 09-Oct-2014 Adam Powell <adamp@google.com> Intent chooser callback

Let an app specify an IntentSender as an extra for ACTION_CHOOSER that
will be notified of the user's chosen target. Apps can use this to
implement things like one-touch last used affordances without
implementing their own one-off chooser UI.

Bug 17363684

Change-Id: Ic5d1d0e0c7a0bae3eda6b1d6ade993f3ba865cfa
/frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
028ceeb472801bcfa5844fc89ed0da8463098824 18-Aug-2014 Dianne Hackborn <hackbod@google.com> Fix issue #14617210: Apps can gain access to any ContentProvider...

...with grantUriPermissions (no user interaction required)

Add a new path in to the activity manager to start an activity as
if it was directy started by the original calling activity. This
is specifically for the resolver activity and chooser activity to
be able to safely launch its data after serving as an intermediary.

Access to the new method is highly restricted -- it can only be
called by an activity that is declared in the framework apk itself,
and the execute-as-the-caller behavior will only happen if the
code is running under the system uid. (This means we could still
have these run in the client's process in some cases and still work
correctly.)

Note there is some commented out code here half-done about trying
to propagate security exceptions back to the original calling
activity. This would be really nice, especially now with the
chooser activity running in a system process so any errors made
by the app (bad permission grants, bad intents, etc) no longer
actually appear in the app so are essentially invisible. I'd
really like to figure out a way to propagate these exceptions back
to the app, but this is hard since the app's process may no
longer even be running at this point.

Also tweak activity manager dump output to split the recents
dump out from activities, since recents can now be super large.

Change-Id: I50410c4783faf9302c69290589a068a846e0973a
/frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
13420f2311757554c314f620c83cb55153b67612 19-Jul-2014 Dianne Hackborn <hackbod@google.com> Fix issue #16400873: Apps that show ads as new tasks stay in recents...

...even when I hit back or close the activity in UI

Change the semantics of NEW_DOCUMENT to have the recents entry be
removed by default when its activity is finished, with various ways
to explicitly turn off this behavior.

Change-Id: Idc717706d27de80f28b53ad76f9e375d85118d71
/frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
e49d9393783f2789239f8da536abda9533ffadf0 18-Jul-2014 Adam Powell <adamp@google.com> Add EXTRA_REPLACEMENT_EXTRAS for ACTION_CHOOSER

This allows the calling app to supply a set of alternative extras to
be sent along with the target intent if the user chooses specific
items from the full set available on the device. When replacement
extras have the same key as extras in the initial intent, the
replacement extras dominate.

Change-Id: I5d64c80447386f22402b71291bb289a74015d619
/frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
278902c982443b3c196aa4642dcf3e0fffe4b23d 13-Jul-2014 Adam Powell <adamp@google.com> Updated "with-default" layout added for ResolverActivity

Add a layout that promotes the last chosen activity to the top for
ResolverActivity. Alter ResolverActivity behavior as appropriate: Only
the last selected activity can be set as default. Different activity
selections take effect immediately. You can only set a default if it
was the last-used target of the intent.

Also add some default strings for invoking common intents to make the
no-title invocations a bit more user-friendly than just, "complete
action using."

Bug 15694906

Change-Id: I8c75d2f812926805c949cc76bab48aa4094e002f
/frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
2c60de3f6d849a581cca89ece7149c3836b3b6e4 04-Jun-2014 Craig Mautner <cmautner@google.com> Launch document sharing into unique activities

If the same item is shared twice (or more) a new activity for
sharing will be launched each time. Previously the first sharing
activity would be reused.

Fixes bug 14903271.

Change-Id: Ib9e618f3d42079836529e86c138a6c999350cac5
/frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
411d2aed2bb51ea0ba258fc45c8f8029c409e881 08-May-2014 Craig Mautner <cmautner@google.com> Make ChooserActivity intents doccentric and transitory

Activities launched from the chooser activity will now appear in
their own tasks which will be automatically removed from recents
when they are finished.

Also qualified application of new flags with null check and
Action check. Must be either ACTION_SEND or ACTION_SEND_MULTIPLE.

Fixes bug 14463859.
Fixes bug 14633773.

Change-Id: I8832462163958f6a43bc4c6a020f78948ce70ac3
/frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
9d6376a1d88ab5b3a41ee4400e3aaa4c4ee69e2a 12-Feb-2014 Christopher Tate <ctate@google.com> Always call super.onCreate(). Always.

Bug 12991134

Change-Id: Ife16ef93408253e3318a06dc0206ab4b88c7f367
/frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
437ff39c74db4add53e694b012f1f8462e1d34c7 26-Jan-2011 Jeff Hamilton <jham@android.com> resolved conflicts for merge of eb645a15 to honeycomb-plus-aosp

Change-Id: Idc241a61ea3f506f8c0877f4dcdabb89a2635c13
d88e9aa575eb3a9d20cdb0e8918d54993e1ce1e0 24-Jan-2011 Jeff Hamilton <jham@android.com> Use classnames instead of ints for NFC techs.

This makes the system more flexible and allows
adding new technology types without having to
update the API.

Change-Id: Iaee6b633965e501a70e8afc3f1d54d9d94a4d05a
/frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
ef57575887bde74ef09e9f21aae6b02f9c8163c7 19-Jan-2011 Dianne Hackborn <hackbod@google.com> Okay, new plan for dialogs.

Don't dismiss by default when tapping outside, even for AlertDialog.

If AlertDialog doesn't have any buttons, tapping outside will dismiss it.

Applications can make their own dialogs (or activities looking like
dialogs) can use the existing and new APIs to control this behavior
themselves so that it does the right thing.

Change-Id: I02bfb9161e169de0033200211b3a7ec80080bd83
/frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
eb034652c2037a47ebfd99779e8383bb8bb528af 07-Sep-2009 Dianne Hackborn <hackbod@google.com> Implement all of the infrastructure for configuring wallpapers.

Actually being able to configure a wallpaper relies on additional
work in the launcher and wallpapers that will be in another change.
Also note that this breaks all existing wallpapers, since they now
need to include a meta-data item about themselves. This also
will be fixed in another change.

Change-Id: I97d2c2bd07237abc32f92b9147c32530a2f73c71
/frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
9066cfe9886ac131c34d59ed0e2d287b0e3c0087 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
d83a98f4ce9cfa908f5c54bbd70f03eec07e7553 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
54b6cfa9a9e5b861a9930af873580d6dc20f773c 21-Oct-2008 The Android Open Source Project <initial-contribution@android.com> Initial Contribution
/frameworks/base/core/java/com/android/internal/app/ChooserActivity.java