diff options
author | Dominik Schürmann <dominik@dominikschuermann.de> | 2014-08-12 14:38:28 +0200 |
---|---|---|
committer | Dominik Schürmann <dominik@dominikschuermann.de> | 2014-08-12 14:38:28 +0200 |
commit | 9e1f732b23d3b5df042f627d65a8ca37cec023fd (patch) | |
tree | 3ceb0298009527dd28599c750d43cbaf7adfacea /src/org | |
parent | cbfeb90cec9d9ecea2576eddf42e37154286c667 (diff) |
More fixes for OpenPgpServiceConnection
Diffstat (limited to 'src/org')
-rw-r--r-- | src/org/openintents/openpgp/util/OpenPgpServiceConnection.java | 9 |
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); |