aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/org/openintents/openpgp/util/OpenPgpServiceConnection.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/org/openintents/openpgp/util/OpenPgpServiceConnection.java b/src/org/openintents/openpgp/util/OpenPgpServiceConnection.java
index 2700caf0..dad27ccb 100644
--- a/src/org/openintents/openpgp/util/OpenPgpServiceConnection.java
+++ b/src/org/openintents/openpgp/util/OpenPgpServiceConnection.java
@@ -16,14 +16,14 @@
package org.openintents.openpgp.util;
-import org.openintents.openpgp.IOpenPgpService;
-
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.os.IBinder;
+import org.openintents.openpgp.IOpenPgpService;
+
public class OpenPgpServiceConnection {
// callback interface
@@ -99,8 +99,11 @@ public class OpenPgpServiceConnection {
Intent serviceIntent = new Intent(OpenPgpApi.SERVICE_INTENT);
// NOTE: setPackage is very important to restrict the intent to this provider only!
serviceIntent.setPackage(mProviderPackageName);
- mApplicationContext.bindService(serviceIntent, mServiceConnection,
+ boolean connect = mApplicationContext.bindService(serviceIntent, mServiceConnection,
Context.BIND_AUTO_CREATE);
+ if (!connect) {
+ throw new Exception("bindService() returned false!");
+ }
} catch (Exception e) {
if (mOnBoundListener != null) {
mOnBoundListener.onError(e);