From 3ee618bbf52c25191516a7297a721ed2b29c2691 Mon Sep 17 00:00:00 2001 From: Amit Mahajan Date: Thu, 23 Jan 2020 18:00:08 -0800 Subject: [PATCH] Move EXTRA_SERVICE_STATE from Intent to ServiceState. This extra is not exposed and is not used by anyone as such. Leaving it there for internal use/unsupported app usage. Test: basic sanity Bug: 140908357 Merged-in: I9fe6e904291affb1cd7b705212d47525b61a5679 Change-Id: I9fe6e904291affb1cd7b705212d47525b61a5679 (cherry picked from commit bb61b17cd934d09ee74831c2d4a2820c9c898c2b) --- core/java/android/content/Intent.java | 6 ------ telephony/java/android/telephony/ServiceState.java | 12 ++++++++++-- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java index 8b6840b09b0fc..99ca0484c8c74 100644 --- a/core/java/android/content/Intent.java +++ b/core/java/android/content/Intent.java @@ -4514,12 +4514,6 @@ public class Intent implements Parcelable, Cloneable { @SystemApi public static final String EXTRA_LTE_EARFCN_RSRP_BOOST = "LteEarfcnRsrpBoost"; - /** - * An parcelable extra used with {@link #ACTION_SERVICE_STATE} representing the service state. - * @hide - */ - public static final String EXTRA_SERVICE_STATE = "android.intent.extra.SERVICE_STATE"; - /** * The name of the extra used to define the text to be processed, as a * CharSequence. Note that this may be a styled CharSequence, so you must use diff --git a/telephony/java/android/telephony/ServiceState.java b/telephony/java/android/telephony/ServiceState.java index 948b0274099a9..a5a1ebc101393 100644 --- a/telephony/java/android/telephony/ServiceState.java +++ b/telephony/java/android/telephony/ServiceState.java @@ -317,6 +317,14 @@ public class ServiceState implements Parcelable { */ public static final int UNKNOWN_ID = -1; + /** + * A parcelable extra used with {@link Intent#ACTION_SERVICE_STATE} representing the service + * state. + * @hide + */ + private static final String EXTRA_SERVICE_STATE = "android.intent.extra.SERVICE_STATE"; + + private String mOperatorAlphaLong; private String mOperatorAlphaShort; private String mOperatorNumeric; @@ -1292,7 +1300,7 @@ public class ServiceState implements Parcelable { */ @UnsupportedAppUsage private void setFromNotifierBundle(Bundle m) { - ServiceState ssFromBundle = m.getParcelable(Intent.EXTRA_SERVICE_STATE); + ServiceState ssFromBundle = m.getParcelable(EXTRA_SERVICE_STATE); if (ssFromBundle != null) { copyFrom(ssFromBundle); } @@ -1310,7 +1318,7 @@ public class ServiceState implements Parcelable { */ @SystemApi public void fillInNotifierBundle(@NonNull Bundle m) { - m.putParcelable(Intent.EXTRA_SERVICE_STATE, this); + m.putParcelable(EXTRA_SERVICE_STATE, this); // serviceState already consists of below entries. // for backward compatibility, we continue fill in below entries. m.putInt("voiceRegState", mVoiceRegState);