Loading src/java/com/android/internal/telephony/CarrierServiceBindHelper.java +7 −2 Original line number Diff line number Diff line Loading @@ -69,6 +69,9 @@ public class CarrierServiceBindHelper { public SparseArray<String> mLastSimState = new SparseArray<>(); private final PackageChangeReceiver mPackageMonitor = new CarrierServicePackageMonitor(); // whether we have successfully bound to the service private boolean mServiceBound = false; private BroadcastReceiver mUserUnlockedReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { Loading Loading @@ -279,6 +282,7 @@ public class CarrierServiceBindHelper { Context.BIND_AUTO_CREATE | Context.BIND_FOREGROUND_SERVICE, (r) -> mHandler.post(r), connection)) { mServiceBound = true; return; } Loading Loading @@ -333,11 +337,12 @@ public class CarrierServiceBindHelper { carrierServiceClass = null; // Actually unbind if (connection != null && connection.connected) { if (mServiceBound) { log("Unbinding from carrier app"); mServiceBound = false; mContext.unbindService(connection); } else { log("Already unbound, skipping unbindService call"); log("Not bound, skipping unbindService call"); } connection = null; mUnbindScheduledUptimeMillis = -1; Loading tests/telephonytests/src/com/android/internal/telephony/CarrierServiceBindHelperTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -84,7 +84,7 @@ public class CarrierServiceBindHelperTest extends TelephonyTest { } @Test public void testUnbindWhenNotConnected() throws Exception { public void testUnbindWhenNotBound() throws Exception { mCarrierServiceBindHelper = new CarrierServiceBindHelper(mContext); // Try unbinding without binding and make sure we don't throw an Exception Loading Loading
src/java/com/android/internal/telephony/CarrierServiceBindHelper.java +7 −2 Original line number Diff line number Diff line Loading @@ -69,6 +69,9 @@ public class CarrierServiceBindHelper { public SparseArray<String> mLastSimState = new SparseArray<>(); private final PackageChangeReceiver mPackageMonitor = new CarrierServicePackageMonitor(); // whether we have successfully bound to the service private boolean mServiceBound = false; private BroadcastReceiver mUserUnlockedReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { Loading Loading @@ -279,6 +282,7 @@ public class CarrierServiceBindHelper { Context.BIND_AUTO_CREATE | Context.BIND_FOREGROUND_SERVICE, (r) -> mHandler.post(r), connection)) { mServiceBound = true; return; } Loading Loading @@ -333,11 +337,12 @@ public class CarrierServiceBindHelper { carrierServiceClass = null; // Actually unbind if (connection != null && connection.connected) { if (mServiceBound) { log("Unbinding from carrier app"); mServiceBound = false; mContext.unbindService(connection); } else { log("Already unbound, skipping unbindService call"); log("Not bound, skipping unbindService call"); } connection = null; mUnbindScheduledUptimeMillis = -1; Loading
tests/telephonytests/src/com/android/internal/telephony/CarrierServiceBindHelperTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -84,7 +84,7 @@ public class CarrierServiceBindHelperTest extends TelephonyTest { } @Test public void testUnbindWhenNotConnected() throws Exception { public void testUnbindWhenNotBound() throws Exception { mCarrierServiceBindHelper = new CarrierServiceBindHelper(mContext); // Try unbinding without binding and make sure we don't throw an Exception Loading