diff options
Diffstat (limited to 'android/telephony')
-rw-r--r-- | android/telephony/AccessNetworkConstants.java | 3 | ||||
-rw-r--r-- | android/telephony/CarrierConfigManager.java | 31 | ||||
-rw-r--r-- | android/telephony/NetworkRegistrationState.java | 2 | ||||
-rw-r--r-- | android/telephony/NetworkService.java | 8 | ||||
-rw-r--r-- | android/telephony/NetworkServiceCallback.java | 2 | ||||
-rw-r--r-- | android/telephony/ServiceState.java | 8 | ||||
-rw-r--r-- | android/telephony/SubscriptionManager.java | 14 | ||||
-rw-r--r-- | android/telephony/SubscriptionPlan.java | 48 | ||||
-rw-r--r-- | android/telephony/TelephonyManager.java | 17 | ||||
-rw-r--r-- | android/telephony/data/DataCallResponse.java | 2 | ||||
-rw-r--r-- | android/telephony/data/DataProfile.java | 2 | ||||
-rw-r--r-- | android/telephony/data/DataService.java | 8 | ||||
-rw-r--r-- | android/telephony/data/DataServiceCallback.java | 3 | ||||
-rw-r--r-- | android/telephony/ims/stub/ImsFeatureConfiguration.java | 5 | ||||
-rw-r--r-- | android/telephony/mbms/DownloadRequest.java | 2 |
15 files changed, 108 insertions, 47 deletions
diff --git a/android/telephony/AccessNetworkConstants.java b/android/telephony/AccessNetworkConstants.java index cac9f2b5..3b773b3a 100644 --- a/android/telephony/AccessNetworkConstants.java +++ b/android/telephony/AccessNetworkConstants.java @@ -16,8 +16,6 @@ package android.telephony; -import android.annotation.SystemApi; - /** * Contains access network related constants. */ @@ -39,7 +37,6 @@ public final class AccessNetworkConstants { * Wireless transportation type * @hide */ - @SystemApi public static final class TransportType { /** Wireless Wide Area Networks (i.e. Cellular) */ public static final int WWAN = 1; diff --git a/android/telephony/CarrierConfigManager.java b/android/telephony/CarrierConfigManager.java index 4683161d..e2441316 100644 --- a/android/telephony/CarrierConfigManager.java +++ b/android/telephony/CarrierConfigManager.java @@ -1684,6 +1684,14 @@ public class CarrierConfigManager { "data_warning_threshold_bytes_long"; /** + * Controls if the device should automatically notify the user as they reach + * their cellular data warning. When set to {@code false} the carrier is + * expected to have implemented their own notification mechanism. + */ + public static final String KEY_DATA_WARNING_NOTIFICATION_BOOL = + "data_warning_notification_bool"; + + /** * Controls the cellular data limit. * <p> * If the user uses more than this amount of data in their billing cycle, as defined by @@ -1698,6 +1706,22 @@ public class CarrierConfigManager { "data_limit_threshold_bytes_long"; /** + * Controls if the device should automatically notify the user as they reach + * their cellular data limit. When set to {@code false} the carrier is + * expected to have implemented their own notification mechanism. + */ + public static final String KEY_DATA_LIMIT_NOTIFICATION_BOOL = + "data_limit_notification_bool"; + + /** + * Controls if the device should automatically notify the user when rapid + * cellular data usage is observed. When set to {@code false} the carrier is + * expected to have implemented their own notification mechanism. + */ + public static final String KEY_DATA_RAPID_NOTIFICATION_BOOL = + "data_rapid_notification_bool"; + + /** * Offset to be reduced from rsrp threshold while calculating signal strength level. * @hide */ @@ -1954,7 +1978,7 @@ public class CarrierConfigManager { sDefaults.putBoolean(KEY_CARRIER_FORCE_DISABLE_ETWS_CMAS_TEST_BOOL, false); sDefaults.putBoolean(KEY_CARRIER_VOLTE_PROVISIONING_REQUIRED_BOOL, false); sDefaults.putBoolean(KEY_CARRIER_VOLTE_OVERRIDE_WFC_PROVISIONING_BOOL, false); - sDefaults.putBoolean(KEY_CARRIER_VOLTE_TTY_SUPPORTED_BOOL, false); + sDefaults.putBoolean(KEY_CARRIER_VOLTE_TTY_SUPPORTED_BOOL, true); sDefaults.putBoolean(KEY_CARRIER_ALLOW_TURNOFF_IMS_BOOL, true); sDefaults.putBoolean(KEY_CARRIER_IMS_GBA_REQUIRED_BOOL, false); sDefaults.putBoolean(KEY_CARRIER_INSTANT_LETTERING_AVAILABLE_BOOL, false); @@ -2165,7 +2189,10 @@ public class CarrierConfigManager { sDefaults.putInt(KEY_MONTHLY_DATA_CYCLE_DAY_INT, DATA_CYCLE_USE_PLATFORM_DEFAULT); sDefaults.putLong(KEY_DATA_WARNING_THRESHOLD_BYTES_LONG, DATA_CYCLE_USE_PLATFORM_DEFAULT); + sDefaults.putBoolean(KEY_DATA_WARNING_NOTIFICATION_BOOL, true); sDefaults.putLong(KEY_DATA_LIMIT_THRESHOLD_BYTES_LONG, DATA_CYCLE_USE_PLATFORM_DEFAULT); + sDefaults.putBoolean(KEY_DATA_LIMIT_NOTIFICATION_BOOL, true); + sDefaults.putBoolean(KEY_DATA_RAPID_NOTIFICATION_BOOL, true); // Rat families: {GPRS, EDGE}, {EVDO, EVDO_A, EVDO_B}, {UMTS, HSPA, HSDPA, HSUPA, HSPAP}, // {LTE, LTE_CA} @@ -2187,7 +2214,7 @@ public class CarrierConfigManager { sDefaults.putStringArray(KEY_FILTERED_CNAP_NAMES_STRING_ARRAY, null); sDefaults.putBoolean(KEY_EDITABLE_WFC_ROAMING_MODE_BOOL, false); sDefaults.putBoolean(KEY_STK_DISABLE_LAUNCH_BROWSER_BOOL, false); - sDefaults.putBoolean(KEY_PERSIST_LPP_MODE_BOOL, false); + sDefaults.putBoolean(KEY_PERSIST_LPP_MODE_BOOL, true); sDefaults.putStringArray(KEY_CARRIER_WIFI_STRING_ARRAY, null); sDefaults.putInt(KEY_PREF_NETWORK_NOTIFICATION_DELAY_INT, -1); sDefaults.putInt(KEY_EMERGENCY_NOTIFICATION_DELAY_INT, -1); diff --git a/android/telephony/NetworkRegistrationState.java b/android/telephony/NetworkRegistrationState.java index bba779d0..0e2e0cea 100644 --- a/android/telephony/NetworkRegistrationState.java +++ b/android/telephony/NetworkRegistrationState.java @@ -18,7 +18,6 @@ package android.telephony; import android.annotation.IntDef; import android.annotation.Nullable; -import android.annotation.SystemApi; import android.os.Parcel; import android.os.Parcelable; @@ -31,7 +30,6 @@ import java.util.Objects; * Description of a mobile network registration state * @hide */ -@SystemApi public class NetworkRegistrationState implements Parcelable { /** * Network domain diff --git a/android/telephony/NetworkService.java b/android/telephony/NetworkService.java index 35682a74..b431590d 100644 --- a/android/telephony/NetworkService.java +++ b/android/telephony/NetworkService.java @@ -17,7 +17,6 @@ package android.telephony; import android.annotation.CallSuper; -import android.annotation.SystemApi; import android.app.Service; import android.content.Intent; import android.os.Handler; @@ -47,7 +46,6 @@ import java.util.List; * </service> * @hide */ -@SystemApi public abstract class NetworkService extends Service { private final String TAG = NetworkService.class.getSimpleName(); @@ -206,8 +204,10 @@ public abstract class NetworkService extends Service { } } - /** @hide */ - protected NetworkService() { + /** + * Default constructor. + */ + public NetworkService() { mHandlerThread = new HandlerThread(TAG); mHandlerThread.start(); diff --git a/android/telephony/NetworkServiceCallback.java b/android/telephony/NetworkServiceCallback.java index dbad02fd..ad3b00fd 100644 --- a/android/telephony/NetworkServiceCallback.java +++ b/android/telephony/NetworkServiceCallback.java @@ -17,7 +17,6 @@ package android.telephony; import android.annotation.IntDef; -import android.annotation.SystemApi; import android.os.RemoteException; import android.telephony.NetworkService.NetworkServiceProvider; @@ -33,7 +32,6 @@ import java.lang.ref.WeakReference; * * @hide */ -@SystemApi public class NetworkServiceCallback { private static final String mTag = NetworkServiceCallback.class.getSimpleName(); diff --git a/android/telephony/ServiceState.java b/android/telephony/ServiceState.java index e971d08a..8ffdb21c 100644 --- a/android/telephony/ServiceState.java +++ b/android/telephony/ServiceState.java @@ -17,7 +17,6 @@ package android.telephony; import android.annotation.IntDef; -import android.annotation.SystemApi; import android.annotation.TestApi; import android.os.Bundle; import android.os.Parcel; @@ -977,11 +976,13 @@ public class ServiceState implements Parcelable { } /** @hide */ + @TestApi public void setCellBandwidths(int[] bandwidths) { mCellBandwidths = bandwidths; } /** @hide */ + @TestApi public void setChannelNumber(int channelNumber) { mChannelNumber = channelNumber; } @@ -1172,6 +1173,7 @@ public class ServiceState implements Parcelable { } /** @hide */ + @TestApi public void setRilVoiceRadioTechnology(int rt) { if (rt == RIL_RADIO_TECHNOLOGY_LTE_CA) { rt = RIL_RADIO_TECHNOLOGY_LTE; @@ -1181,6 +1183,7 @@ public class ServiceState implements Parcelable { } /** @hide */ + @TestApi public void setRilDataRadioTechnology(int rt) { if (rt == RIL_RADIO_TECHNOLOGY_LTE_CA) { rt = RIL_RADIO_TECHNOLOGY_LTE; @@ -1530,7 +1533,6 @@ public class ServiceState implements Parcelable { * @return List of registration states * @hide */ - @SystemApi public List<NetworkRegistrationState> getNetworkRegistrationStates() { synchronized (mNetworkRegistrationStates) { return new ArrayList<>(mNetworkRegistrationStates); @@ -1544,7 +1546,6 @@ public class ServiceState implements Parcelable { * @return List of registration states. * @hide */ - @SystemApi public List<NetworkRegistrationState> getNetworkRegistrationStates(int transportType) { List<NetworkRegistrationState> list = new ArrayList<>(); @@ -1567,7 +1568,6 @@ public class ServiceState implements Parcelable { * @return The matching NetworkRegistrationState. * @hide */ - @SystemApi public NetworkRegistrationState getNetworkRegistrationStates(int transportType, int domain) { synchronized (mNetworkRegistrationStates) { for (NetworkRegistrationState networkRegistrationState : mNetworkRegistrationStates) { diff --git a/android/telephony/SubscriptionManager.java b/android/telephony/SubscriptionManager.java index 754fe687..a9389bea 100644 --- a/android/telephony/SubscriptionManager.java +++ b/android/telephony/SubscriptionManager.java @@ -477,6 +477,9 @@ public class SubscriptionManager { * <p> * Contains {@link #EXTRA_SUBSCRIPTION_INDEX} to indicate which subscription * the user is interested in. + * <p> + * Receivers should protect themselves by checking that the sender holds the + * {@code android.permission.MANAGE_SUBSCRIPTION_PLANS} permission. */ @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) @SystemApi @@ -1719,6 +1722,8 @@ public class SubscriptionManager { * </ul> * * @param subId the subscriber this relationship applies to + * @throws SecurityException if the caller doesn't meet the requirements + * outlined above. */ @SystemApi public @NonNull List<SubscriptionPlan> getSubscriptionPlans(int subId) { @@ -1744,10 +1749,13 @@ public class SubscriptionManager { * {@link CarrierConfigManager#KEY_CONFIG_PLANS_PACKAGE_OVERRIDE_STRING}. * </ul> * - * @param subId the subscriber this relationship applies to + * @param subId the subscriber this relationship applies to. An empty list + * may be sent to clear any existing plans. * @param plans the list of plans. The first plan is always the primary and * most important plan. Any additional plans are secondary and * may not be displayed or used by decision making logic. + * @throws SecurityException if the caller doesn't meet the requirements + * outlined above. */ @SystemApi public void setSubscriptionPlans(int subId, @NonNull List<SubscriptionPlan> plans) { @@ -1788,6 +1796,8 @@ public class SubscriptionManager { * be automatically cleared, or {@code 0} to leave in the * requested state until explicitly cleared, or the next reboot, * whichever happens first. + * @throws SecurityException if the caller doesn't meet the requirements + * outlined above. */ @SystemApi public void setSubscriptionOverrideUnmetered(int subId, boolean overrideUnmetered, @@ -1822,6 +1832,8 @@ public class SubscriptionManager { * be automatically cleared, or {@code 0} to leave in the * requested state until explicitly cleared, or the next reboot, * whichever happens first. + * @throws SecurityException if the caller doesn't meet the requirements + * outlined above. */ @SystemApi public void setSubscriptionOverrideCongested(int subId, boolean overrideCongested, diff --git a/android/telephony/SubscriptionPlan.java b/android/telephony/SubscriptionPlan.java index 4ffb70ba..e8bbe42e 100644 --- a/android/telephony/SubscriptionPlan.java +++ b/android/telephony/SubscriptionPlan.java @@ -24,7 +24,7 @@ import android.annotation.Nullable; import android.annotation.SystemApi; import android.os.Parcel; import android.os.Parcelable; -import android.util.Pair; +import android.util.Range; import android.util.RecurrenceRule; import com.android.internal.util.Preconditions; @@ -209,7 +209,7 @@ public final class SubscriptionPlan implements Parcelable { * any recurrence rules. The iterator starts from the currently active cycle * and walks backwards through time. */ - public Iterator<Pair<ZonedDateTime, ZonedDateTime>> cycleIterator() { + public Iterator<Range<ZonedDateTime>> cycleIterator() { return cycleRule.cycleIterator(); } @@ -227,6 +227,9 @@ public final class SubscriptionPlan implements Parcelable { /** * Start defining a {@link SubscriptionPlan} that covers a very specific * window of time, and never automatically recurs. + * + * @param start The exact time at which the plan starts. + * @param end The exact time at which the plan ends. */ public static Builder createNonrecurring(ZonedDateTime start, ZonedDateTime end) { if (!end.isAfter(start)) { @@ -237,28 +240,43 @@ public final class SubscriptionPlan implements Parcelable { } /** - * Start defining a {@link SubscriptionPlan} that will recur - * automatically every month. It will always recur on the same day of a - * particular month. When a particular month ends before the defined - * recurrence day, the plan will recur on the last instant of that - * month. + * Start defining a {@link SubscriptionPlan} that starts at a specific + * time, and automatically recurs after each specific period of time, + * repeating indefinitely. + * <p> + * When the given period is set to exactly one month, the plan will + * always recur on the day of the month defined by + * {@link ZonedDateTime#getDayOfMonth()}. When a particular month ends + * before this day, the plan will recur on the last possible instant of + * that month. + * + * @param start The exact time at which the plan starts. + * @param period The period after which the plan automatically recurs. */ + public static Builder createRecurring(ZonedDateTime start, Period period) { + if (period.isZero() || period.isNegative()) { + throw new IllegalArgumentException("Period " + period + " must be positive"); + } + return new Builder(start, null, period); + } + + /** {@hide} */ + @SystemApi + @Deprecated public static Builder createRecurringMonthly(ZonedDateTime start) { return new Builder(start, null, Period.ofMonths(1)); } - /** - * Start defining a {@link SubscriptionPlan} that will recur - * automatically every week. - */ + /** {@hide} */ + @SystemApi + @Deprecated public static Builder createRecurringWeekly(ZonedDateTime start) { return new Builder(start, null, Period.ofDays(7)); } - /** - * Start defining a {@link SubscriptionPlan} that will recur - * automatically every day. - */ + /** {@hide} */ + @SystemApi + @Deprecated public static Builder createRecurringDaily(ZonedDateTime start) { return new Builder(start, null, Period.ofDays(1)); } diff --git a/android/telephony/TelephonyManager.java b/android/telephony/TelephonyManager.java index e15d35b5..956a5b14 100644 --- a/android/telephony/TelephonyManager.java +++ b/android/telephony/TelephonyManager.java @@ -2968,7 +2968,7 @@ public class TelephonyManager { IPhoneSubInfo info = getSubscriberInfo(); if (info == null) return null; - return info.getGroupIdLevel1(mContext.getOpPackageName()); + return info.getGroupIdLevel1ForSubscriber(getSubId(), mContext.getOpPackageName()); } catch (RemoteException ex) { return null; } catch (NullPointerException ex) { @@ -5156,7 +5156,12 @@ public class TelephonyManager { * {@link #AUTHTYPE_EAP_SIM} * @param data authentication challenge data, base64 encoded. * See 3GPP TS 31.102 7.1.2 for more details. - * @return the response of authentication, or null if not available + * @return the response of authentication. This value will be null in the following cases: + * Authentication error, incorrect MAC + * Authentication error, security context not supported + * Key freshness failure + * Authentication error, no memory space available + * Authentication error, no memory space available in EFMUK */ // TODO(b/73660190): This should probably require MODIFY_PHONE_STATE, not // READ_PRIVILEGED_PHONE_STATE. It certainly shouldn't reference the permission in Javadoc since @@ -5177,7 +5182,13 @@ public class TelephonyManager { * {@link #AUTHTYPE_EAP_SIM} * @param data authentication challenge data, base64 encoded. * See 3GPP TS 31.102 7.1.2 for more details. - * @return the response of authentication, or null if not available + * @return the response of authentication. This value will be null in the following cases only + * (see 3GPP TS 31.102 7.3.1): + * Authentication error, incorrect MAC + * Authentication error, security context not supported + * Key freshness failure + * Authentication error, no memory space available + * Authentication error, no memory space available in EFMUK * @hide */ public String getIccAuthentication(int subId, int appType, int authType, String data) { diff --git a/android/telephony/data/DataCallResponse.java b/android/telephony/data/DataCallResponse.java index 25f51333..acc24704 100644 --- a/android/telephony/data/DataCallResponse.java +++ b/android/telephony/data/DataCallResponse.java @@ -19,7 +19,6 @@ package android.telephony.data; import android.annotation.NonNull; import android.annotation.Nullable; -import android.annotation.SystemApi; import android.net.LinkAddress; import android.os.Parcel; import android.os.Parcelable; @@ -34,7 +33,6 @@ import java.util.Objects; * * @hide */ -@SystemApi public final class DataCallResponse implements Parcelable { private final int mStatus; private final int mSuggestedRetryTime; diff --git a/android/telephony/data/DataProfile.java b/android/telephony/data/DataProfile.java index e8597b22..dd274c56 100644 --- a/android/telephony/data/DataProfile.java +++ b/android/telephony/data/DataProfile.java @@ -16,7 +16,6 @@ package android.telephony.data; -import android.annotation.SystemApi; import android.os.Build; import android.os.Parcel; import android.os.Parcelable; @@ -30,7 +29,6 @@ import com.android.internal.telephony.RILConstants; * * @hide */ -@SystemApi public final class DataProfile implements Parcelable { // The types indicating the data profile is used on GSM (3GPP) or CDMA (3GPP2) network. diff --git a/android/telephony/data/DataService.java b/android/telephony/data/DataService.java index e8c1cb11..0835f7d9 100644 --- a/android/telephony/data/DataService.java +++ b/android/telephony/data/DataService.java @@ -20,7 +20,6 @@ import android.annotation.CallSuper; import android.annotation.IntDef; import android.annotation.NonNull; import android.annotation.Nullable; -import android.annotation.SystemApi; import android.app.Service; import android.content.Intent; import android.net.LinkProperties; @@ -55,7 +54,6 @@ import java.util.List; * </service> * @hide */ -@SystemApi public abstract class DataService extends Service { private static final String TAG = DataService.class.getSimpleName(); @@ -429,8 +427,10 @@ public abstract class DataService extends Service { } } - /** @hide */ - protected DataService() { + /** + * Default constructor. + */ + public DataService() { mHandlerThread = new HandlerThread(TAG); mHandlerThread.start(); diff --git a/android/telephony/data/DataServiceCallback.java b/android/telephony/data/DataServiceCallback.java index 4af31b5e..bff82608 100644 --- a/android/telephony/data/DataServiceCallback.java +++ b/android/telephony/data/DataServiceCallback.java @@ -17,7 +17,6 @@ package android.telephony.data; import android.annotation.IntDef; -import android.annotation.SystemApi; import android.net.LinkProperties; import android.os.RemoteException; import android.telephony.Rlog; @@ -35,7 +34,6 @@ import java.util.List; * * @hide */ -@SystemApi public class DataServiceCallback { private static final String TAG = DataServiceCallback.class.getSimpleName(); @@ -125,7 +123,6 @@ public class DataServiceCallback { * * @param result The result code. Must be one of the {@link ResultCode}. */ - @SystemApi public void onSetDataProfileComplete(@ResultCode int result) { IDataServiceCallback callback = mCallback.get(); if (callback != null) { diff --git a/android/telephony/ims/stub/ImsFeatureConfiguration.java b/android/telephony/ims/stub/ImsFeatureConfiguration.java index 2f52c0ac..dfb6e2ce 100644 --- a/android/telephony/ims/stub/ImsFeatureConfiguration.java +++ b/android/telephony/ims/stub/ImsFeatureConfiguration.java @@ -77,6 +77,11 @@ public final class ImsFeatureConfiguration implements Parcelable { result = 31 * result + featureType; return result; } + + @Override + public String toString() { + return "{s=" + slotId + ", f=" + featureType + "}"; + } } /** diff --git a/android/telephony/mbms/DownloadRequest.java b/android/telephony/mbms/DownloadRequest.java index 602c796a..9e3302bd 100644 --- a/android/telephony/mbms/DownloadRequest.java +++ b/android/telephony/mbms/DownloadRequest.java @@ -18,6 +18,7 @@ package android.telephony.mbms; import android.annotation.NonNull; import android.annotation.SystemApi; +import android.annotation.TestApi; import android.content.Intent; import android.net.Uri; import android.os.Parcel; @@ -184,6 +185,7 @@ public final class DownloadRequest implements Parcelable { * @hide */ @SystemApi + @TestApi public Builder setServiceId(String serviceId) { fileServiceId = serviceId; return this; |