mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-12-02 13:32:19 -05:00
Optimize comments, remove dead code
This commit is contained in:
parent
56cd3ab9c7
commit
d3d36485d5
@ -65,7 +65,7 @@ public class AccountSettingsActivity extends ActionBarActivity {
|
|||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
Log.d(Constants.TAG, "uri: " + mAccountUri);
|
Log.d(Constants.TAG, "uri: " + mAccountUri);
|
||||||
loadData(savedInstanceState, mAccountUri);
|
loadData(mAccountUri);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -89,8 +89,7 @@ public class AccountSettingsActivity extends ActionBarActivity {
|
|||||||
return super.onOptionsItemSelected(item);
|
return super.onOptionsItemSelected(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void loadData(Bundle savedInstanceState, Uri accountUri) {
|
private void loadData(Uri accountUri) {
|
||||||
// TODO: load this also like other fragment with newInstance arguments?
|
|
||||||
AccountSettings settings = ProviderHelper.getApiAccountSettings(this, accountUri);
|
AccountSettings settings = ProviderHelper.getApiAccountSettings(this, accountUri);
|
||||||
mAccountSettingsFragment.setAccSettings(settings);
|
mAccountSettingsFragment.setAccSettings(settings);
|
||||||
}
|
}
|
||||||
@ -104,7 +103,6 @@ public class AccountSettingsActivity extends ActionBarActivity {
|
|||||||
|
|
||||||
private void save() {
|
private void save() {
|
||||||
ProviderHelper.updateApiAccount(this, mAccountSettingsFragment.getAccSettings(), mAccountUri);
|
ProviderHelper.updateApiAccount(this, mAccountSettingsFragment.getAccSettings(), mAccountUri);
|
||||||
|
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -166,7 +166,7 @@ public class AccountSettingsFragment extends Fragment implements
|
|||||||
Intent intent = new Intent(getActivity(), EditKeyActivity.class);
|
Intent intent = new Intent(getActivity(), EditKeyActivity.class);
|
||||||
intent.setAction(EditKeyActivity.ACTION_CREATE_KEY);
|
intent.setAction(EditKeyActivity.ACTION_CREATE_KEY);
|
||||||
intent.putExtra(EditKeyActivity.EXTRA_GENERATE_DEFAULT_KEYS, true);
|
intent.putExtra(EditKeyActivity.EXTRA_GENERATE_DEFAULT_KEYS, true);
|
||||||
// set default user id to account name TODO: not working currently in EditKey
|
// set default user id to account name
|
||||||
intent.putExtra(EditKeyActivity.EXTRA_USER_IDS, mAccSettings.getAccountName());
|
intent.putExtra(EditKeyActivity.EXTRA_USER_IDS, mAccSettings.getAccountName());
|
||||||
startActivityForResult(intent, REQUEST_CODE_CREATE_KEY);
|
startActivityForResult(intent, REQUEST_CODE_CREATE_KEY);
|
||||||
}
|
}
|
||||||
|
@ -164,7 +164,7 @@ public class AccountsListFragment extends ListFragment implements
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Similar to CursorAdapter.getItemId().
|
* Similar to CursorAdapter.getItemId().
|
||||||
* Required to build Uris for api app view, which is not based on row ids
|
* Required to build Uris for api accounts, which are not based on row ids
|
||||||
*
|
*
|
||||||
* @param position
|
* @param position
|
||||||
* @return
|
* @return
|
||||||
|
@ -85,7 +85,6 @@ public class AppSettingsActivity extends ActionBarActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void loadData(Bundle savedInstanceState, Uri appUri) {
|
private void loadData(Bundle savedInstanceState, Uri appUri) {
|
||||||
// TODO: load this also like other fragment with newInstance arguments?
|
|
||||||
AppSettings settings = ProviderHelper.getApiAppSettings(this, appUri);
|
AppSettings settings = ProviderHelper.getApiAppSettings(this, appUri);
|
||||||
mSettingsFragment.setAppSettings(settings);
|
mSettingsFragment.setAppSettings(settings);
|
||||||
|
|
||||||
|
@ -124,7 +124,7 @@ public class AppsListFragment extends ListFragment implements
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Similar to CursorAdapter.getItemId().
|
* Similar to CursorAdapter.getItemId().
|
||||||
* Required to build Uris for api app view, which is not based on row ids
|
* Required to build Uris for api apps, which are not based on row ids
|
||||||
*
|
*
|
||||||
* @param position
|
* @param position
|
||||||
* @return
|
* @return
|
||||||
|
@ -21,7 +21,6 @@ import android.content.Intent;
|
|||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
import android.os.Messenger;
|
|
||||||
import android.support.v7.app.ActionBarActivity;
|
import android.support.v7.app.ActionBarActivity;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
|
||||||
@ -31,7 +30,6 @@ import org.sufficientlysecure.keychain.Constants;
|
|||||||
import org.sufficientlysecure.keychain.Id;
|
import org.sufficientlysecure.keychain.Id;
|
||||||
import org.sufficientlysecure.keychain.R;
|
import org.sufficientlysecure.keychain.R;
|
||||||
import org.sufficientlysecure.keychain.helper.ActionBarHelper;
|
import org.sufficientlysecure.keychain.helper.ActionBarHelper;
|
||||||
import org.sufficientlysecure.keychain.pgp.exception.PgpGeneralException;
|
|
||||||
import org.sufficientlysecure.keychain.provider.KeychainContract;
|
import org.sufficientlysecure.keychain.provider.KeychainContract;
|
||||||
import org.sufficientlysecure.keychain.provider.ProviderHelper;
|
import org.sufficientlysecure.keychain.provider.ProviderHelper;
|
||||||
import org.sufficientlysecure.keychain.remote.AccountSettings;
|
import org.sufficientlysecure.keychain.remote.AccountSettings;
|
||||||
@ -302,41 +300,4 @@ public class RemoteServiceActivity extends ActionBarActivity {
|
|||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Shows passphrase dialog to cache a new passphrase the user enters for using it later for
|
|
||||||
* encryption. Based on mSecretKeyId it asks for a passphrase to open a private key or it asks
|
|
||||||
* for a symmetric passphrase
|
|
||||||
*/
|
|
||||||
private void showPassphraseDialog(final Intent data, long secretKeyId) {
|
|
||||||
// Message is received after passphrase is cached
|
|
||||||
Handler returnHandler = new Handler() {
|
|
||||||
@Override
|
|
||||||
public void handleMessage(Message message) {
|
|
||||||
if (message.what == PassphraseDialogFragment.MESSAGE_OKAY) {
|
|
||||||
// return given params again, for calling the service method again
|
|
||||||
RemoteServiceActivity.this.setResult(RESULT_OK, data);
|
|
||||||
} else {
|
|
||||||
RemoteServiceActivity.this.setResult(RESULT_CANCELED);
|
|
||||||
}
|
|
||||||
|
|
||||||
RemoteServiceActivity.this.finish();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// Create a new Messenger for the communication back
|
|
||||||
Messenger messenger = new Messenger(returnHandler);
|
|
||||||
|
|
||||||
try {
|
|
||||||
PassphraseDialogFragment passphraseDialog = PassphraseDialogFragment.newInstance(this,
|
|
||||||
messenger, secretKeyId);
|
|
||||||
|
|
||||||
passphraseDialog.show(getSupportFragmentManager(), "passphraseDialog");
|
|
||||||
} catch (PgpGeneralException e) {
|
|
||||||
Log.d(Constants.TAG, "No passphrase for this secret key, do pgp operation directly!");
|
|
||||||
// return given params again, for calling the service method again
|
|
||||||
setResult(RESULT_OK, data);
|
|
||||||
finish();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user