Redirect Value Source of SignalStrength Constants

SignalStrength contains a few hidden constants that
are identical to publicly exposed constants in
CellSignalStrength. Since the CellSignalStrength
values are public, redefine SignalStrength to point
to the public values and limit access to them
(since there is already a public alternative).

Bug: 30188945
Test: compilation
Change-Id: Ie7f295ef4d7849f7ce3a631cbdffe3d6670da5bd
This commit is contained in:
Nathan Harold
2018-11-14 11:51:51 -08:00
parent 9f248989bf
commit a6d893e451
2 changed files with 26 additions and 21 deletions

View File

@@ -21,15 +21,20 @@ package android.telephony;
*/
public abstract class CellSignalStrength {
public static final int SIGNAL_STRENGTH_NONE_OR_UNKNOWN = 0;
public static final int SIGNAL_STRENGTH_NONE_OR_UNKNOWN =
TelephonyProtoEnums.SIGNAL_STRENGTH_NONE_OR_UNKNOWN; // 0
public static final int SIGNAL_STRENGTH_POOR = 1;
public static final int SIGNAL_STRENGTH_POOR =
TelephonyProtoEnums.SIGNAL_STRENGTH_POOR; // 1
public static final int SIGNAL_STRENGTH_MODERATE = 2;
public static final int SIGNAL_STRENGTH_MODERATE =
TelephonyProtoEnums.SIGNAL_STRENGTH_MODERATE; // 2
public static final int SIGNAL_STRENGTH_GOOD = 3;
public static final int SIGNAL_STRENGTH_GOOD =
TelephonyProtoEnums.SIGNAL_STRENGTH_GOOD; // 3
public static final int SIGNAL_STRENGTH_GREAT = 4;
public static final int SIGNAL_STRENGTH_GREAT =
TelephonyProtoEnums.SIGNAL_STRENGTH_GREAT; // 4
/** @hide */
public static final int NUM_SIGNAL_STRENGTH_BINS = 5;

View File

@@ -17,12 +17,12 @@
package android.telephony;
import android.annotation.UnsupportedAppUsage;
import android.os.Build;
import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable;
import android.telephony.CarrierConfigManager;
import android.util.Log;
import android.content.res.Resources;
import java.util.ArrayList;
import java.util.Arrays;
@@ -37,25 +37,25 @@ public class SignalStrength implements Parcelable {
private static final boolean DBG = false;
/** @hide */
@UnsupportedAppUsage
public static final int SIGNAL_STRENGTH_NONE_OR_UNKNOWN
= TelephonyProtoEnums.SIGNAL_STRENGTH_NONE_OR_UNKNOWN; // = 0
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
public static final int SIGNAL_STRENGTH_NONE_OR_UNKNOWN =
CellSignalStrength.SIGNAL_STRENGTH_NONE_OR_UNKNOWN; // = 0
/** @hide */
@UnsupportedAppUsage
public static final int SIGNAL_STRENGTH_POOR
= TelephonyProtoEnums.SIGNAL_STRENGTH_POOR; // = 1
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
public static final int SIGNAL_STRENGTH_POOR =
CellSignalStrength.SIGNAL_STRENGTH_POOR; // = 1
/** @hide */
@UnsupportedAppUsage
public static final int SIGNAL_STRENGTH_MODERATE
= TelephonyProtoEnums.SIGNAL_STRENGTH_MODERATE; // = 2
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
public static final int SIGNAL_STRENGTH_MODERATE =
CellSignalStrength.SIGNAL_STRENGTH_MODERATE; // = 2
/** @hide */
@UnsupportedAppUsage
public static final int SIGNAL_STRENGTH_GOOD
= TelephonyProtoEnums.SIGNAL_STRENGTH_GOOD; // = 3
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
public static final int SIGNAL_STRENGTH_GOOD =
CellSignalStrength.SIGNAL_STRENGTH_GOOD; // = 3
/** @hide */
@UnsupportedAppUsage
public static final int SIGNAL_STRENGTH_GREAT
= TelephonyProtoEnums.SIGNAL_STRENGTH_GREAT; // = 4
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
public static final int SIGNAL_STRENGTH_GREAT =
CellSignalStrength.SIGNAL_STRENGTH_GREAT; // = 4
/** @hide */
@UnsupportedAppUsage
public static final int NUM_SIGNAL_STRENGTH_BINS = 5;