Loading api/system-current.txt +1 −0 Original line number Original line Diff line number Diff line Loading @@ -7485,6 +7485,7 @@ package android.telephony { ctor public CellBroadcastService(); ctor public CellBroadcastService(); method @CallSuper public android.os.IBinder onBind(android.content.Intent); method @CallSuper public android.os.IBinder onBind(android.content.Intent); method public abstract void onCdmaCellBroadcastSms(int, byte[], int); method public abstract void onCdmaCellBroadcastSms(int, byte[], int); method public abstract void onCdmaScpMessage(int, @NonNull java.util.List<android.telephony.cdma.CdmaSmsCbProgramData>, @NonNull String, @NonNull java.util.function.Consumer<android.os.Bundle>); method public abstract void onGsmCellBroadcastSms(int, byte[]); method public abstract void onGsmCellBroadcastSms(int, byte[]); field public static final String CELL_BROADCAST_SERVICE_INTERFACE = "android.telephony.CellBroadcastService"; field public static final String CELL_BROADCAST_SERVICE_INTERFACE = "android.telephony.CellBroadcastService"; } } Loading telephony/java/android/telephony/CellBroadcastService.java +53 −6 Original line number Original line Diff line number Diff line Loading @@ -17,12 +17,18 @@ package android.telephony; package android.telephony; import android.annotation.CallSuper; import android.annotation.CallSuper; import android.annotation.NonNull; import android.annotation.SystemApi; import android.annotation.SystemApi; import android.app.Service; import android.app.Service; import android.content.Intent; import android.content.Intent; import android.os.Bundle; import android.os.IBinder; import android.os.IBinder; import android.os.RemoteCallback; import android.telephony.cdma.CdmaSmsCbProgramData; import android.telephony.cdma.CdmaSmsCbProgramData; import java.util.List; import java.util.function.Consumer; /** /** * A service which exposes the cell broadcast handling module to the system. * A service which exposes the cell broadcast handling module to the system. * <p> * <p> Loading @@ -46,6 +52,7 @@ import android.telephony.cdma.CdmaSmsCbProgramData; * </service> * </service> * </manifest> * </manifest> * }</pre> * }</pre> * * @hide * @hide */ */ @SystemApi @SystemApi Loading @@ -62,6 +69,7 @@ public abstract class CellBroadcastService extends Service { /** /** * Handle a GSM cell broadcast SMS message forwarded from the system. * Handle a GSM cell broadcast SMS message forwarded from the system. * * @param slotIndex the index of the slot which received the message * @param slotIndex the index of the slot which received the message * @param message the SMS PDU * @param message the SMS PDU */ */ Loading @@ -69,6 +77,7 @@ public abstract class CellBroadcastService extends Service { /** /** * Handle a CDMA cell broadcast SMS message forwarded from the system. * Handle a CDMA cell broadcast SMS message forwarded from the system. * * @param slotIndex the index of the slot which received the message * @param slotIndex the index of the slot which received the message * @param bearerData the CDMA SMS bearer data * @param bearerData the CDMA SMS bearer data * @param serviceCategory the CDMA SCPT service category * @param serviceCategory the CDMA SCPT service category Loading @@ -76,6 +85,21 @@ public abstract class CellBroadcastService extends Service { public abstract void onCdmaCellBroadcastSms(int slotIndex, byte[] bearerData, public abstract void onCdmaCellBroadcastSms(int slotIndex, byte[] bearerData, @CdmaSmsCbProgramData.Category int serviceCategory); @CdmaSmsCbProgramData.Category int serviceCategory); /** * Handle a CDMA cell broadcast SMS message forwarded from the system. * * @param slotIndex the index of the slot which received the message * @param smsCbProgramData the SMS CB program data of the message * @param originatingAddress the originating address of the message, as a non-separated dial * string * @param callback a callback to run after each cell broadcast receiver has handled * the SCP message. The bundle will contain a non-separated * dial string as and an ArrayList of {@link CdmaSmsCbProgramResults}. */ public abstract void onCdmaScpMessage(int slotIndex, @NonNull List<CdmaSmsCbProgramData> smsCbProgramData, @NonNull String originatingAddress, @NonNull Consumer<Bundle> callback); /** /** * If overriding this method, call through to the super method for any unknown actions. * If overriding this method, call through to the super method for any unknown actions. * {@inheritDoc} * {@inheritDoc} Loading @@ -89,11 +113,13 @@ public abstract class CellBroadcastService extends Service { /** /** * A wrapper around ICellBroadcastService that forwards calls to implementations of * A wrapper around ICellBroadcastService that forwards calls to implementations of * {@link CellBroadcastService}. * {@link CellBroadcastService}. * * @hide * @hide */ */ public class ICellBroadcastServiceWrapper extends ICellBroadcastService.Stub { public class ICellBroadcastServiceWrapper extends ICellBroadcastService.Stub { /** /** * Handle a GSM cell broadcast SMS. * Handle a GSM cell broadcast SMS. * * @param slotIndex the index of the slot which received the broadcast * @param slotIndex the index of the slot which received the broadcast * @param message the SMS message PDU * @param message the SMS message PDU */ */ Loading @@ -104,6 +130,7 @@ public abstract class CellBroadcastService extends Service { /** /** * Handle a CDMA cell broadcast SMS. * Handle a CDMA cell broadcast SMS. * * @param slotIndex the index of the slot which received the broadcast * @param slotIndex the index of the slot which received the broadcast * @param bearerData the CDMA SMS bearer data * @param bearerData the CDMA SMS bearer data * @param serviceCategory the CDMA SCPT service category * @param serviceCategory the CDMA SCPT service category Loading @@ -114,5 +141,25 @@ public abstract class CellBroadcastService extends Service { CellBroadcastService.this.onCdmaCellBroadcastSms(slotIndex, bearerData, CellBroadcastService.this.onCdmaCellBroadcastSms(slotIndex, bearerData, serviceCategory); serviceCategory); } } /** * Handle a CDMA Service Category Program message. * * @param slotIndex the index of the slot which received the message * @param smsCbProgramData the SMS CB program data of the message * @param originatingAddress the originating address of the message * @param callback a callback to run after each cell broadcast receiver has * handled the SCP message */ @Override public void handleCdmaScpMessage(int slotIndex, List<CdmaSmsCbProgramData> smsCbProgramData, String originatingAddress, RemoteCallback callback) { Consumer<Bundle> consumer = bundle -> { callback.sendResult(bundle); }; CellBroadcastService.this.onCdmaScpMessage(slotIndex, smsCbProgramData, originatingAddress, consumer); } } } } } telephony/java/android/telephony/ICellBroadcastService.aidl +7 −0 Original line number Original line Diff line number Diff line Loading @@ -16,6 +16,9 @@ package android.telephony; package android.telephony; import android.os.RemoteCallback; import android.telephony.cdma.CdmaSmsCbProgramData; /** /** * Service bound to by the system to allow custom handling of cell broadcast messages. * Service bound to by the system to allow custom handling of cell broadcast messages. * <p> * <p> Loading @@ -29,4 +32,8 @@ interface ICellBroadcastService { /** @see android.telephony.CellBroadcastService#onCdmaCellBroadcastSms */ /** @see android.telephony.CellBroadcastService#onCdmaCellBroadcastSms */ oneway void handleCdmaCellBroadcastSms(int slotId, in byte[] bearerData, int serviceCategory); oneway void handleCdmaCellBroadcastSms(int slotId, in byte[] bearerData, int serviceCategory); /** @see android.telephony.CellBroadcastService#onCdmaScpMessage */ oneway void handleCdmaScpMessage(int slotId, in List<CdmaSmsCbProgramData> programData, String originatingAddress, in RemoteCallback callback); } } telephony/java/android/telephony/cdma/CdmaSmsCbProgramData.aidl 0 → 100644 +21 −0 Original line number Original line Diff line number Diff line /* * Copyright (C) 2019 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. */ /** @hide */ package android.telephony.cdma; parcelable CdmaSmsCbProgramData; Loading
api/system-current.txt +1 −0 Original line number Original line Diff line number Diff line Loading @@ -7485,6 +7485,7 @@ package android.telephony { ctor public CellBroadcastService(); ctor public CellBroadcastService(); method @CallSuper public android.os.IBinder onBind(android.content.Intent); method @CallSuper public android.os.IBinder onBind(android.content.Intent); method public abstract void onCdmaCellBroadcastSms(int, byte[], int); method public abstract void onCdmaCellBroadcastSms(int, byte[], int); method public abstract void onCdmaScpMessage(int, @NonNull java.util.List<android.telephony.cdma.CdmaSmsCbProgramData>, @NonNull String, @NonNull java.util.function.Consumer<android.os.Bundle>); method public abstract void onGsmCellBroadcastSms(int, byte[]); method public abstract void onGsmCellBroadcastSms(int, byte[]); field public static final String CELL_BROADCAST_SERVICE_INTERFACE = "android.telephony.CellBroadcastService"; field public static final String CELL_BROADCAST_SERVICE_INTERFACE = "android.telephony.CellBroadcastService"; } } Loading
telephony/java/android/telephony/CellBroadcastService.java +53 −6 Original line number Original line Diff line number Diff line Loading @@ -17,12 +17,18 @@ package android.telephony; package android.telephony; import android.annotation.CallSuper; import android.annotation.CallSuper; import android.annotation.NonNull; import android.annotation.SystemApi; import android.annotation.SystemApi; import android.app.Service; import android.app.Service; import android.content.Intent; import android.content.Intent; import android.os.Bundle; import android.os.IBinder; import android.os.IBinder; import android.os.RemoteCallback; import android.telephony.cdma.CdmaSmsCbProgramData; import android.telephony.cdma.CdmaSmsCbProgramData; import java.util.List; import java.util.function.Consumer; /** /** * A service which exposes the cell broadcast handling module to the system. * A service which exposes the cell broadcast handling module to the system. * <p> * <p> Loading @@ -46,6 +52,7 @@ import android.telephony.cdma.CdmaSmsCbProgramData; * </service> * </service> * </manifest> * </manifest> * }</pre> * }</pre> * * @hide * @hide */ */ @SystemApi @SystemApi Loading @@ -62,6 +69,7 @@ public abstract class CellBroadcastService extends Service { /** /** * Handle a GSM cell broadcast SMS message forwarded from the system. * Handle a GSM cell broadcast SMS message forwarded from the system. * * @param slotIndex the index of the slot which received the message * @param slotIndex the index of the slot which received the message * @param message the SMS PDU * @param message the SMS PDU */ */ Loading @@ -69,6 +77,7 @@ public abstract class CellBroadcastService extends Service { /** /** * Handle a CDMA cell broadcast SMS message forwarded from the system. * Handle a CDMA cell broadcast SMS message forwarded from the system. * * @param slotIndex the index of the slot which received the message * @param slotIndex the index of the slot which received the message * @param bearerData the CDMA SMS bearer data * @param bearerData the CDMA SMS bearer data * @param serviceCategory the CDMA SCPT service category * @param serviceCategory the CDMA SCPT service category Loading @@ -76,6 +85,21 @@ public abstract class CellBroadcastService extends Service { public abstract void onCdmaCellBroadcastSms(int slotIndex, byte[] bearerData, public abstract void onCdmaCellBroadcastSms(int slotIndex, byte[] bearerData, @CdmaSmsCbProgramData.Category int serviceCategory); @CdmaSmsCbProgramData.Category int serviceCategory); /** * Handle a CDMA cell broadcast SMS message forwarded from the system. * * @param slotIndex the index of the slot which received the message * @param smsCbProgramData the SMS CB program data of the message * @param originatingAddress the originating address of the message, as a non-separated dial * string * @param callback a callback to run after each cell broadcast receiver has handled * the SCP message. The bundle will contain a non-separated * dial string as and an ArrayList of {@link CdmaSmsCbProgramResults}. */ public abstract void onCdmaScpMessage(int slotIndex, @NonNull List<CdmaSmsCbProgramData> smsCbProgramData, @NonNull String originatingAddress, @NonNull Consumer<Bundle> callback); /** /** * If overriding this method, call through to the super method for any unknown actions. * If overriding this method, call through to the super method for any unknown actions. * {@inheritDoc} * {@inheritDoc} Loading @@ -89,11 +113,13 @@ public abstract class CellBroadcastService extends Service { /** /** * A wrapper around ICellBroadcastService that forwards calls to implementations of * A wrapper around ICellBroadcastService that forwards calls to implementations of * {@link CellBroadcastService}. * {@link CellBroadcastService}. * * @hide * @hide */ */ public class ICellBroadcastServiceWrapper extends ICellBroadcastService.Stub { public class ICellBroadcastServiceWrapper extends ICellBroadcastService.Stub { /** /** * Handle a GSM cell broadcast SMS. * Handle a GSM cell broadcast SMS. * * @param slotIndex the index of the slot which received the broadcast * @param slotIndex the index of the slot which received the broadcast * @param message the SMS message PDU * @param message the SMS message PDU */ */ Loading @@ -104,6 +130,7 @@ public abstract class CellBroadcastService extends Service { /** /** * Handle a CDMA cell broadcast SMS. * Handle a CDMA cell broadcast SMS. * * @param slotIndex the index of the slot which received the broadcast * @param slotIndex the index of the slot which received the broadcast * @param bearerData the CDMA SMS bearer data * @param bearerData the CDMA SMS bearer data * @param serviceCategory the CDMA SCPT service category * @param serviceCategory the CDMA SCPT service category Loading @@ -114,5 +141,25 @@ public abstract class CellBroadcastService extends Service { CellBroadcastService.this.onCdmaCellBroadcastSms(slotIndex, bearerData, CellBroadcastService.this.onCdmaCellBroadcastSms(slotIndex, bearerData, serviceCategory); serviceCategory); } } /** * Handle a CDMA Service Category Program message. * * @param slotIndex the index of the slot which received the message * @param smsCbProgramData the SMS CB program data of the message * @param originatingAddress the originating address of the message * @param callback a callback to run after each cell broadcast receiver has * handled the SCP message */ @Override public void handleCdmaScpMessage(int slotIndex, List<CdmaSmsCbProgramData> smsCbProgramData, String originatingAddress, RemoteCallback callback) { Consumer<Bundle> consumer = bundle -> { callback.sendResult(bundle); }; CellBroadcastService.this.onCdmaScpMessage(slotIndex, smsCbProgramData, originatingAddress, consumer); } } } } }
telephony/java/android/telephony/ICellBroadcastService.aidl +7 −0 Original line number Original line Diff line number Diff line Loading @@ -16,6 +16,9 @@ package android.telephony; package android.telephony; import android.os.RemoteCallback; import android.telephony.cdma.CdmaSmsCbProgramData; /** /** * Service bound to by the system to allow custom handling of cell broadcast messages. * Service bound to by the system to allow custom handling of cell broadcast messages. * <p> * <p> Loading @@ -29,4 +32,8 @@ interface ICellBroadcastService { /** @see android.telephony.CellBroadcastService#onCdmaCellBroadcastSms */ /** @see android.telephony.CellBroadcastService#onCdmaCellBroadcastSms */ oneway void handleCdmaCellBroadcastSms(int slotId, in byte[] bearerData, int serviceCategory); oneway void handleCdmaCellBroadcastSms(int slotId, in byte[] bearerData, int serviceCategory); /** @see android.telephony.CellBroadcastService#onCdmaScpMessage */ oneway void handleCdmaScpMessage(int slotId, in List<CdmaSmsCbProgramData> programData, String originatingAddress, in RemoteCallback callback); } }
telephony/java/android/telephony/cdma/CdmaSmsCbProgramData.aidl 0 → 100644 +21 −0 Original line number Original line Diff line number Diff line /* * Copyright (C) 2019 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. */ /** @hide */ package android.telephony.cdma; parcelable CdmaSmsCbProgramData;