Loading core/java/com/android/internal/app/ChooserActivity.java +9 −3 Original line number Diff line number Diff line Loading @@ -1163,8 +1163,10 @@ public class ChooserActivity extends ResolverActivity implements -1); // Action bar is user-independent, always start as primary safelyStartActivityAsUser(ti, getPersonalProfileUserHandle()); if (!mAwaitingDelegateResponse) { finish(); } } ); b.setId(R.id.chooser_nearby_button); return b; Loading @@ -1185,8 +1187,10 @@ public class ChooserActivity extends ResolverActivity implements -1); // Action bar is user-independent, always start as primary safelyStartActivityAsUser(ti, getPersonalProfileUserHandle()); if (!mAwaitingDelegateResponse) { finish(); } } ); b.setId(R.id.chooser_edit_button); return b; Loading Loading @@ -2212,7 +2216,9 @@ public class ChooserActivity extends ResolverActivity implements TargetInfo clonedTarget = selectedTarget.cloneFilledIn(matchingIntent, 0); if (super.onTargetSelected(clonedTarget, false)) { updateModelAndChooserCounts(clonedTarget); if (!mAwaitingDelegateResponse) { finish(); } return; } } Loading core/java/com/android/internal/app/ResolverActivity.java +32 −6 Original line number Diff line number Diff line Loading @@ -152,6 +152,8 @@ public class ResolverActivity extends Activity implements /** See {@link #setRetainInOnStop}. */ private boolean mRetainInOnStop; private static final int REQUEST_CODE_RETURN_FROM_DELEGATE_CHOOSER = 20; private static final String EXTRA_SHOW_FRAGMENT_ARGS = ":settings:show_fragment_args"; private static final String EXTRA_FRAGMENT_ARG_KEY = ":settings:fragment_args_key"; private static final String OPEN_LINKS_COMPONENT_KEY = "app_link_state"; Loading Loading @@ -203,6 +205,8 @@ public class ResolverActivity extends Activity implements private UserHandle mWorkProfileUserHandle; protected boolean mAwaitingDelegateResponse; /** * Get the string resource to be used as a label for the link to the resolver activity for an * action. Loading Loading @@ -584,8 +588,10 @@ public class ResolverActivity extends Activity implements mProfileSwitchMessageId = -1; onTargetSelected(dri, false); if (!mAwaitingDelegateResponse) { finish(); } } /** * Numerous layouts are supported, each with optional ViewGroups. Loading Loading @@ -1026,9 +1032,11 @@ public class ResolverActivity extends Activity implements mMultiProfilePagerAdapter.getActiveListAdapter().hasFilteredItem() ? MetricsProto.MetricsEvent.ACTION_HIDE_APP_DISAMBIG_APP_FEATURED : MetricsProto.MetricsEvent.ACTION_HIDE_APP_DISAMBIG_NONE_FEATURED); if (!mAwaitingDelegateResponse) { finish(); } } } /** * Replace me in subclasses! Loading Loading @@ -1354,15 +1362,31 @@ public class ResolverActivity extends Activity implements chooserIntent.putExtra(ActivityTaskManager.EXTRA_IGNORE_TARGET_SECURITY, ignoreTargetSecurity); chooserIntent.putExtra(Intent.EXTRA_USER_ID, userId); chooserIntent.addFlags(Intent.FLAG_ACTIVITY_FORWARD_RESULT | Intent.FLAG_ACTIVITY_PREVIOUS_IS_TOP); startActivity(chooserIntent); chooserIntent.addFlags(Intent.FLAG_ACTIVITY_PREVIOUS_IS_TOP); // Don't close until the delegate finishes, or the token will be invalidated. mAwaitingDelegateResponse = true; startActivityForResult(chooserIntent, REQUEST_CODE_RETURN_FROM_DELEGATE_CHOOSER); } catch (RemoteException e) { Log.e(TAG, e.toString()); } return true; } @Override public void onActivityResult(int requestCode, int resultCode, Intent data) { switch (requestCode) { case REQUEST_CODE_RETURN_FROM_DELEGATE_CHOOSER: // Repeat the delegate's result as our own. setResult(resultCode, data); finish(); break; default: super.onActivityResult(requestCode, resultCode, data); } } public void onActivityStarted(TargetInfo cti) { // Do nothing } Loading Loading @@ -2152,11 +2176,13 @@ public class ResolverActivity extends Activity implements .getItem(selections[0].getIndex()); if (ra.onTargetSelected(ti, false)) { ra.mPickOptionRequest = null; if (!ra.mAwaitingDelegateResponse) { ra.finish(); } } } } } protected void maybeLogProfileChange() {} } Loading
core/java/com/android/internal/app/ChooserActivity.java +9 −3 Original line number Diff line number Diff line Loading @@ -1163,8 +1163,10 @@ public class ChooserActivity extends ResolverActivity implements -1); // Action bar is user-independent, always start as primary safelyStartActivityAsUser(ti, getPersonalProfileUserHandle()); if (!mAwaitingDelegateResponse) { finish(); } } ); b.setId(R.id.chooser_nearby_button); return b; Loading @@ -1185,8 +1187,10 @@ public class ChooserActivity extends ResolverActivity implements -1); // Action bar is user-independent, always start as primary safelyStartActivityAsUser(ti, getPersonalProfileUserHandle()); if (!mAwaitingDelegateResponse) { finish(); } } ); b.setId(R.id.chooser_edit_button); return b; Loading Loading @@ -2212,7 +2216,9 @@ public class ChooserActivity extends ResolverActivity implements TargetInfo clonedTarget = selectedTarget.cloneFilledIn(matchingIntent, 0); if (super.onTargetSelected(clonedTarget, false)) { updateModelAndChooserCounts(clonedTarget); if (!mAwaitingDelegateResponse) { finish(); } return; } } Loading
core/java/com/android/internal/app/ResolverActivity.java +32 −6 Original line number Diff line number Diff line Loading @@ -152,6 +152,8 @@ public class ResolverActivity extends Activity implements /** See {@link #setRetainInOnStop}. */ private boolean mRetainInOnStop; private static final int REQUEST_CODE_RETURN_FROM_DELEGATE_CHOOSER = 20; private static final String EXTRA_SHOW_FRAGMENT_ARGS = ":settings:show_fragment_args"; private static final String EXTRA_FRAGMENT_ARG_KEY = ":settings:fragment_args_key"; private static final String OPEN_LINKS_COMPONENT_KEY = "app_link_state"; Loading Loading @@ -203,6 +205,8 @@ public class ResolverActivity extends Activity implements private UserHandle mWorkProfileUserHandle; protected boolean mAwaitingDelegateResponse; /** * Get the string resource to be used as a label for the link to the resolver activity for an * action. Loading Loading @@ -584,8 +588,10 @@ public class ResolverActivity extends Activity implements mProfileSwitchMessageId = -1; onTargetSelected(dri, false); if (!mAwaitingDelegateResponse) { finish(); } } /** * Numerous layouts are supported, each with optional ViewGroups. Loading Loading @@ -1026,9 +1032,11 @@ public class ResolverActivity extends Activity implements mMultiProfilePagerAdapter.getActiveListAdapter().hasFilteredItem() ? MetricsProto.MetricsEvent.ACTION_HIDE_APP_DISAMBIG_APP_FEATURED : MetricsProto.MetricsEvent.ACTION_HIDE_APP_DISAMBIG_NONE_FEATURED); if (!mAwaitingDelegateResponse) { finish(); } } } /** * Replace me in subclasses! Loading Loading @@ -1354,15 +1362,31 @@ public class ResolverActivity extends Activity implements chooserIntent.putExtra(ActivityTaskManager.EXTRA_IGNORE_TARGET_SECURITY, ignoreTargetSecurity); chooserIntent.putExtra(Intent.EXTRA_USER_ID, userId); chooserIntent.addFlags(Intent.FLAG_ACTIVITY_FORWARD_RESULT | Intent.FLAG_ACTIVITY_PREVIOUS_IS_TOP); startActivity(chooserIntent); chooserIntent.addFlags(Intent.FLAG_ACTIVITY_PREVIOUS_IS_TOP); // Don't close until the delegate finishes, or the token will be invalidated. mAwaitingDelegateResponse = true; startActivityForResult(chooserIntent, REQUEST_CODE_RETURN_FROM_DELEGATE_CHOOSER); } catch (RemoteException e) { Log.e(TAG, e.toString()); } return true; } @Override public void onActivityResult(int requestCode, int resultCode, Intent data) { switch (requestCode) { case REQUEST_CODE_RETURN_FROM_DELEGATE_CHOOSER: // Repeat the delegate's result as our own. setResult(resultCode, data); finish(); break; default: super.onActivityResult(requestCode, resultCode, data); } } public void onActivityStarted(TargetInfo cti) { // Do nothing } Loading Loading @@ -2152,11 +2176,13 @@ public class ResolverActivity extends Activity implements .getItem(selections[0].getIndex()); if (ra.onTargetSelected(ti, false)) { ra.mPickOptionRequest = null; if (!ra.mAwaitingDelegateResponse) { ra.finish(); } } } } } protected void maybeLogProfileChange() {} }