Loading src/java/android/telephony/SmsManager.java +12 −6 Original line number Diff line number Diff line Loading @@ -358,7 +358,8 @@ public final class SmsManager { * Note: This call is blocking, callers may want to avoid calling it from * the main thread of an application. * * @param messageIdentifier Message identifier as specified in TS 23.041 * @param messageIdentifier Message identifier as specified in TS 23.041 (3GPP) * or C.R1001-G (3GPP2) * @return true if successful, false otherwise * @see #disableCellBroadcast(int) * Loading Loading @@ -387,7 +388,8 @@ public final class SmsManager { * Note: This call is blocking, callers may want to avoid calling it from * the main thread of an application. * * @param messageIdentifier Message identifier as specified in TS 23.041 * @param messageIdentifier Message identifier as specified in TS 23.041 (3GPP) * or C.R1001-G (3GPP2) * @return true if successful, false otherwise * * @see #enableCellBroadcast(int) Loading Loading @@ -418,8 +420,10 @@ public final class SmsManager { * Note: This call is blocking, callers may want to avoid calling it from * the main thread of an application. * * @param startMessageId first message identifier as specified in TS 23.041 * @param endMessageId last message identifier as specified in TS 23.041 * @param startMessageId first message identifier as specified in TS 23.041 (3GPP) * or C.R1001-G (3GPP2) * @param endMessageId last message identifier as specified in TS 23.041 (3GPP) * or C.R1001-G (3GPP2) * @return true if successful, false otherwise * @see #disableCellBroadcastRange(int, int) * Loading Loading @@ -452,8 +456,10 @@ public final class SmsManager { * Note: This call is blocking, callers may want to avoid calling it from * the main thread of an application. * * @param startMessageId first message identifier as specified in TS 23.041 * @param endMessageId last message identifier as specified in TS 23.041 * @param startMessageId first message identifier as specified in TS 23.041 (3GPP) * or C.R1001-G (3GPP2) * @param endMessageId last message identifier as specified in TS 23.041 (3GPP) * or C.R1001-G (3GPP2) * @return true if successful, false otherwise * * @see #enableCellBroadcastRange(int, int) Loading src/java/com/android/internal/telephony/CommandsInterface.java +3 −3 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.internal.telephony; import com.android.internal.telephony.cdma.CdmaSmsBroadcastConfigInfo; import com.android.internal.telephony.gsm.SmsBroadcastConfigInfo; import com.android.internal.telephony.uicc.IccCardStatus; Loading Loading @@ -1523,11 +1524,10 @@ public interface CommandsInterface { /** * Configure cdma cell broadcast SMS. * * @param result * @param response * Callback message is empty on completion */ // TODO: Change the configValuesArray to a RIL_BroadcastSMSConfig public void setCdmaBroadcastConfig(int[] configValuesArray, Message result); public void setCdmaBroadcastConfig(CdmaSmsBroadcastConfigInfo[] configs, Message response); /** * Query the current configuration of cdma cell broadcast SMS. Loading src/java/com/android/internal/telephony/ISms.aidl +13 −7 Original line number Diff line number Diff line Loading @@ -150,7 +150,8 @@ interface ISms { * message identifier, they must both disable it for the device to stop * receiving those messages. * * @param messageIdentifier Message identifier as specified in TS 23.041 * @param messageIdentifier Message identifier as specified in TS 23.041 (3GPP) or * C.R1001-G (3GPP2) * @return true if successful, false otherwise * * @see #disableCellBroadcast(int) Loading @@ -163,21 +164,24 @@ interface ISms { * message identifier, they must both disable it for the device to stop * receiving those messages. * * @param messageIdentifier Message identifier as specified in TS 23.041 * @param messageIdentifier Message identifier as specified in TS 23.041 (3GPP) or * C.R1001-G (3GPP2) * @return true if successful, false otherwise * * @see #enableCellBroadcast(int) */ boolean disableCellBroadcast(int messageIdentifier); /** /* * Enable reception of cell broadcast (SMS-CB) messages with the given * message identifier range. Note that if two different clients enable * a message identifier range, they must both disable it for the device * to stop receiving those messages. * * @param startMessageId first message identifier as specified in TS 23.041 * @param endMessageId last message identifier as specified in TS 23.041 * @param startMessageId first message identifier as specified in TS 23.041 (3GPP) or * C.R1001-G (3GPP2) * @param endMessageId last message identifier as specified in TS 23.041 (3GPP) or * C.R1001-G (3GPP2) * @return true if successful, false otherwise * * @see #disableCellBroadcastRange(int, int) Loading @@ -190,8 +194,10 @@ interface ISms { * a message identifier range, they must both disable it for the device * to stop receiving those messages. * * @param startMessageId first message identifier as specified in TS 23.041 * @param endMessageId last message identifier as specified in TS 23.041 * @param startMessageId first message identifier as specified in TS 23.041 (3GPP) or * C.R1001-G (3GPP2) * @param endMessageId last message identifier as specified in TS 23.041 (3GPP) or * C.R1001-G (3GPP2) * @return true if successful, false otherwise * * @see #enableCellBroadcastRange(int, int) Loading src/java/com/android/internal/telephony/RIL.java +27 −5 Original line number Diff line number Diff line Loading @@ -58,6 +58,7 @@ import com.android.internal.telephony.uicc.IccRefreshResponse; import com.android.internal.telephony.uicc.IccUtils; import com.android.internal.telephony.cdma.CdmaCallWaitingNotification; import com.android.internal.telephony.cdma.CdmaInformationRecords; import com.android.internal.telephony.cdma.CdmaSmsBroadcastConfigInfo; import java.io.ByteArrayInputStream; import java.io.DataInputStream; Loading Loading @@ -3818,15 +3819,36 @@ public final class RIL extends BaseCommands implements CommandsInterface { send(rr); } // TODO: Change the configValuesArray to a RIL_BroadcastSMSConfig public void setCdmaBroadcastConfig(int[] configValuesArray, Message response) { public void setCdmaBroadcastConfig(CdmaSmsBroadcastConfigInfo[] configs, Message response) { RILRequest rr = RILRequest.obtain(RIL_REQUEST_CDMA_SET_BROADCAST_CONFIG, response); for(int i = 0; i < configValuesArray.length; i++) { rr.mp.writeInt(configValuesArray[i]); // Convert to 1 service category per config (the way RIL takes is) ArrayList<CdmaSmsBroadcastConfigInfo> processedConfigs = new ArrayList<CdmaSmsBroadcastConfigInfo>(); for (CdmaSmsBroadcastConfigInfo config : configs) { for (int i = config.getFromServiceCategory(); i <= config.getToServiceCategory(); i++) { processedConfigs.add(new CdmaSmsBroadcastConfigInfo(i, i, config.getLanguage(), config.isSelected())); } } if (RILJ_LOGD) riljLog(rr.serialString() + "> " + requestToString(rr.mRequest)); CdmaSmsBroadcastConfigInfo[] rilConfigs = processedConfigs.toArray(configs); rr.mp.writeInt(rilConfigs.length); for(int i = 0; i < rilConfigs.length; i++) { rr.mp.writeInt(rilConfigs[i].getFromServiceCategory()); rr.mp.writeInt(rilConfigs[i].getLanguage()); rr.mp.writeInt(rilConfigs[i].isSelected() ? 1 : 0); } if (RILJ_LOGD) { riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " with " + rilConfigs.length + " configs : "); for (int i = 0; i < rilConfigs.length; i++) { riljLog(rilConfigs[i].toString()); } } send(rr); } Loading src/java/com/android/internal/telephony/cdma/CdmaSmsBroadcastConfigInfo.java 0 → 100755 +87 −0 Original line number Diff line number Diff line /* * Copyright (C) 2011-2013 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package com.android.internal.telephony.cdma; /** * CdmaSmsBroadcastConfigInfo defines one configuration of Cdma Broadcast * Message to be received by the ME * * serviceCategory defines a Broadcast message identifier * whose value is 0x0000 - 0xFFFF as defined in C.R1001G 9.3.1 and 9.3.2. * All other values can be treated as empty message ID. * * language defines a language code of Broadcast Message * whose value is 0x00 - 0x07 as defined in C.R1001G 9.2. * All other values can be treated as empty language code. * * selected false means message types specified in serviceCategory * are not accepted, while true means accepted. * */ public class CdmaSmsBroadcastConfigInfo { private int mFromServiceCategory; private int mToServiceCategory; private int mLanguage; private boolean mSelected; /** * Initialize the object from rssi and cid. */ public CdmaSmsBroadcastConfigInfo(int fromServiceCategory, int toServiceCategory, int language, boolean selected) { mFromServiceCategory = fromServiceCategory; mToServiceCategory = toServiceCategory; mLanguage = language; mSelected = selected; } /** * @return the mFromServiceCategory */ public int getFromServiceCategory() { return mFromServiceCategory; } /** * @return the mToServiceCategory */ public int getToServiceCategory() { return mToServiceCategory; } /** * @return the mLanguage */ public int getLanguage() { return mLanguage; } /** * @return the selected */ public boolean isSelected() { return mSelected; } @Override public String toString() { return "CdmaSmsBroadcastConfigInfo: Id [" + mFromServiceCategory + ", " + mToServiceCategory + "] " + (isSelected() ? "ENABLED" : "DISABLED"); } } Loading
src/java/android/telephony/SmsManager.java +12 −6 Original line number Diff line number Diff line Loading @@ -358,7 +358,8 @@ public final class SmsManager { * Note: This call is blocking, callers may want to avoid calling it from * the main thread of an application. * * @param messageIdentifier Message identifier as specified in TS 23.041 * @param messageIdentifier Message identifier as specified in TS 23.041 (3GPP) * or C.R1001-G (3GPP2) * @return true if successful, false otherwise * @see #disableCellBroadcast(int) * Loading Loading @@ -387,7 +388,8 @@ public final class SmsManager { * Note: This call is blocking, callers may want to avoid calling it from * the main thread of an application. * * @param messageIdentifier Message identifier as specified in TS 23.041 * @param messageIdentifier Message identifier as specified in TS 23.041 (3GPP) * or C.R1001-G (3GPP2) * @return true if successful, false otherwise * * @see #enableCellBroadcast(int) Loading Loading @@ -418,8 +420,10 @@ public final class SmsManager { * Note: This call is blocking, callers may want to avoid calling it from * the main thread of an application. * * @param startMessageId first message identifier as specified in TS 23.041 * @param endMessageId last message identifier as specified in TS 23.041 * @param startMessageId first message identifier as specified in TS 23.041 (3GPP) * or C.R1001-G (3GPP2) * @param endMessageId last message identifier as specified in TS 23.041 (3GPP) * or C.R1001-G (3GPP2) * @return true if successful, false otherwise * @see #disableCellBroadcastRange(int, int) * Loading Loading @@ -452,8 +456,10 @@ public final class SmsManager { * Note: This call is blocking, callers may want to avoid calling it from * the main thread of an application. * * @param startMessageId first message identifier as specified in TS 23.041 * @param endMessageId last message identifier as specified in TS 23.041 * @param startMessageId first message identifier as specified in TS 23.041 (3GPP) * or C.R1001-G (3GPP2) * @param endMessageId last message identifier as specified in TS 23.041 (3GPP) * or C.R1001-G (3GPP2) * @return true if successful, false otherwise * * @see #enableCellBroadcastRange(int, int) Loading
src/java/com/android/internal/telephony/CommandsInterface.java +3 −3 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.internal.telephony; import com.android.internal.telephony.cdma.CdmaSmsBroadcastConfigInfo; import com.android.internal.telephony.gsm.SmsBroadcastConfigInfo; import com.android.internal.telephony.uicc.IccCardStatus; Loading Loading @@ -1523,11 +1524,10 @@ public interface CommandsInterface { /** * Configure cdma cell broadcast SMS. * * @param result * @param response * Callback message is empty on completion */ // TODO: Change the configValuesArray to a RIL_BroadcastSMSConfig public void setCdmaBroadcastConfig(int[] configValuesArray, Message result); public void setCdmaBroadcastConfig(CdmaSmsBroadcastConfigInfo[] configs, Message response); /** * Query the current configuration of cdma cell broadcast SMS. Loading
src/java/com/android/internal/telephony/ISms.aidl +13 −7 Original line number Diff line number Diff line Loading @@ -150,7 +150,8 @@ interface ISms { * message identifier, they must both disable it for the device to stop * receiving those messages. * * @param messageIdentifier Message identifier as specified in TS 23.041 * @param messageIdentifier Message identifier as specified in TS 23.041 (3GPP) or * C.R1001-G (3GPP2) * @return true if successful, false otherwise * * @see #disableCellBroadcast(int) Loading @@ -163,21 +164,24 @@ interface ISms { * message identifier, they must both disable it for the device to stop * receiving those messages. * * @param messageIdentifier Message identifier as specified in TS 23.041 * @param messageIdentifier Message identifier as specified in TS 23.041 (3GPP) or * C.R1001-G (3GPP2) * @return true if successful, false otherwise * * @see #enableCellBroadcast(int) */ boolean disableCellBroadcast(int messageIdentifier); /** /* * Enable reception of cell broadcast (SMS-CB) messages with the given * message identifier range. Note that if two different clients enable * a message identifier range, they must both disable it for the device * to stop receiving those messages. * * @param startMessageId first message identifier as specified in TS 23.041 * @param endMessageId last message identifier as specified in TS 23.041 * @param startMessageId first message identifier as specified in TS 23.041 (3GPP) or * C.R1001-G (3GPP2) * @param endMessageId last message identifier as specified in TS 23.041 (3GPP) or * C.R1001-G (3GPP2) * @return true if successful, false otherwise * * @see #disableCellBroadcastRange(int, int) Loading @@ -190,8 +194,10 @@ interface ISms { * a message identifier range, they must both disable it for the device * to stop receiving those messages. * * @param startMessageId first message identifier as specified in TS 23.041 * @param endMessageId last message identifier as specified in TS 23.041 * @param startMessageId first message identifier as specified in TS 23.041 (3GPP) or * C.R1001-G (3GPP2) * @param endMessageId last message identifier as specified in TS 23.041 (3GPP) or * C.R1001-G (3GPP2) * @return true if successful, false otherwise * * @see #enableCellBroadcastRange(int, int) Loading
src/java/com/android/internal/telephony/RIL.java +27 −5 Original line number Diff line number Diff line Loading @@ -58,6 +58,7 @@ import com.android.internal.telephony.uicc.IccRefreshResponse; import com.android.internal.telephony.uicc.IccUtils; import com.android.internal.telephony.cdma.CdmaCallWaitingNotification; import com.android.internal.telephony.cdma.CdmaInformationRecords; import com.android.internal.telephony.cdma.CdmaSmsBroadcastConfigInfo; import java.io.ByteArrayInputStream; import java.io.DataInputStream; Loading Loading @@ -3818,15 +3819,36 @@ public final class RIL extends BaseCommands implements CommandsInterface { send(rr); } // TODO: Change the configValuesArray to a RIL_BroadcastSMSConfig public void setCdmaBroadcastConfig(int[] configValuesArray, Message response) { public void setCdmaBroadcastConfig(CdmaSmsBroadcastConfigInfo[] configs, Message response) { RILRequest rr = RILRequest.obtain(RIL_REQUEST_CDMA_SET_BROADCAST_CONFIG, response); for(int i = 0; i < configValuesArray.length; i++) { rr.mp.writeInt(configValuesArray[i]); // Convert to 1 service category per config (the way RIL takes is) ArrayList<CdmaSmsBroadcastConfigInfo> processedConfigs = new ArrayList<CdmaSmsBroadcastConfigInfo>(); for (CdmaSmsBroadcastConfigInfo config : configs) { for (int i = config.getFromServiceCategory(); i <= config.getToServiceCategory(); i++) { processedConfigs.add(new CdmaSmsBroadcastConfigInfo(i, i, config.getLanguage(), config.isSelected())); } } if (RILJ_LOGD) riljLog(rr.serialString() + "> " + requestToString(rr.mRequest)); CdmaSmsBroadcastConfigInfo[] rilConfigs = processedConfigs.toArray(configs); rr.mp.writeInt(rilConfigs.length); for(int i = 0; i < rilConfigs.length; i++) { rr.mp.writeInt(rilConfigs[i].getFromServiceCategory()); rr.mp.writeInt(rilConfigs[i].getLanguage()); rr.mp.writeInt(rilConfigs[i].isSelected() ? 1 : 0); } if (RILJ_LOGD) { riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " with " + rilConfigs.length + " configs : "); for (int i = 0; i < rilConfigs.length; i++) { riljLog(rilConfigs[i].toString()); } } send(rr); } Loading
src/java/com/android/internal/telephony/cdma/CdmaSmsBroadcastConfigInfo.java 0 → 100755 +87 −0 Original line number Diff line number Diff line /* * Copyright (C) 2011-2013 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package com.android.internal.telephony.cdma; /** * CdmaSmsBroadcastConfigInfo defines one configuration of Cdma Broadcast * Message to be received by the ME * * serviceCategory defines a Broadcast message identifier * whose value is 0x0000 - 0xFFFF as defined in C.R1001G 9.3.1 and 9.3.2. * All other values can be treated as empty message ID. * * language defines a language code of Broadcast Message * whose value is 0x00 - 0x07 as defined in C.R1001G 9.2. * All other values can be treated as empty language code. * * selected false means message types specified in serviceCategory * are not accepted, while true means accepted. * */ public class CdmaSmsBroadcastConfigInfo { private int mFromServiceCategory; private int mToServiceCategory; private int mLanguage; private boolean mSelected; /** * Initialize the object from rssi and cid. */ public CdmaSmsBroadcastConfigInfo(int fromServiceCategory, int toServiceCategory, int language, boolean selected) { mFromServiceCategory = fromServiceCategory; mToServiceCategory = toServiceCategory; mLanguage = language; mSelected = selected; } /** * @return the mFromServiceCategory */ public int getFromServiceCategory() { return mFromServiceCategory; } /** * @return the mToServiceCategory */ public int getToServiceCategory() { return mToServiceCategory; } /** * @return the mLanguage */ public int getLanguage() { return mLanguage; } /** * @return the selected */ public boolean isSelected() { return mSelected; } @Override public String toString() { return "CdmaSmsBroadcastConfigInfo: Id [" + mFromServiceCategory + ", " + mToServiceCategory + "] " + (isSelected() ? "ENABLED" : "DISABLED"); } }