diff options
author | Hunsuk Choi <forestchoi@google.com> | 2024-02-16 12:46:35 +0000 |
---|---|---|
committer | Hunsuk Choi <forestchoi@google.com> | 2024-02-16 14:45:01 +0000 |
commit | 0d53dda2d7273f0c0e76b286b6ee34962540d06a (patch) | |
tree | 280f1c2390e5109d4a387b5db5c380e4755c72ad /src | |
parent | 9e935a83e9cdcbc1be4e33cdb940cba83f8f9572 (diff) | |
download | telephony-0d53dda2d7273f0c0e76b286b6ee34962540d06a.tar.gz |
Update unit test of DomainSelectionController
Bug: 319995092
Test: atest DomainSelectionControllerTest
Change-Id: Ide8248ae5e90c4e6bd6e4d5c8f7a9778e9fa5769
Diffstat (limited to 'src')
-rw-r--r-- | src/java/com/android/internal/telephony/domainselection/DomainSelectionController.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/java/com/android/internal/telephony/domainselection/DomainSelectionController.java b/src/java/com/android/internal/telephony/domainselection/DomainSelectionController.java index 6d64a31223..ee8517da19 100644 --- a/src/java/com/android/internal/telephony/domainselection/DomainSelectionController.java +++ b/src/java/com/android/internal/telephony/domainselection/DomainSelectionController.java @@ -101,6 +101,7 @@ public class DomainSelectionController { private ExponentialBackoff mBackoff; private boolean mBackoffStarted = false; + private boolean mUnbind = false; // Retry the bind to the DomainSelectionService that has died after mBindRetry timeout. private Runnable mRestartBindingRunnable = new Runnable() { @@ -470,12 +471,14 @@ public class DomainSelectionController { */ public boolean bind(@NonNull ComponentName componentName) { mComponentName = componentName; + mUnbind = false; return bind(); } private boolean bind() { logd("bind isBindingOrBound=" + mIsBound); synchronized (mLock) { + if (mUnbind) return false; if (!mIsBound) { mIsBound = true; Intent serviceIntent = new Intent(DomainSelectionService.SERVICE_INTERFACE) @@ -512,6 +515,7 @@ public class DomainSelectionController { */ public void unbind() { synchronized (mLock) { + mUnbind = true; stopBackoffTimer(); mIsBound = false; setServiceController(null); @@ -548,7 +552,8 @@ public class DomainSelectionController { } private void notifyBindFailure() { - logi("notifyBindFailure " + mBackoffStarted); + logi("notifyBindFailure started=" + mBackoffStarted + ", unbind=" + mUnbind); + if (mUnbind) return; if (mBackoffStarted) { mBackoff.notifyFailed(); } else { |