Show the nearby chip for images and files too.
This revealed that we weren't initializing the nearby intent from the original intent, so that's fixed too. This should ensure that flags and extras from the original intent make their way to the available and installed nearby component. Test: Share (an image and a non-image) from DocumentsUI Fixes: 155487375 Fixes: 155676993 Change-Id: If0c0b754a066b0ec439a866de3eae84caca7b793
This commit is contained in:
@@ -1124,7 +1124,7 @@ public class ChooserActivity extends ResolverActivity implements
|
|||||||
final ComponentName cn = getNearbySharingComponent();
|
final ComponentName cn = getNearbySharingComponent();
|
||||||
if (cn == null) return null;
|
if (cn == null) return null;
|
||||||
|
|
||||||
final Intent resolveIntent = new Intent();
|
final Intent resolveIntent = new Intent(originalIntent);
|
||||||
resolveIntent.setComponent(cn);
|
resolveIntent.setComponent(cn);
|
||||||
final ResolveInfo ri = getPackageManager().resolveActivity(
|
final ResolveInfo ri = getPackageManager().resolveActivity(
|
||||||
resolveIntent, PackageManager.GET_META_DATA);
|
resolveIntent, PackageManager.GET_META_DATA);
|
||||||
@@ -1288,6 +1288,12 @@ public class ChooserActivity extends ResolverActivity implements
|
|||||||
ViewGroup parent) {
|
ViewGroup parent) {
|
||||||
ViewGroup contentPreviewLayout = (ViewGroup) layoutInflater.inflate(
|
ViewGroup contentPreviewLayout = (ViewGroup) layoutInflater.inflate(
|
||||||
R.layout.chooser_grid_preview_image, parent, false);
|
R.layout.chooser_grid_preview_image, parent, false);
|
||||||
|
|
||||||
|
final ViewGroup actionRow =
|
||||||
|
(ViewGroup) contentPreviewLayout.findViewById(R.id.chooser_action_row);
|
||||||
|
//TODO: addActionButton(actionRow, createCopyButton());
|
||||||
|
addActionButton(actionRow, createNearbyButton(targetIntent));
|
||||||
|
|
||||||
mPreviewCoord = new ContentPreviewCoordinator(contentPreviewLayout, true);
|
mPreviewCoord = new ContentPreviewCoordinator(contentPreviewLayout, true);
|
||||||
|
|
||||||
String action = targetIntent.getAction();
|
String action = targetIntent.getAction();
|
||||||
@@ -1398,10 +1404,11 @@ public class ChooserActivity extends ResolverActivity implements
|
|||||||
ViewGroup contentPreviewLayout = (ViewGroup) layoutInflater.inflate(
|
ViewGroup contentPreviewLayout = (ViewGroup) layoutInflater.inflate(
|
||||||
R.layout.chooser_grid_preview_file, parent, false);
|
R.layout.chooser_grid_preview_file, parent, false);
|
||||||
|
|
||||||
// TODO(b/120417119): Disable file copy until after moving to sysui,
|
final ViewGroup actionRow =
|
||||||
// due to permissions issues
|
(ViewGroup) contentPreviewLayout.findViewById(R.id.chooser_action_row);
|
||||||
//((ViewGroup) contentPreviewLayout.findViewById(R.id.chooser_action_row))
|
//TODO(b/120417119): addActionButton(actionRow, createCopyButton());
|
||||||
// .addView(createCopyButton());
|
addActionButton(actionRow, createNearbyButton(targetIntent));
|
||||||
|
|
||||||
|
|
||||||
String action = targetIntent.getAction();
|
String action = targetIntent.getAction();
|
||||||
if (Intent.ACTION_SEND.equals(action)) {
|
if (Intent.ACTION_SEND.equals(action)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user