Merge "Fixing PinItemActivity not getting dismissed when starting drag-and-drop in multi-window mode" into ub-launcher3-dorval-polish

This commit is contained in:
TreeHugger Robot
2017-06-22 17:53:23 +00:00
committed by Android (Google) Code Review
@@ -84,6 +84,8 @@ public class AddItemActivity extends BaseActivity implements OnLongClickListener
private int mPendingBindWidgetId;
private Bundle mWidgetOptions;
private boolean mFinishOnPause = false;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@@ -163,6 +165,7 @@ public class AddItemActivity extends BaseActivity implements OnLongClickListener
startActivity(homeIntent,
ActivityOptions.makeCustomAnimation(this, 0, android.R.anim.fade_out).toBundle());
mFinishOnPause = true;
// Start a system drag and drop. We use a transparent bitmap as preview for system drag
// as the preview is handled internally by launcher.
@@ -182,6 +185,14 @@ public class AddItemActivity extends BaseActivity implements OnLongClickListener
return false;
}
@Override
protected void onPause() {
super.onPause();
if (mFinishOnPause) {
finish();
}
}
private void setupShortcut() {
PinShortcutRequestActivityInfo shortcutInfo =
new PinShortcutRequestActivityInfo(mRequest, this);