Refacotr mobile data observer for repository

In current design, the mobile data observer might be removed due to
SIM absence after registered so that mobile data network info can't
be updated to clients.

To fix it, migrate it to use API TelephonyCallback.onUserMobileDataStateChanged
Bug: 327696232

Change-Id: I26c8f946823abb7505f0227c8dd8ab0700d0c5f2
This commit is contained in:
Mengjun Leng
2024-04-25 12:53:47 +05:30
committed by SongFerng Wang
parent eda8e23f78
commit 120adb2349
2 changed files with 21 additions and 30 deletions

View File

@@ -100,9 +100,6 @@ public abstract class DefaultSubscriptionController extends TelephonyBasePrefere
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());
mDataSubscriptionChangedReceiver.registerReceiver();
}