[Settings] The receiver should be registered with all clients instead of

the client which init the repository

Bug: 274748033
Test: local test
Change-Id: I9981d39f5407f02684585354d1fc0de0bd8b0873
This commit is contained in:
Zoey Chen
2023-03-22 13:01:23 +00:00
parent a311ae81fc
commit 5c4d79154e
2 changed files with 26 additions and 19 deletions

View File

@@ -104,8 +104,13 @@ public abstract class DefaultSubscriptionController extends TelephonyBasePrefere
@OnLifecycleEvent(ON_RESUME)
public void onResume() {
mMobileNetworkRepository.addRegister(mLifecycleOwner, this, getDefaultSubscriptionId());
mMobileNetworkRepository.addRegister(mLifecycleOwner, this,
SubscriptionManager.INVALID_SUBSCRIPTION_ID);
mMobileNetworkRepository.updateEntity();
// Can not get default subId from database until get the callback, add register by subId
// later.
mMobileNetworkRepository.addRegisterBySubId(getDefaultSubscriptionId());
}
@OnLifecycleEvent(ON_PAUSE)