Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 57d70904 authored by Hall Liu's avatar Hall Liu
Browse files

Expose methods to enumerate constants

Expose TelephonyManager#getAllNetworkTypes and
CellSignalStrength#getNumSignalStrengthLevels as utility methods for
other apps.

Fixes: 170781542
Test: atest TelephonyManagerTest
Change-Id: Ie516792a7522dd0df09d7b97f0b764d776559bf1
parent c48de401
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -178,6 +178,18 @@ package android.provider {

}

package android.telephony {

  public abstract class CellSignalStrength {
    method public static int getNumSignalStrengthLevels();
  }

  public class TelephonyManager {
    method @NonNull public static int[] getAllNetworkTypes();
  }

}

package android.util {

  public class AtomicFile {
+12 −0
Original line number Diff line number Diff line
@@ -123,6 +123,18 @@ package android.provider {

}

package android.telephony {

  public abstract class CellSignalStrength {
    method public static int getNumSignalStrengthLevels();
  }

  public class TelephonyManager {
    method @NonNull public static int[] getAllNetworkTypes();
  }

}

package android.util {

  public class AtomicFile {
+4 −2
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package android.telephony;

import android.annotation.IntRange;
import android.annotation.SystemApi;
import android.os.PersistableBundle;

/**
@@ -155,11 +156,12 @@ public abstract class CellSignalStrength {

    /**
     * Returns the number of signal strength levels.
     * @return Number of signal strength levels, enforced to be 5
     * @return Number of signal strength levels, currently defined in the HAL as 5.
     *
     * @hide
     */
    public static final int getNumSignalStrengthLevels() {
    @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
    public static int getNumSignalStrengthLevels() {
        return NUM_SIGNAL_STRENGTH_BINS;
    }
}
+4 −2
Original line number Diff line number Diff line
@@ -2835,11 +2835,13 @@ public class TelephonyManager {
    };
    /**
     * Return a collection of all network types
     * @return network types
     * Returns an array of all valid network types.
     *
     * @return An integer array containing all valid network types in no particular order.
     *
     * @hide
     */
    @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
    public static @NonNull @NetworkType int[] getAllNetworkTypes() {
        return NETWORK_TYPES;
    }