From 3a6f6858c597004adb24fdb24f057529b982bfbf Mon Sep 17 00:00:00 2001 From: Jordan Liu Date: Thu, 31 Oct 2019 13:35:14 -0700 Subject: [PATCH] Add nullable and nonnull annotations Bug: 135956699 Test: m -j20 Change-Id: I852fffebed9b63239a1f383ff4ad09f156fbb39d --- api/system-current.txt | 6 +++--- telephony/java/android/telephony/CellBroadcastService.java | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/api/system-current.txt b/api/system-current.txt index 1a6ac8d12b9f4..1457cead0f960 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -7483,10 +7483,10 @@ package android.telephony { public abstract class CellBroadcastService extends android.app.Service { ctor public CellBroadcastService(); - method @CallSuper public android.os.IBinder onBind(android.content.Intent); - method public abstract void onCdmaCellBroadcastSms(int, byte[], int); + method @CallSuper public android.os.IBinder onBind(@Nullable android.content.Intent); + method public abstract void onCdmaCellBroadcastSms(int, @NonNull byte[], int); method public abstract void onCdmaScpMessage(int, @NonNull java.util.List, @NonNull String, @NonNull java.util.function.Consumer); - method public abstract void onGsmCellBroadcastSms(int, byte[]); + method public abstract void onGsmCellBroadcastSms(int, @NonNull byte[]); field public static final String CELL_BROADCAST_SERVICE_INTERFACE = "android.telephony.CellBroadcastService"; } diff --git a/telephony/java/android/telephony/CellBroadcastService.java b/telephony/java/android/telephony/CellBroadcastService.java index 60281ad11f60d..09e22aa4eb24a 100644 --- a/telephony/java/android/telephony/CellBroadcastService.java +++ b/telephony/java/android/telephony/CellBroadcastService.java @@ -18,6 +18,7 @@ package android.telephony; import android.annotation.CallSuper; import android.annotation.NonNull; +import android.annotation.Nullable; import android.annotation.SystemApi; import android.app.Service; import android.content.Intent; @@ -73,7 +74,7 @@ public abstract class CellBroadcastService extends Service { * @param slotIndex the index of the slot which received the message * @param message the SMS PDU */ - public abstract void onGsmCellBroadcastSms(int slotIndex, byte[] message); + public abstract void onGsmCellBroadcastSms(int slotIndex, @NonNull byte[] message); /** * Handle a CDMA cell broadcast SMS message forwarded from the system. @@ -82,7 +83,7 @@ public abstract class CellBroadcastService extends Service { * @param bearerData the CDMA SMS bearer data * @param serviceCategory the CDMA SCPT service category */ - public abstract void onCdmaCellBroadcastSms(int slotIndex, byte[] bearerData, + public abstract void onCdmaCellBroadcastSms(int slotIndex, @NonNull byte[] bearerData, @CdmaSmsCbProgramData.Category int serviceCategory); /** @@ -106,7 +107,7 @@ public abstract class CellBroadcastService extends Service { */ @Override @CallSuper - public IBinder onBind(Intent intent) { + public IBinder onBind(@Nullable Intent intent) { return mStubWrapper; }