首页 > 代码库 > sim卡搜网过程中打开小区广播提示“信息”报停
sim卡搜网过程中打开小区广播提示“信息”报停
从Android 4.4 kk版本之后,有将整个CB的处理都是放在mms 这个进程中的。
而小区广播是需要sim卡正常初始化后才能开启小区广播,而sim卡在搜网过程时,表示当前sim卡还没有初始化成功,这时是没有办法去开启小区广播的。
又由于小区广播跑在mms这个进程中,所以mms 进程就会发生运行异常,并报了“信息”停止
请在CellBroadcastCheckBox.java中做如下修改:
将如下方法:
private void setCBState(final boolean state) {
MmsLog.d(LOG_TAG, "setCBState start");
if (mListener != null) {
mListener.onStarted(CellBroadcastCheckBox.this, false);
}
new Thread(new Runnable() {
public void run() {
MmsLog.d(LOG_TAG, "activateCellBroadcastSms start");
boolean isSetSuccess = EncapsulatedSmsManager.activateCellBroadcastSms(state, mSlotId);
MmsLog.d(LOG_TAG, "activateCellBroadcastSms end isSetSuccess = " + isSetSuccess);
if (!isSetSuccess) {
handleSetStateResponse();
} else {
RecoverChannelSettings setting =
new RecoverChannelSettings(mSlotId, getContext().getContentResolver());
setting.updateChannelStatus();
if (mListener != null) {
mListener.onFinished(CellBroadcastCheckBox.this, false);
}
}
MmsLog.d(LOG_TAG, "setCBState end");
}
}).start();
}
修改为:
private void setCBState(final boolean state) {
MmsLog.d(LOG_TAG, "setCBState start");
if (mListener != null) {
mListener.onStarted(CellBroadcastCheckBox.this, false);
}
MmsLog.d(LOG_TAG, "activateCellBroadcastSms start");
boolean isSetSuccess = EncapsulatedSmsManager.activateCellBroadcastSms(state, mSlotId);
MmsLog.d(LOG_TAG, "activateCellBroadcastSms end isSetSuccess = " + isSetSuccess);
if (!isSetSuccess) {
handleSetStateResponse();
} else {
new Thread(new Runnable() {
public void run() {
RecoverChannelSettings setting =
new RecoverChannelSettings(mSlotId, getContext().getContentResolver());
setting.updateChannelStatus();
if (mListener != null) {
mListener.onFinished(CellBroadcastCheckBox.this, false);
}
MmsLog.d(LOG_TAG, "setCBState end");
}
}).start();
}
}
而小区广播是需要sim卡正常初始化后才能开启小区广播,而sim卡在搜网过程时,表示当前sim卡还没有初始化成功,这时是没有办法去开启小区广播的。
又由于小区广播跑在mms这个进程中,所以mms 进程就会发生运行异常,并报了“信息”停止
请在CellBroadcastCheckBox.java中做如下修改:
将如下方法:
private void setCBState(final boolean state) {
MmsLog.d(LOG_TAG, "setCBState start");
if (mListener != null) {
mListener.onStarted(CellBroadcastCheckBox.this, false);
}
new Thread(new Runnable() {
public void run() {
MmsLog.d(LOG_TAG, "activateCellBroadcastSms start");
boolean isSetSuccess = EncapsulatedSmsManager.activateCellBroadcastSms(state, mSlotId);
MmsLog.d(LOG_TAG, "activateCellBroadcastSms end isSetSuccess = " + isSetSuccess);
if (!isSetSuccess) {
handleSetStateResponse();
} else {
RecoverChannelSettings setting =
new RecoverChannelSettings(mSlotId, getContext().getContentResolver());
setting.updateChannelStatus();
if (mListener != null) {
mListener.onFinished(CellBroadcastCheckBox.this, false);
}
}
MmsLog.d(LOG_TAG, "setCBState end");
}
}).start();
}
修改为:
private void setCBState(final boolean state) {
MmsLog.d(LOG_TAG, "setCBState start");
if (mListener != null) {
mListener.onStarted(CellBroadcastCheckBox.this, false);
}
MmsLog.d(LOG_TAG, "activateCellBroadcastSms start");
boolean isSetSuccess = EncapsulatedSmsManager.activateCellBroadcastSms(state, mSlotId);
MmsLog.d(LOG_TAG, "activateCellBroadcastSms end isSetSuccess = " + isSetSuccess);
if (!isSetSuccess) {
handleSetStateResponse();
} else {
new Thread(new Runnable() {
public void run() {
RecoverChannelSettings setting =
new RecoverChannelSettings(mSlotId, getContext().getContentResolver());
setting.updateChannelStatus();
if (mListener != null) {
mListener.onFinished(CellBroadcastCheckBox.this, false);
}
MmsLog.d(LOG_TAG, "setCBState end");
}
}).start();
}
}
sim卡搜网过程中打开小区广播提示“信息”报停
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。