progress is shown when creating the default key based on number of keys created so far

This commit is contained in:
grait 2014-03-08 03:24:16 +05:30
parent 2737aedca7
commit 3fbda4245c
2 changed files with 8 additions and 1 deletions

View File

@ -596,13 +596,20 @@ public class KeychainIntentService extends IntentService implements ProgressDial
String passphrase = data.getString(GENERATE_KEY_SYMMETRIC_PASSPHRASE);
/* Operation */
int keysTotal = 2;
int keysCreated =0;
this.setProgress(keysCreated, keysTotal);
PgpKeyOperation keyOperations = new PgpKeyOperation(this, this);
PGPSecretKey masterKey = keyOperations.createKey(Id.choice.algorithm.rsa,
4096, passphrase, true);
keysCreated++;
setProgress(keysCreated, keysTotal);
PGPSecretKey subKey = keyOperations.createKey(Id.choice.algorithm.rsa,
4096, passphrase, false);
keysCreated++;
setProgress(keysCreated, keysTotal );
// TODO: default to one master for cert, one sub for encrypt and one sub
// for sign

View File

@ -187,7 +187,7 @@ public class EditKeyActivity extends ActionBarActivity {
// Message is received after generating is done in ApgService
KeychainIntentServiceHandler saveHandler = new KeychainIntentServiceHandler(
this, R.string.progress_generating, ProgressDialog.STYLE_SPINNER, true,
this, R.string.progress_generating, ProgressDialog.STYLE_HORIZONTAL, true,
new DialogInterface.OnCancelListener() {
@Override