Merge "Fix bug in enabling/disabling SMS cell broadcast activation." into ics-mr0

This commit is contained in:
Jake Hamby
2011-10-27 17:46:32 -07:00
committed by Android (Google) Code Review
3 changed files with 16 additions and 3 deletions

View File

@@ -542,6 +542,14 @@ public abstract class IntRangeManager {
return finishUpdate();
}
/**
* Returns whether the list of ranges is completely empty.
* @return true if there are no enabled ranges
*/
public boolean isEmpty() {
return mRanges.isEmpty();
}
/**
* Called when the list of enabled ranges has changed. This will be
* followed by zero or more calls to {@link #addRange} followed by

View File

@@ -1928,7 +1928,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
if (RILJ_LOGD) {
riljLog(rr.serialString() + "> " + requestToString(rr.mRequest)
+ " with " + numOfConfig + "configs : ");
+ " with " + numOfConfig + " configs : ");
for (int i = 0; i < numOfConfig; i++) {
riljLog(config[i].toString());
}

View File

@@ -246,6 +246,8 @@ public class SimSmsInterfaceManager extends IccSmsInterfaceManager {
log("Added cell broadcast subscription for MID range " + startMessageId
+ " to " + endMessageId + " from client " + client);
setCellBroadcastActivation(!mCellBroadcastRangeManager.isEmpty());
return true;
}
@@ -271,6 +273,8 @@ public class SimSmsInterfaceManager extends IccSmsInterfaceManager {
log("Removed cell broadcast subscription for MID range " + startMessageId
+ " to " + endMessageId + " from client " + client);
setCellBroadcastActivation(!mCellBroadcastRangeManager.isEmpty());
return true;
}
@@ -301,14 +305,15 @@ public class SimSmsInterfaceManager extends IccSmsInterfaceManager {
/**
* Called to indicate the end of a range update started by the
* previous call to {@link #startUpdate}.
* @return true if successful, false otherwise
*/
protected boolean finishUpdate() {
if (mConfigList.isEmpty()) {
return setCellBroadcastActivation(false);
return true;
} else {
SmsBroadcastConfigInfo[] configs =
mConfigList.toArray(new SmsBroadcastConfigInfo[mConfigList.size()]);
return setCellBroadcastConfig(configs) && setCellBroadcastActivation(true);
return setCellBroadcastConfig(configs);
}
}
}