Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6e4e5b7f authored by Adam Powell's avatar Adam Powell Committed by android-build-merger
Browse files

Merge "Make ResolverActivity respect selector intent when making filters" into nyc-dev am: 651e09fd

am: 7d7a075e

* commit '7d7a075e':
  Make ResolverActivity respect selector intent when making filters

Change-Id: I8e5dc2ace5949e58263bfb19dfae8f6c6a6d87cd
parents fc107db5 7d7a075e
Loading
Loading
Loading
Loading
+11 −4
Original line number Diff line number Diff line
@@ -668,12 +668,19 @@ public class ResolverActivity extends Activity {
                && mAdapter.mOrigResolveList != null) {
            // Build a reasonable intent filter, based on what matched.
            IntentFilter filter = new IntentFilter();
            String action = intent.getAction();
            Intent filterIntent;

            if (intent.getSelector() != null) {
                filterIntent = intent.getSelector();
            } else {
                filterIntent = intent;
            }

            String action = filterIntent.getAction();
            if (action != null) {
                filter.addAction(action);
            }
            Set<String> categories = intent.getCategories();
            Set<String> categories = filterIntent.getCategories();
            if (categories != null) {
                for (String cat : categories) {
                    filter.addCategory(cat);
@@ -682,9 +689,9 @@ public class ResolverActivity extends Activity {
            filter.addCategory(Intent.CATEGORY_DEFAULT);

            int cat = ri.match & IntentFilter.MATCH_CATEGORY_MASK;
            Uri data = intent.getData();
            Uri data = filterIntent.getData();
            if (cat == IntentFilter.MATCH_CATEGORY_TYPE) {
                String mimeType = intent.resolveType(this);
                String mimeType = filterIntent.resolveType(this);
                if (mimeType != null) {
                    try {
                        filter.addDataType(mimeType);