Merge "Clean up unused fields from MobileNetworkRepository" into main
This commit is contained in:
@@ -49,7 +49,6 @@ import com.android.settingslib.mobile.dataservice.MobileNetworkInfoDao;
|
||||
import com.android.settingslib.mobile.dataservice.MobileNetworkInfoEntity;
|
||||
import com.android.settingslib.mobile.dataservice.SubscriptionInfoDao;
|
||||
import com.android.settingslib.mobile.dataservice.SubscriptionInfoEntity;
|
||||
import com.android.settingslib.mobile.dataservice.UiccInfoDao;
|
||||
import com.android.settingslib.mobile.dataservice.UiccInfoEntity;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -81,12 +80,9 @@ public class MobileNetworkRepository extends SubscriptionManager.OnSubscriptions
|
||||
private SubscriptionManager mSubscriptionManager;
|
||||
private MobileNetworkDatabase mMobileNetworkDatabase;
|
||||
private SubscriptionInfoDao mSubscriptionInfoDao;
|
||||
private UiccInfoDao mUiccInfoDao;
|
||||
private MobileNetworkInfoDao mMobileNetworkInfoDao;
|
||||
private List<SubscriptionInfoEntity> mAvailableSubInfoEntityList = new ArrayList<>();
|
||||
private List<SubscriptionInfoEntity> mActiveSubInfoEntityList = new ArrayList<>();
|
||||
private List<UiccInfoEntity> mUiccInfoEntityList = new ArrayList<>();
|
||||
private List<MobileNetworkInfoEntity> mMobileNetworkInfoEntityList = new ArrayList<>();
|
||||
private Context mContext;
|
||||
private AirplaneModeObserver mAirplaneModeObserver;
|
||||
private DataRoamingObserver mDataRoamingObserver;
|
||||
@@ -124,7 +120,6 @@ public class MobileNetworkRepository extends SubscriptionManager.OnSubscriptions
|
||||
mMetricsFeatureProvider.action(mContext, SettingsEnums.ACTION_MOBILE_NETWORK_DB_CREATED);
|
||||
mSubscriptionManager = context.getSystemService(SubscriptionManager.class);
|
||||
mSubscriptionInfoDao = mMobileNetworkDatabase.mSubscriptionInfoDao();
|
||||
mUiccInfoDao = mMobileNetworkDatabase.mUiccInfoDao();
|
||||
mMobileNetworkInfoDao = mMobileNetworkDatabase.mMobileNetworkInfoDao();
|
||||
mAirplaneModeObserver = new AirplaneModeObserver(new Handler(Looper.getMainLooper()));
|
||||
mDataRoamingObserver = new DataRoamingObserver(new Handler(Looper.getMainLooper()));
|
||||
@@ -338,22 +333,6 @@ public class MobileNetworkRepository extends SubscriptionManager.OnSubscriptions
|
||||
lifecycleOwner, this::onAllMobileNetworkInfoChanged);
|
||||
}
|
||||
|
||||
public List<SubscriptionInfoEntity> getAvailableSubInfoEntityList() {
|
||||
return mAvailableSubInfoEntityList;
|
||||
}
|
||||
|
||||
public List<SubscriptionInfoEntity> getActiveSubscriptionInfoList() {
|
||||
return mActiveSubInfoEntityList;
|
||||
}
|
||||
|
||||
public List<UiccInfoEntity> getUiccInfoEntityList() {
|
||||
return mUiccInfoEntityList;
|
||||
}
|
||||
|
||||
public List<MobileNetworkInfoEntity> getMobileNetworkInfoEntityList() {
|
||||
return mMobileNetworkInfoEntityList;
|
||||
}
|
||||
|
||||
public SubscriptionInfoEntity getSubInfoById(String subId) {
|
||||
return mSubscriptionInfoDao.querySubInfoById(subId);
|
||||
}
|
||||
@@ -464,7 +443,6 @@ public class MobileNetworkRepository extends SubscriptionManager.OnSubscriptions
|
||||
}
|
||||
|
||||
private void onAllUiccInfoChanged(List<UiccInfoEntity> uiccInfoEntityList) {
|
||||
mUiccInfoEntityList = new ArrayList<>(uiccInfoEntityList);
|
||||
for (MobileNetworkCallback callback : sCallbacks) {
|
||||
callback.onAllUiccInfoChanged(uiccInfoEntityList);
|
||||
}
|
||||
@@ -474,7 +452,6 @@ public class MobileNetworkRepository extends SubscriptionManager.OnSubscriptions
|
||||
|
||||
private void onAllMobileNetworkInfoChanged(
|
||||
List<MobileNetworkInfoEntity> mobileNetworkInfoEntityList) {
|
||||
mMobileNetworkInfoEntityList = new ArrayList<>(mobileNetworkInfoEntityList);
|
||||
for (MobileNetworkCallback callback : sCallbacks) {
|
||||
callback.onAllMobileNetworkInfoChanged(mobileNetworkInfoEntityList);
|
||||
}
|
||||
@@ -515,8 +492,6 @@ public class MobileNetworkRepository extends SubscriptionManager.OnSubscriptions
|
||||
mMobileNetworkDatabase.deleteSubInfoBySubId(subId);
|
||||
mMobileNetworkDatabase.deleteUiccInfoBySubId(subId);
|
||||
mMobileNetworkDatabase.deleteMobileNetworkInfoBySubId(subId);
|
||||
mUiccInfoEntityList.removeIf(info -> info.subId.equals(subId));
|
||||
mMobileNetworkInfoEntityList.removeIf(info -> info.subId.equals(subId));
|
||||
int id = Integer.parseInt(subId);
|
||||
removerRegisterBySubId(id);
|
||||
mSubscriptionInfoMap.remove(id);
|
||||
@@ -741,7 +716,6 @@ public class MobileNetworkRepository extends SubscriptionManager.OnSubscriptions
|
||||
}
|
||||
|
||||
private class PhoneCallStateTelephonyCallback extends TelephonyCallback implements
|
||||
TelephonyCallback.CallStateListener,
|
||||
TelephonyCallback.UserMobileDataStateListener {
|
||||
|
||||
private int mSubId;
|
||||
@@ -750,13 +724,6 @@ public class MobileNetworkRepository extends SubscriptionManager.OnSubscriptions
|
||||
mSubId = subId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCallStateChanged(int state) {
|
||||
for (MobileNetworkCallback callback : sCallbacks) {
|
||||
callback.onCallStateChanged(state);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUserMobileDataStateChanged(boolean enabled) {
|
||||
Log.d(TAG, "onUserMobileDataStateChanged enabled " + enabled + " on SUB " + mSubId);
|
||||
@@ -793,9 +760,6 @@ public class MobileNetworkRepository extends SubscriptionManager.OnSubscriptions
|
||||
*/
|
||||
default void onDataRoamingChanged(int subId, boolean enabled) {
|
||||
}
|
||||
|
||||
default void onCallStateChanged(int state) {
|
||||
}
|
||||
}
|
||||
|
||||
public void dump(IndentingPrintWriter printwriter) {
|
||||
@@ -803,8 +767,6 @@ public class MobileNetworkRepository extends SubscriptionManager.OnSubscriptions
|
||||
printwriter.increaseIndent();
|
||||
printwriter.println(" availableSubInfoEntityList= " + mAvailableSubInfoEntityList);
|
||||
printwriter.println(" activeSubInfoEntityList=" + mActiveSubInfoEntityList);
|
||||
printwriter.println(" mobileNetworkInfoEntityList= " + mMobileNetworkInfoEntityList);
|
||||
printwriter.println(" uiccInfoEntityList= " + mUiccInfoEntityList);
|
||||
printwriter.println(" CacheSubscriptionInfoEntityMap= " + sCacheSubscriptionInfoEntityMap);
|
||||
printwriter.println(" SubscriptionInfoMap= " + mSubscriptionInfoMap);
|
||||
printwriter.flush();
|
||||
|
Reference in New Issue
Block a user