api: handle passphrase entering correctly
This commit is contained in:
@@ -161,7 +161,7 @@ public class CryptoServiceActivity extends SherlockFragmentActivity {
|
||||
try {
|
||||
mServiceCallback.onRegistered(true, packageName);
|
||||
} catch (RemoteException e) {
|
||||
Log.e(Constants.TAG, "ServiceActivity");
|
||||
Log.e(Constants.TAG, "ServiceActivity", e);
|
||||
}
|
||||
finish();
|
||||
}
|
||||
@@ -174,7 +174,7 @@ public class CryptoServiceActivity extends SherlockFragmentActivity {
|
||||
try {
|
||||
mServiceCallback.onRegistered(false, packageName);
|
||||
} catch (RemoteException e) {
|
||||
Log.e(Constants.TAG, "ServiceActivity");
|
||||
Log.e(Constants.TAG, "ServiceActivity", e);
|
||||
}
|
||||
finish();
|
||||
}
|
||||
@@ -205,7 +205,7 @@ public class CryptoServiceActivity extends SherlockFragmentActivity {
|
||||
mServiceCallback.onSelectedPublicKeys(mSelectFragment
|
||||
.getSelectedMasterKeyIds());
|
||||
} catch (RemoteException e) {
|
||||
Log.e(Constants.TAG, "ServiceActivity");
|
||||
Log.e(Constants.TAG, "ServiceActivity", e);
|
||||
}
|
||||
finish();
|
||||
}
|
||||
@@ -219,7 +219,7 @@ public class CryptoServiceActivity extends SherlockFragmentActivity {
|
||||
mServiceCallback.onSelectedPublicKeys(mSelectFragment
|
||||
.getSelectedMasterKeyIds());
|
||||
} catch (RemoteException e) {
|
||||
Log.e(Constants.TAG, "ServiceActivity");
|
||||
Log.e(Constants.TAG, "ServiceActivity", e);
|
||||
}
|
||||
finish();
|
||||
}
|
||||
@@ -266,14 +266,14 @@ public class CryptoServiceActivity extends SherlockFragmentActivity {
|
||||
try {
|
||||
mServiceCallback.onCachedPassphrase(true);
|
||||
} catch (RemoteException e) {
|
||||
Log.e(Constants.TAG, "ServiceActivity");
|
||||
Log.e(Constants.TAG, "ServiceActivity", e);
|
||||
}
|
||||
finish();
|
||||
} else {
|
||||
try {
|
||||
mServiceCallback.onCachedPassphrase(false);
|
||||
} catch (RemoteException e) {
|
||||
Log.e(Constants.TAG, "ServiceActivity");
|
||||
Log.e(Constants.TAG, "ServiceActivity", e);
|
||||
}
|
||||
finish();
|
||||
}
|
||||
|
||||
@@ -60,6 +60,7 @@ public class PassphraseDialogFragment extends DialogFragment implements OnEditor
|
||||
private static final String ARG_SECRET_KEY_ID = "secret_key_id";
|
||||
|
||||
public static final int MESSAGE_OKAY = 1;
|
||||
public static final int MESSAGE_CANCEL = 2;
|
||||
|
||||
private Messenger mMessenger;
|
||||
private EditText mPassphraseEditText;
|
||||
@@ -215,7 +216,7 @@ public class PassphraseDialogFragment extends DialogFragment implements OnEditor
|
||||
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
dismiss();
|
||||
dialog.cancel();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -235,6 +236,14 @@ public class PassphraseDialogFragment extends DialogFragment implements OnEditor
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCancel(DialogInterface dialog) {
|
||||
super.onCancel(dialog);
|
||||
|
||||
dismiss();
|
||||
sendMessageToHandler(MESSAGE_CANCEL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Associate the "done" button on the soft keyboard with the okay button in the view
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user