diff options
author | Dominik Schürmann <dominik@dominikschuermann.de> | 2013-09-06 10:03:25 +0200 |
---|---|---|
committer | Dominik Schürmann <dominik@dominikschuermann.de> | 2013-09-06 10:03:25 +0200 |
commit | c97c57d34ea1994312ad7e409042ec55cf27c1d2 (patch) | |
tree | cdcbd111815aa134429a23741572505997dfcf98 /OpenPGP-Keychain/src/org/sufficientlysecure | |
parent | c9549befb250826912d153d40c459fc495aa7fb5 (diff) | |
download | open-keychain-c97c57d34ea1994312ad7e409042ec55cf27c1d2.tar.gz open-keychain-c97c57d34ea1994312ad7e409042ec55cf27c1d2.tar.bz2 open-keychain-c97c57d34ea1994312ad7e409042ec55cf27c1d2.zip |
remove dead code
Diffstat (limited to 'OpenPGP-Keychain/src/org/sufficientlysecure')
-rw-r--r-- | OpenPGP-Keychain/src/org/sufficientlysecure/keychain/remote_api/AppSettingsActivity.java | 15 | ||||
-rw-r--r-- | OpenPGP-Keychain/src/org/sufficientlysecure/keychain/remote_api/ServiceActivity.java | 41 |
2 files changed, 28 insertions, 28 deletions
diff --git a/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/remote_api/AppSettingsActivity.java b/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/remote_api/AppSettingsActivity.java index 4e069f3b0..55fa72b0e 100644 --- a/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/remote_api/AppSettingsActivity.java +++ b/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/remote_api/AppSettingsActivity.java @@ -12,7 +12,6 @@ import android.net.Uri; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; -import android.widget.Button; import android.widget.TextView; import com.actionbarsherlock.app.ActionBar; @@ -22,22 +21,15 @@ import com.actionbarsherlock.view.MenuItem; public class AppSettingsActivity extends SherlockFragmentActivity { // model - Uri mAppUri; - String mPackageName; + private Uri mAppUri; + private String mPackageName; - // view - Button saveButton; - Button revokeButton; - - AppSettingsFragment settingsFragment; + private AppSettingsFragment settingsFragment; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - // pm = getApplicationContext().getPackageManager(); - - // BEGIN_INCLUDE (inflate_set_custom_view) // Inflate a "Done" custom action bar view to serve as the "Up" affordance. final LayoutInflater inflater = (LayoutInflater) getSupportActionBar().getThemedContext() .getSystemService(LAYOUT_INFLATER_SERVICE); @@ -60,7 +52,6 @@ public class AppSettingsActivity extends SherlockFragmentActivity { actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM, ActionBar.DISPLAY_SHOW_CUSTOM | ActionBar.DISPLAY_SHOW_HOME | ActionBar.DISPLAY_SHOW_TITLE); actionBar.setCustomView(customActionBarView); - // END_INCLUDE (inflate_set_custom_view) setContentView(R.layout.api_app_settings_activity); diff --git a/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/remote_api/ServiceActivity.java b/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/remote_api/ServiceActivity.java index 5f36075f5..422026a19 100644 --- a/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/remote_api/ServiceActivity.java +++ b/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/remote_api/ServiceActivity.java @@ -17,16 +17,13 @@ package org.sufficientlysecure.keychain.remote_api; import org.sufficientlysecure.keychain.Constants; +import org.sufficientlysecure.keychain.Id; import org.sufficientlysecure.keychain.R; -import org.sufficientlysecure.keychain.remote_api.IServiceActivityCallback; import org.sufficientlysecure.keychain.helper.PgpMain; import org.sufficientlysecure.keychain.provider.ProviderHelper; import org.sufficientlysecure.keychain.ui.dialog.PassphraseDialogFragment; import org.sufficientlysecure.keychain.util.Log; -import com.actionbarsherlock.app.ActionBar; -import com.actionbarsherlock.app.SherlockFragmentActivity; - import android.content.ComponentName; import android.content.Context; import android.content.Intent; @@ -41,6 +38,10 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; +import android.widget.Toast; + +import com.actionbarsherlock.app.ActionBar; +import com.actionbarsherlock.app.SherlockFragmentActivity; public class ServiceActivity extends SherlockFragmentActivity { @@ -53,6 +54,9 @@ public class ServiceActivity extends SherlockFragmentActivity { private IServiceActivityCallback mServiceCallback; private boolean mServiceBound; + // view + AppSettingsFragment settingsFragment; + private ServiceConnection mServiceActivityConnection = new ServiceConnection() { public void onServiceConnected(ComponentName name, IBinder service) { mServiceCallback = IServiceActivityCallback.Stub.asInterface(service); @@ -132,7 +136,6 @@ public class ServiceActivity extends SherlockFragmentActivity { if (ACTION_REGISTER.equals(action)) { final String packageName = extras.getString(EXTRA_PACKAGE_NAME); - // BEGIN_INCLUDE (inflate_set_custom_view) // Inflate a "Done"/"Cancel" custom action bar view final LayoutInflater inflater = (LayoutInflater) getSupportActionBar() .getThemedContext().getSystemService(LAYOUT_INFLATER_SERVICE); @@ -146,15 +149,22 @@ public class ServiceActivity extends SherlockFragmentActivity { @Override public void onClick(View v) { // Allow - ProviderHelper.addCryptoConsumer(ServiceActivity.this, packageName); - // Intent data = new Intent(); - try { - mServiceCallback.onRegistered(true, packageName); - } catch (RemoteException e) { - Log.e(Constants.TAG, "ServiceActivity"); + if (settingsFragment.getSecretKeyId() == Id.key.none) { + Toast.makeText(ServiceActivity.this, + R.string.api_register_error_select_key, Toast.LENGTH_LONG) + .show(); + } else { + ProviderHelper.addCryptoConsumer(ServiceActivity.this, packageName); + // Intent data = new Intent(); + + try { + mServiceCallback.onRegistered(true, packageName); + } catch (RemoteException e) { + Log.e(Constants.TAG, "ServiceActivity"); + } + finish(); } - finish(); } }); ((TextView) customActionBarView.findViewById(R.id.actionbar_cancel_text)) @@ -180,13 +190,12 @@ public class ServiceActivity extends SherlockFragmentActivity { | ActionBar.DISPLAY_SHOW_TITLE); actionBar.setCustomView(customActionBarView, new ActionBar.LayoutParams( ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)); - // END_INCLUDE (inflate_set_custom_view) setContentView(R.layout.api_app_register_activity); - AppSettingsFragment settingsFragment = (AppSettingsFragment) getSupportFragmentManager() - .findFragmentById(R.id.api_app_settings_fragment); - + settingsFragment = (AppSettingsFragment) getSupportFragmentManager().findFragmentById( + R.id.api_app_settings_fragment); + settingsFragment.setPackage(packageName); // TODO: handle if app is already registered |