summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMalcolm Chen <refuhoo@google.com>2019-12-27 16:49:44 -0800
committerMalcolm Chen <refuhoo@google.com>2020-01-08 14:03:55 -0800
commit538fd0d4775723dac40eb97b190408831dfb307f (patch)
tree6422f66e6e3c21c5eea619e9df464886217e8ae1
parentb9446af563b4ff97e22c81ae474ab158e02af66d (diff)
[Telephony Mainline] Make newFromBundle and fillInNotifierBundle System
API The APIs are used in several placed where listens to SERVICE_STATE_CHANGE broadcast. Bug: 140908357 Test: build Change-Id: I84543dbb056694d975799c7959c7ed66e286c530 Merged-In: I84543dbb056694d975799c7959c7ed66e286c530
-rwxr-xr-xapi/system-current.txt2
-rw-r--r--config/boot-image-profile.txt1
-rw-r--r--telephony/java/android/telephony/ServiceState.java14
3 files changed, 11 insertions, 6 deletions
diff --git a/api/system-current.txt b/api/system-current.txt
index 75bdf0ce633f..0a088b38e646 100755
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -8762,6 +8762,7 @@ package android.telephony {
public class ServiceState implements android.os.Parcelable {
method @NonNull public android.telephony.ServiceState createLocationInfoSanitizedCopy(boolean);
+ method public void fillInNotifierBundle(@NonNull android.os.Bundle);
method public int getDataRegistrationState();
method @Nullable public android.telephony.NetworkRegistrationInfo getNetworkRegistrationInfo(int, int);
method @NonNull public java.util.List<android.telephony.NetworkRegistrationInfo> getNetworkRegistrationInfoList();
@@ -8770,6 +8771,7 @@ package android.telephony {
method public int getNrFrequencyRange();
method @Nullable public String getOperatorAlphaLongRaw();
method @Nullable public String getOperatorAlphaShortRaw();
+ method @NonNull public static android.telephony.ServiceState newFromBundle(@NonNull android.os.Bundle);
field public static final int ROAMING_TYPE_DOMESTIC = 2; // 0x2
field public static final int ROAMING_TYPE_INTERNATIONAL = 3; // 0x3
field public static final int ROAMING_TYPE_NOT_ROAMING = 0; // 0x0
diff --git a/config/boot-image-profile.txt b/config/boot-image-profile.txt
index 2ac8409f8e1a..773942c8b753 100644
--- a/config/boot-image-profile.txt
+++ b/config/boot-image-profile.txt
@@ -14142,7 +14142,6 @@ HSPLandroid/telephony/ServiceState;->convertNetworkTypeBitmaskToBearerBitmask(I)
HSPLandroid/telephony/ServiceState;->copyFrom(Landroid/telephony/ServiceState;)V
HSPLandroid/telephony/ServiceState;->describeContents()I
HSPLandroid/telephony/ServiceState;->equals(Ljava/lang/Object;)Z
-HSPLandroid/telephony/ServiceState;->fillInNotifierBundle(Landroid/os/Bundle;)V
HSPLandroid/telephony/ServiceState;->getCdmaDefaultRoamingIndicator()I
HSPLandroid/telephony/ServiceState;->getCdmaEriIconIndex()I
HSPLandroid/telephony/ServiceState;->getCdmaEriIconMode()I
diff --git a/telephony/java/android/telephony/ServiceState.java b/telephony/java/android/telephony/ServiceState.java
index a3044edd1631..60ccbf6f84ec 100644
--- a/telephony/java/android/telephony/ServiceState.java
+++ b/telephony/java/android/telephony/ServiceState.java
@@ -379,15 +379,15 @@ public class ServiceState implements Parcelable {
/**
* Create a new ServiceState from a intent notifier Bundle
*
- * This method is used by PhoneStateIntentReceiver, CellBroadcastReceiver, and maybe by
- * external applications.
+ * This method is used to get ServiceState object from extras upon receiving
+ * {@link Intent#ACTION_SERVICE_STATE}.
*
* @param m Bundle from intent notifier
* @return newly created ServiceState
* @hide
*/
+ @SystemApi
@NonNull
- @UnsupportedAppUsage
public static ServiceState newFromBundle(@NonNull Bundle m) {
ServiceState ret;
ret = new ServiceState();
@@ -1281,11 +1281,15 @@ public class ServiceState implements Parcelable {
/**
* Set intent notifier Bundle based on service state.
*
+ * Put ServiceState object and its fields into bundle which is used by TelephonyRegistry
+ * to broadcast {@link Intent#ACTION_SERVICE_STATE}.
+ *
* @param m intent notifier Bundle
* @hide
+ *
*/
- @UnsupportedAppUsage
- public void fillInNotifierBundle(Bundle m) {
+ @SystemApi
+ public void fillInNotifierBundle(@NonNull Bundle m) {
m.putParcelable(Intent.EXTRA_SERVICE_STATE, this);
// serviceState already consists of below entries.
// for backward compatibility, we continue fill in below entries.