From b63fe462a4e0b9eb3936beb875ec240fa58138a2 Mon Sep 17 00:00:00 2001 From: Dominik Date: Wed, 25 Apr 2012 18:59:51 +0200 Subject: [PATCH] restructering services --- org_apg/AndroidManifest.xml | 31 ++++++++++--------- .../apg/provider/ApgServiceBlobDatabase.java | 2 +- .../apg/provider/ApgServiceBlobProvider.java | 2 +- .../android/apg/service/ApgRemoteService.java | 5 +++ .../apg/{ => service}/ApgService2.java | 22 ++++++++++--- .../IApgService2.aidl} | 4 +-- .../PassphraseCacheService.java} | 11 ++++--- .../android/apg/ui/BaseActivity.java | 6 ++-- .../android/apg/ui/EditKeyActivity.java | 3 +- .../thialfihar/android/apg/util/ApgCon.java | 10 +++--- 10 files changed, 59 insertions(+), 37 deletions(-) create mode 100644 org_apg/src/org/thialfihar/android/apg/service/ApgRemoteService.java rename org_apg/src/org/thialfihar/android/apg/{ => service}/ApgService2.java (97%) rename org_apg/src/org/thialfihar/android/apg/{IApgService.aidl => service/IApgService2.aidl} (98%) rename org_apg/src/org/thialfihar/android/apg/{Service.java => service/PassphraseCacheService.java} (90%) diff --git a/org_apg/AndroidManifest.xml b/org_apg/AndroidManifest.xml index e51f9eac4..797f87fab 100644 --- a/org_apg/AndroidManifest.xml +++ b/org_apg/AndroidManifest.xml @@ -223,23 +223,24 @@ android:name="org.thialfihar.android.apg.ui.HelpActivity" android:label="@string/title_help" /> - - + - - - - - - - - - - - - - + + + + + + + + mKeys; Vector mKeysUsages; - // will be set to true to build layout later in handler + // will be set to false to build layout later in handler private boolean mBuildLayout = true; @Override @@ -300,7 +300,6 @@ public class EditKeyActivity extends SherlockFragmentActivity { // extends BaseA } else { mChangePassPhrase.setVisibility(View.VISIBLE); } - } }); diff --git a/org_apg/src/org/thialfihar/android/apg/util/ApgCon.java b/org_apg/src/org/thialfihar/android/apg/util/ApgCon.java index 22a9a7eb5..7341341d5 100644 --- a/org_apg/src/org/thialfihar/android/apg/util/ApgCon.java +++ b/org_apg/src/org/thialfihar/android/apg/util/ApgCon.java @@ -16,7 +16,7 @@ package org.thialfihar.android.apg.util; -import org.thialfihar.android.apg.IApgService; +import org.thialfihar.android.apg.service.IApgService2; import org.thialfihar.android.apg.util.ApgConInterface.OnCallFinishListener; import android.content.ComponentName; @@ -97,13 +97,13 @@ public class ApgCon { private final ArrayList mWarningList = new ArrayList(); /** Remote service for decrypting and encrypting data */ - private IApgService mApgService = null; + private IApgService2 mApgService = null; /** Set apgService accordingly to connection status */ private ServiceConnection mApgConnection = new ServiceConnection() { public void onServiceConnected(ComponentName className, IBinder service) { if( LOCAL_LOGD ) Log.d(TAG, "IApgService bound to apgService"); - mApgService = IApgService.Stub.asInterface(service); + mApgService = IApgService2.Stub.asInterface(service); } public void onServiceDisconnected(ComponentName className) { @@ -231,7 +231,7 @@ public class ApgCon { } try { - mContext.bindService(new Intent(IApgService.class.getName()), mApgConnection, Context.BIND_AUTO_CREATE); + mContext.bindService(new Intent(IApgService2.class.getName()), mApgConnection, Context.BIND_AUTO_CREATE); } catch (Exception e) { Log.e(TAG, "could not bind APG service", e); return false; @@ -370,7 +370,7 @@ public class ApgCon { } try { - Boolean success = (Boolean) IApgService.class.getMethod(function, Bundle.class, Bundle.class).invoke(mApgService, pArgs, pReturn); + Boolean success = (Boolean) IApgService2.class.getMethod(function, Bundle.class, Bundle.class).invoke(mApgService, pArgs, pReturn); mErrorList.addAll(pReturn.getStringArrayList(ret.ERRORS.name())); mWarningList.addAll(pReturn.getStringArrayList(ret.WARNINGS.name())); return success;