diff options
Diffstat (limited to 'org_apg/src')
-rw-r--r-- | org_apg/src/org/thialfihar/android/apg/provider/ApgServiceBlobDatabase.java | 2 | ||||
-rw-r--r-- | org_apg/src/org/thialfihar/android/apg/provider/ApgServiceBlobProvider.java | 2 | ||||
-rw-r--r-- | org_apg/src/org/thialfihar/android/apg/service/ApgRemoteService.java | 5 | ||||
-rw-r--r-- | org_apg/src/org/thialfihar/android/apg/service/ApgService2.java (renamed from org_apg/src/org/thialfihar/android/apg/ApgService2.java) | 22 | ||||
-rw-r--r-- | org_apg/src/org/thialfihar/android/apg/service/IApgService2.aidl (renamed from org_apg/src/org/thialfihar/android/apg/IApgService.aidl) | 4 | ||||
-rw-r--r-- | org_apg/src/org/thialfihar/android/apg/service/PassphraseCacheService.java (renamed from org_apg/src/org/thialfihar/android/apg/Service.java) | 11 | ||||
-rw-r--r-- | org_apg/src/org/thialfihar/android/apg/ui/BaseActivity.java | 6 | ||||
-rw-r--r-- | org_apg/src/org/thialfihar/android/apg/ui/EditKeyActivity.java | 3 | ||||
-rw-r--r-- | org_apg/src/org/thialfihar/android/apg/util/ApgCon.java | 10 |
9 files changed, 43 insertions, 22 deletions
diff --git a/org_apg/src/org/thialfihar/android/apg/provider/ApgServiceBlobDatabase.java b/org_apg/src/org/thialfihar/android/apg/provider/ApgServiceBlobDatabase.java index a0b42ead7..509dfe8b4 100644 --- a/org_apg/src/org/thialfihar/android/apg/provider/ApgServiceBlobDatabase.java +++ b/org_apg/src/org/thialfihar/android/apg/provider/ApgServiceBlobDatabase.java @@ -14,7 +14,7 @@ package org.thialfihar.android.apg.provider; -import org.thialfihar.android.apg.ApgService2; +import org.thialfihar.android.apg.service.ApgService2; import android.content.ContentUris; import android.content.ContentValues; diff --git a/org_apg/src/org/thialfihar/android/apg/provider/ApgServiceBlobProvider.java b/org_apg/src/org/thialfihar/android/apg/provider/ApgServiceBlobProvider.java index 28e94bf5c..d7bacab76 100644 --- a/org_apg/src/org/thialfihar/android/apg/provider/ApgServiceBlobProvider.java +++ b/org_apg/src/org/thialfihar/android/apg/provider/ApgServiceBlobProvider.java @@ -14,8 +14,8 @@ package org.thialfihar.android.apg.provider; -import org.thialfihar.android.apg.ApgService2; import org.thialfihar.android.apg.Constants; +import org.thialfihar.android.apg.service.ApgService2; import android.content.ContentProvider; import android.content.ContentValues; diff --git a/org_apg/src/org/thialfihar/android/apg/service/ApgRemoteService.java b/org_apg/src/org/thialfihar/android/apg/service/ApgRemoteService.java new file mode 100644 index 000000000..1cfdf4864 --- /dev/null +++ b/org_apg/src/org/thialfihar/android/apg/service/ApgRemoteService.java @@ -0,0 +1,5 @@ +package org.thialfihar.android.apg.service; + +public class ApgRemoteService { + +} diff --git a/org_apg/src/org/thialfihar/android/apg/ApgService2.java b/org_apg/src/org/thialfihar/android/apg/service/ApgService2.java index 167845f51..efc4d2d0d 100644 --- a/org_apg/src/org/thialfihar/android/apg/ApgService2.java +++ b/org_apg/src/org/thialfihar/android/apg/service/ApgService2.java @@ -12,7 +12,7 @@ * limitations under the License. */ -package org.thialfihar.android.apg; +package org.thialfihar.android.apg.service; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; @@ -25,8 +25,15 @@ import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; -import org.thialfihar.android.apg.IApgService; +import org.thialfihar.android.apg.Apg; +import org.thialfihar.android.apg.service.IApgService2; +import org.thialfihar.android.apg.Id; +import org.thialfihar.android.apg.InputData; +import org.thialfihar.android.apg.Preferences; import org.thialfihar.android.apg.R; +import org.thialfihar.android.apg.service.IApgService2.Stub; +import org.thialfihar.android.apg.Id.database; +import org.thialfihar.android.apg.R.string; import org.thialfihar.android.apg.provider.KeyRings; import org.thialfihar.android.apg.provider.Keys; import org.thialfihar.android.apg.provider.UserIds; @@ -40,7 +47,14 @@ import android.os.Bundle; import android.os.IBinder; import android.util.Log; -public class ApgService2 extends Service { +/** + * ATTENTION: + * + * This is the old ApgService used as remote service over aidl interface. + * It will be reworked! + * + */ +public class ApgService2 extends PassphraseCacheService { private final static String TAG = "ApgService"; public static final boolean LOCAL_LOGV = true; public static final boolean LOCAL_LOGD = true; @@ -536,7 +550,7 @@ public class ApgService2 extends Service { return true; } - private final IApgService.Stub mBinder = new IApgService.Stub() { + private final IApgService2.Stub mBinder = new IApgService2.Stub() { public boolean getKeys(Bundle pArgs, Bundle pReturn) { diff --git a/org_apg/src/org/thialfihar/android/apg/IApgService.aidl b/org_apg/src/org/thialfihar/android/apg/service/IApgService2.aidl index 25780f366..4eba62655 100644 --- a/org_apg/src/org/thialfihar/android/apg/IApgService.aidl +++ b/org_apg/src/org/thialfihar/android/apg/service/IApgService2.aidl @@ -1,6 +1,6 @@ -package org.thialfihar.android.apg; +package org.thialfihar.android.apg.service; -interface IApgService { +interface IApgService2 { /* All functions fill the returnVals Bundle with the following keys: * diff --git a/org_apg/src/org/thialfihar/android/apg/Service.java b/org_apg/src/org/thialfihar/android/apg/service/PassphraseCacheService.java index a1e298ef6..f8b5959ee 100644 --- a/org_apg/src/org/thialfihar/android/apg/Service.java +++ b/org_apg/src/org/thialfihar/android/apg/service/PassphraseCacheService.java @@ -12,14 +12,17 @@ * limitations under the License. */ -package org.thialfihar.android.apg; +package org.thialfihar.android.apg.service; +import org.thialfihar.android.apg.Apg; + +import android.app.Service; import android.content.Intent; import android.os.Binder; import android.os.Handler; import android.os.IBinder; -public class Service extends android.app.Service { +public class PassphraseCacheService extends Service { private final IBinder mBinder = new LocalBinder(); public static final String EXTRA_TTL = "ttl"; @@ -80,8 +83,8 @@ public class Service extends android.app.Service { } public class LocalBinder extends Binder { - Service getService() { - return Service.this; + PassphraseCacheService getService() { + return PassphraseCacheService.this; } } diff --git a/org_apg/src/org/thialfihar/android/apg/ui/BaseActivity.java b/org_apg/src/org/thialfihar/android/apg/ui/BaseActivity.java index 73d71c456..bd883f76d 100644 --- a/org_apg/src/org/thialfihar/android/apg/ui/BaseActivity.java +++ b/org_apg/src/org/thialfihar/android/apg/ui/BaseActivity.java @@ -28,7 +28,7 @@ import org.thialfihar.android.apg.Id; import org.thialfihar.android.apg.PausableThread; import org.thialfihar.android.apg.Preferences; import org.thialfihar.android.apg.ProgressDialogUpdater; -import org.thialfihar.android.apg.Service; +import org.thialfihar.android.apg.service.PassphraseCacheService; import com.actionbarsherlock.app.ActionBar; import com.actionbarsherlock.app.SherlockActivity; @@ -92,8 +92,8 @@ public class BaseActivity extends SherlockFragmentActivity implements Runnable, } public static void startCacheService(Activity activity, Preferences preferences) { - Intent intent = new Intent(activity, Service.class); - intent.putExtra(Service.EXTRA_TTL, preferences.getPassPhraseCacheTtl()); + Intent intent = new Intent(activity, PassphraseCacheService.class); + intent.putExtra(PassphraseCacheService.EXTRA_TTL, preferences.getPassPhraseCacheTtl()); activity.startService(intent); } diff --git a/org_apg/src/org/thialfihar/android/apg/ui/EditKeyActivity.java b/org_apg/src/org/thialfihar/android/apg/ui/EditKeyActivity.java index 25a96c31e..138eaba38 100644 --- a/org_apg/src/org/thialfihar/android/apg/ui/EditKeyActivity.java +++ b/org_apg/src/org/thialfihar/android/apg/ui/EditKeyActivity.java @@ -84,7 +84,7 @@ public class EditKeyActivity extends SherlockFragmentActivity { // extends BaseA Vector<PGPSecretKey> mKeys; Vector<Integer> 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<String> mWarningList = new ArrayList<String>(); /** 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; |