move CellBroadcastMessage from telephony-common to app
1. add slotIndex in SmsCbMesage(cellbroadcast can be received
when sim is absent)
2. move cellbroadcastMessage from telephony-common to app
next step, considering merging CellBroadcast to SmsCbMessage
Bug: 135956699
Bug: 141962867
Test: build & unit test
Change-Id: Iba5e727fc1a1adaf44a7fa1eebfefe34fa8644aa
(cherry picked from commit 86a8e9b627
)
Merged-in: Iba5e727fc1a1adaf44a7fa1eebfefe34fa8644aa
This commit is contained in:
@@ -16,11 +16,6 @@
|
|||||||
|
|
||||||
package com.android.settings.deviceinfo.simstatus;
|
package com.android.settings.deviceinfo.simstatus;
|
||||||
|
|
||||||
import static android.content.Context.CARRIER_CONFIG_SERVICE;
|
|
||||||
import static android.content.Context.EUICC_SERVICE;
|
|
||||||
import static android.content.Context.TELEPHONY_SERVICE;
|
|
||||||
import static android.content.Context.TELEPHONY_SUBSCRIPTION_SERVICE;
|
|
||||||
|
|
||||||
import android.Manifest;
|
import android.Manifest;
|
||||||
import android.content.BroadcastReceiver;
|
import android.content.BroadcastReceiver;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
@@ -31,7 +26,7 @@ import android.os.Bundle;
|
|||||||
import android.os.PersistableBundle;
|
import android.os.PersistableBundle;
|
||||||
import android.os.UserHandle;
|
import android.os.UserHandle;
|
||||||
import android.telephony.CarrierConfigManager;
|
import android.telephony.CarrierConfigManager;
|
||||||
import android.telephony.CellBroadcastMessage;
|
import android.telephony.SmsCbMessage;
|
||||||
import android.telephony.PhoneStateListener;
|
import android.telephony.PhoneStateListener;
|
||||||
import android.telephony.ServiceState;
|
import android.telephony.ServiceState;
|
||||||
import android.telephony.SignalStrength;
|
import android.telephony.SignalStrength;
|
||||||
@@ -109,6 +104,7 @@ public class SimStatusDialogController implements LifecycleObserver, OnResume, O
|
|||||||
};
|
};
|
||||||
|
|
||||||
private SubscriptionInfo mSubscriptionInfo;
|
private SubscriptionInfo mSubscriptionInfo;
|
||||||
|
private int mSlotIndex;
|
||||||
|
|
||||||
private final SimStatusDialogFragment mDialog;
|
private final SimStatusDialogFragment mDialog;
|
||||||
private final TelephonyManager mTelephonyManager;
|
private final TelephonyManager mTelephonyManager;
|
||||||
@@ -129,9 +125,8 @@ public class SimStatusDialogController implements LifecycleObserver, OnResume, O
|
|||||||
if (extras == null) {
|
if (extras == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final CellBroadcastMessage cbMessage = (CellBroadcastMessage) extras.get("message");
|
final SmsCbMessage cbMessage = (SmsCbMessage) extras.get("message");
|
||||||
if (cbMessage != null
|
if (cbMessage != null && mSlotIndex == cbMessage.getSlotIndex()) {
|
||||||
&& mSubscriptionInfo.getSubscriptionId() == cbMessage.getSubId()) {
|
|
||||||
final String latestAreaInfo = cbMessage.getMessageBody();
|
final String latestAreaInfo = cbMessage.getMessageBody();
|
||||||
mDialog.setText(OPERATOR_INFO_VALUE_ID, latestAreaInfo);
|
mDialog.setText(OPERATOR_INFO_VALUE_ID, latestAreaInfo);
|
||||||
}
|
}
|
||||||
@@ -145,7 +140,9 @@ public class SimStatusDialogController implements LifecycleObserver, OnResume, O
|
|||||||
int slotId) {
|
int slotId) {
|
||||||
mDialog = dialog;
|
mDialog = dialog;
|
||||||
mContext = dialog.getContext();
|
mContext = dialog.getContext();
|
||||||
|
mSlotIndex = slotId;
|
||||||
mSubscriptionInfo = getPhoneSubscriptionInfo(slotId);
|
mSubscriptionInfo = getPhoneSubscriptionInfo(slotId);
|
||||||
|
|
||||||
mTelephonyManager = mContext.getSystemService(TelephonyManager.class);
|
mTelephonyManager = mContext.getSystemService(TelephonyManager.class);
|
||||||
mCarrierConfigManager = mContext.getSystemService(CarrierConfigManager.class);
|
mCarrierConfigManager = mContext.getSystemService(CarrierConfigManager.class);
|
||||||
mEuiccManager = mContext.getSystemService(EuiccManager.class);
|
mEuiccManager = mContext.getSystemService(EuiccManager.class);
|
||||||
|
Reference in New Issue
Block a user