From 061b2f769d10a4bced04604a7604a8d568380b1b Mon Sep 17 00:00:00 2001 From: Benedict Wong Date: Mon, 2 Nov 2020 17:52:06 -0800 Subject: [PATCH] Add NonNull annotation to getAllSubscriptionInfoList This change marks getAllSubscriptionInfoList as NonNull; the method already catches all exceptions, and returns an empty ArrayList if something failed. Test: atest FrameworksTelephonyTest Change-Id: I7799d05f0f1f249fa5f4a47a3f4ff2c2691c75dc --- telephony/java/android/telephony/SubscriptionManager.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/telephony/java/android/telephony/SubscriptionManager.java b/telephony/java/android/telephony/SubscriptionManager.java index 2e51ef16baf1e..3aa9345fe694e 100644 --- a/telephony/java/android/telephony/SubscriptionManager.java +++ b/telephony/java/android/telephony/SubscriptionManager.java @@ -1365,6 +1365,7 @@ public class SubscriptionManager { * include those that were inserted before, maybe empty but not null. * @hide */ + @NonNull @UnsupportedAppUsage public List getAllSubscriptionInfoList() { if (VDBG) logd("[getAllSubscriptionInfoList]+"); @@ -1382,7 +1383,7 @@ public class SubscriptionManager { } if (result == null) { - result = new ArrayList<>(); + result = Collections.emptyList(); } return result; }