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:
parent
c2e24c0a37
commit
cbb89e4fc2
|
@ -1744,7 +1744,7 @@ public final class Launcher extends Activity implements View.OnClickListener, On
|
|||
* appropriate activity.
|
||||
*/
|
||||
private class CreateShortcut implements DialogInterface.OnClickListener,
|
||||
DialogInterface.OnCancelListener {
|
||||
DialogInterface.OnCancelListener, DialogInterface.OnDismissListener {
|
||||
private AddAdapter mAdapter;
|
||||
|
||||
Dialog createDialog() {
|
||||
|
@ -1760,6 +1760,7 @@ public final class Launcher extends Activity implements View.OnClickListener, On
|
|||
|
||||
AlertDialog dialog = builder.create();
|
||||
dialog.setOnCancelListener(this);
|
||||
dialog.setOnDismissListener(this);
|
||||
|
||||
return dialog;
|
||||
}
|
||||
|
@ -1769,6 +1770,10 @@ public final class Launcher extends Activity implements View.OnClickListener, On
|
|||
cleanup();
|
||||
}
|
||||
|
||||
public void onDismiss(DialogInterface dialog) {
|
||||
mWorkspace.unlock();
|
||||
}
|
||||
|
||||
private void cleanup() {
|
||||
mWorkspace.unlock();
|
||||
dismissDialog(DIALOG_CREATE_SHORTCUT);
|
||||
|
|
Loading…
Reference in New Issue