GoogleGit

commit34d41e9a85f4e2e092b5eb8c7fa4554254650fe4[log][tgz]
authorAmith Yamasani <yamasani@google.com>Wed Oct 23 16:05:29 2013 -0700
committerAmith Yamasani <yamasani@google.com>Wed Oct 23 16:05:29 2013 -0700
treed3a89e728d7739a2850dcdbc296dc34c7cddd024
parent02e4c3a1d870be7ced0f70f460d718924f6e348f[diff]
Only simulate the first click if "Always use" button is available

This prevents Keep from being selected automatically when shown in the Share dialog
if Keep was previously chosen by the user as Always use for a send action.
This was a regression introduced by the new intent disambig behavior.

Bug: 11294904
Change-Id: I6745060a8ee0a6d680e657b55ee46aaec27bbacb
diff --git a/core/java/com/android/internal/app/ResolverActivity.java b/core/java/com/android/internal/app/ResolverActivity.java
index cd853b6..591267e 100644
--- a/core/java/com/android/internal/app/ResolverActivity.java
+++ b/core/java/com/android/internal/app/ResolverActivity.java
@@ -181,11 +181,12 @@
             } else {
                 mAlwaysUseOption = false;
             }
-        }
-        final int initialHighlight = mAdapter.getInitialHighlight();
-        if (initialHighlight >= 0) {
-            mListView.setItemChecked(initialHighlight, true);
-            onItemClick(null, null, initialHighlight, 0); // Other entries are not used
+            // Set the initial highlight if there was a preferred or last used choice
+            final int initialHighlight = mAdapter.getInitialHighlight();
+            if (initialHighlight >= 0) {
+                mListView.setItemChecked(initialHighlight, true);
+                onItemClick(null, null, initialHighlight, 0); // Other entries are not used
+            }
         }
     }