Fix locked workspace in Home.
A dialog can be dismissed without being cancelled. This change simply adds a dismiss listener to the Add dialog in Home to make sure the workspace is properly unlocked when the dialog is dismissed.
This commit is contained in:
@@ -1744,7 +1744,7 @@ public final class Launcher extends Activity implements View.OnClickListener, On
|
|||||||
* appropriate activity.
|
* appropriate activity.
|
||||||
*/
|
*/
|
||||||
private class CreateShortcut implements DialogInterface.OnClickListener,
|
private class CreateShortcut implements DialogInterface.OnClickListener,
|
||||||
DialogInterface.OnCancelListener {
|
DialogInterface.OnCancelListener, DialogInterface.OnDismissListener {
|
||||||
private AddAdapter mAdapter;
|
private AddAdapter mAdapter;
|
||||||
|
|
||||||
Dialog createDialog() {
|
Dialog createDialog() {
|
||||||
@@ -1760,6 +1760,7 @@ public final class Launcher extends Activity implements View.OnClickListener, On
|
|||||||
|
|
||||||
AlertDialog dialog = builder.create();
|
AlertDialog dialog = builder.create();
|
||||||
dialog.setOnCancelListener(this);
|
dialog.setOnCancelListener(this);
|
||||||
|
dialog.setOnDismissListener(this);
|
||||||
|
|
||||||
return dialog;
|
return dialog;
|
||||||
}
|
}
|
||||||
@@ -1769,6 +1770,10 @@ public final class Launcher extends Activity implements View.OnClickListener, On
|
|||||||
cleanup();
|
cleanup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void onDismiss(DialogInterface dialog) {
|
||||||
|
mWorkspace.unlock();
|
||||||
|
}
|
||||||
|
|
||||||
private void cleanup() {
|
private void cleanup() {
|
||||||
mWorkspace.unlock();
|
mWorkspace.unlock();
|
||||||
dismissDialog(DIALOG_CREATE_SHORTCUT);
|
dismissDialog(DIALOG_CREATE_SHORTCUT);
|
||||||
|
|||||||
Reference in New Issue
Block a user