diff options
author | Sander Alewijnse <salewijnse@google.com> | 2015-02-09 10:17:56 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-02-09 10:17:57 +0000 |
commit | 8f6afec2aa84f4dc7684fa8e1e43150e8a611247 (patch) | |
tree | 66caec994f2293da6be060ff5b309e660441e114 | |
parent | 6de4c8827111ea32d036a7071e3cdc85343cc5d4 (diff) | |
parent | 86d35ba5d5925e5ba072a7fbc204a16be419bd5c (diff) | |
download | frameworks_base-8f6afec2aa84f4dc7684fa8e1e43150e8a611247.zip frameworks_base-8f6afec2aa84f4dc7684fa8e1e43150e8a611247.tar.gz frameworks_base-8f6afec2aa84f4dc7684fa8e1e43150e8a611247.tar.bz2 |
Merge "Move the check for launcher managed profile support."
-rw-r--r-- | core/java/com/android/internal/app/ResolverActivity.java | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/core/java/com/android/internal/app/ResolverActivity.java b/core/java/com/android/internal/app/ResolverActivity.java index 144cc33..a410e45 100644 --- a/core/java/com/android/internal/app/ResolverActivity.java +++ b/core/java/com/android/internal/app/ResolverActivity.java @@ -505,15 +505,6 @@ public class ResolverActivity extends Activity implements AdapterView.OnItemClic // Header views don't count. return; } - ResolveInfo resolveInfo = mAdapter.resolveInfoForPosition(position, true); - if (mResolvingHome && hasManagedProfile() - && !supportsManagedProfiles(resolveInfo)) { - Toast.makeText(this, String.format(getResources().getString( - com.android.internal.R.string.activity_resolver_work_profiles_support), - resolveInfo.activityInfo.loadLabel(getPackageManager()).toString()), - Toast.LENGTH_LONG).show(); - return; - } final int checkedPos = mListView.getCheckedItemPosition(); final boolean hasValidSelection = checkedPos != ListView.INVALID_POSITION; if (mAlwaysUseOption && (!hasValidSelection || mLastSelected != checkedPos)) { @@ -579,7 +570,6 @@ public class ResolverActivity extends Activity implements AdapterView.OnItemClic mListView.getCheckedItemPosition() : mAdapter.getFilteredPosition(), id == R.id.button_always, mAlwaysUseOption); - dismiss(); } void startSelected(int which, boolean always, boolean filtered) { @@ -587,6 +577,14 @@ public class ResolverActivity extends Activity implements AdapterView.OnItemClic return; } ResolveInfo ri = mAdapter.resolveInfoForPosition(which, filtered); + if (mResolvingHome && hasManagedProfile() && !supportsManagedProfiles(ri)) { + Toast.makeText(this, String.format(getResources().getString( + com.android.internal.R.string.activity_resolver_work_profiles_support), + ri.activityInfo.loadLabel(getPackageManager()).toString()), + Toast.LENGTH_LONG).show(); + return; + } + Intent intent = mAdapter.intentForPosition(which, filtered); onIntentSelected(ri, intent, always); finish(); |