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:
Romain Guy
2009-06-08 15:52:54 -07:00
parent c2e24c0a37
commit cbb89e4fc2
+6 -1
View File
@@ -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);