Merge "Add TimeStamp Constructor for HAL 1.4 Support"
diff --git a/Android.bp b/Android.bp
index 79734df..b099bab 100644
--- a/Android.bp
+++ b/Android.bp
@@ -201,6 +201,7 @@
"core/java/android/net/INetworkScoreService.aidl",
"core/java/android/net/INetworkStatsService.aidl",
"core/java/android/net/INetworkStatsSession.aidl",
+ "core/java/android/net/ITestNetworkManager.aidl",
"core/java/android/net/ITetheringStatsProvider.aidl",
"core/java/android/net/nsd/INsdManager.aidl",
"core/java/android/nfc/IAppCallback.aidl",
@@ -551,6 +552,7 @@
"telephony/java/com/android/internal/telephony/IOnSubscriptionsChangedListener.aidl",
"telephony/java/com/android/internal/telephony/IPhoneStateListener.aidl",
"telephony/java/com/android/internal/telephony/IPhoneSubInfo.aidl",
+ "telephony/java/com/android/internal/telephony/ISetOpportunisticDataCallback.aidl",
"telephony/java/com/android/internal/telephony/ISms.aidl",
"telephony/java/com/android/internal/telephony/ISub.aidl",
"telephony/java/com/android/internal/telephony/IOns.aidl",
@@ -1048,6 +1050,7 @@
"core/java/android/os/HidlSupport.java",
"core/java/android/annotation/IntDef.java",
"core/java/android/annotation/NonNull.java",
+ "core/java/android/annotation/Nullable.java",
"core/java/android/annotation/SystemApi.java",
"core/java/android/annotation/TestApi.java",
"core/java/android/os/HwBinder.java",
@@ -1189,10 +1192,7 @@
"test-base/src/**/*.java",
":opt-telephony-srcs",
":opt-net-voip-srcs",
- ":openjdk_javadoc_files",
- ":non_openjdk_javadoc_files",
- ":android_icu4j_src_files_for_docs",
- ":conscrypt_public_api_files",
+ ":core_public_api_files",
"test-mock/src/**/*.java",
"test-runner/src/**/*.java",
],
@@ -1250,10 +1250,7 @@
srcs: [
":opt-telephony-srcs",
":opt-net-voip-srcs",
- ":openjdk_javadoc_files",
- ":non_openjdk_javadoc_files",
- ":android_icu4j_src_files_for_docs",
- ":conscrypt_public_api_files",
+ ":core_public_api_files",
],
srcs_lib: "framework",
srcs_lib_whitelist_dirs: frameworks_base_subdirs,
@@ -1687,3 +1684,11 @@
},
},
}
+
+// Creates an index of AIDL methods; used for adding UnsupportedAppUsage
+// annotations to private apis
+aidl_mapping {
+ name: "framework-aidl-mappings",
+ srcs: [":framework-defaults"],
+ output: "framework-aidl-mappings.txt"
+}
\ No newline at end of file
diff --git a/api/current.txt b/api/current.txt
index 288a8a0..c356b39 100755
--- a/api/current.txt
+++ b/api/current.txt
@@ -8390,9 +8390,9 @@
}
public final class BluetoothHearingAid implements android.bluetooth.BluetoothProfile {
- method public java.util.List<android.bluetooth.BluetoothDevice> getConnectedDevices();
- method public int getConnectionState(android.bluetooth.BluetoothDevice);
- method public java.util.List<android.bluetooth.BluetoothDevice> getDevicesMatchingConnectionStates(int[]);
+ method @NonNull public java.util.List<android.bluetooth.BluetoothDevice> getConnectedDevices();
+ method public int getConnectionState(@NonNull android.bluetooth.BluetoothDevice);
+ method @NonNull public java.util.List<android.bluetooth.BluetoothDevice> getDevicesMatchingConnectionStates(@NonNull int[]);
field public static final String ACTION_CONNECTION_STATE_CHANGED = "android.bluetooth.hearingaid.profile.action.CONNECTION_STATE_CHANGED";
}
@@ -27249,8 +27249,8 @@
}
public class InetAddresses {
- method public static boolean isNumericAddress(String);
- method public static java.net.InetAddress parseNumericAddress(String);
+ method public static boolean isNumericAddress(@NonNull String);
+ method @NonNull public static java.net.InetAddress parseNumericAddress(@NonNull String);
}
public final class IpPrefix implements android.os.Parcelable {
@@ -27469,6 +27469,7 @@
field public static final int NET_CAPABILITY_IA = 7; // 0x7
field public static final int NET_CAPABILITY_IMS = 4; // 0x4
field public static final int NET_CAPABILITY_INTERNET = 12; // 0xc
+ field public static final int NET_CAPABILITY_MCX = 23; // 0x17
field public static final int NET_CAPABILITY_MMS = 0; // 0x0
field public static final int NET_CAPABILITY_NOT_CONGESTED = 20; // 0x14
field public static final int NET_CAPABILITY_NOT_METERED = 11; // 0xb
@@ -27840,25 +27841,25 @@
public class VpnService.Builder {
ctor public VpnService.Builder();
- method public android.net.VpnService.Builder addAddress(java.net.InetAddress, int);
- method public android.net.VpnService.Builder addAddress(String, int);
- method public android.net.VpnService.Builder addAllowedApplication(String) throws android.content.pm.PackageManager.NameNotFoundException;
- method public android.net.VpnService.Builder addDisallowedApplication(String) throws android.content.pm.PackageManager.NameNotFoundException;
- method public android.net.VpnService.Builder addDnsServer(java.net.InetAddress);
- method public android.net.VpnService.Builder addDnsServer(String);
- method public android.net.VpnService.Builder addRoute(java.net.InetAddress, int);
- method public android.net.VpnService.Builder addRoute(String, int);
- method public android.net.VpnService.Builder addSearchDomain(String);
- method public android.net.VpnService.Builder allowBypass();
- method public android.net.VpnService.Builder allowFamily(int);
- method public android.os.ParcelFileDescriptor establish();
- method public android.net.VpnService.Builder setBlocking(boolean);
- method public android.net.VpnService.Builder setConfigureIntent(android.app.PendingIntent);
- method public android.net.VpnService.Builder setHttpProxy(@NonNull android.net.ProxyInfo);
- method public android.net.VpnService.Builder setMetered(boolean);
- method public android.net.VpnService.Builder setMtu(int);
- method public android.net.VpnService.Builder setSession(String);
- method public android.net.VpnService.Builder setUnderlyingNetworks(android.net.Network[]);
+ method @NonNull public android.net.VpnService.Builder addAddress(@NonNull java.net.InetAddress, int);
+ method @NonNull public android.net.VpnService.Builder addAddress(@NonNull String, int);
+ method @NonNull public android.net.VpnService.Builder addAllowedApplication(@NonNull String) throws android.content.pm.PackageManager.NameNotFoundException;
+ method @NonNull public android.net.VpnService.Builder addDisallowedApplication(@NonNull String) throws android.content.pm.PackageManager.NameNotFoundException;
+ method @NonNull public android.net.VpnService.Builder addDnsServer(@NonNull java.net.InetAddress);
+ method @NonNull public android.net.VpnService.Builder addDnsServer(@NonNull String);
+ method @NonNull public android.net.VpnService.Builder addRoute(@NonNull java.net.InetAddress, int);
+ method @NonNull public android.net.VpnService.Builder addRoute(@NonNull String, int);
+ method @NonNull public android.net.VpnService.Builder addSearchDomain(@NonNull String);
+ method @NonNull public android.net.VpnService.Builder allowBypass();
+ method @NonNull public android.net.VpnService.Builder allowFamily(int);
+ method @Nullable public android.os.ParcelFileDescriptor establish();
+ method @NonNull public android.net.VpnService.Builder setBlocking(boolean);
+ method @NonNull public android.net.VpnService.Builder setConfigureIntent(@NonNull android.app.PendingIntent);
+ method @NonNull public android.net.VpnService.Builder setHttpProxy(@NonNull android.net.ProxyInfo);
+ method @NonNull public android.net.VpnService.Builder setMetered(boolean);
+ method @NonNull public android.net.VpnService.Builder setMtu(int);
+ method @NonNull public android.net.VpnService.Builder setSession(@NonNull String);
+ method @NonNull public android.net.VpnService.Builder setUnderlyingNetworks(@Nullable android.net.Network[]);
}
}
@@ -27890,7 +27891,7 @@
method public java.util.Date getValidNotAfterDate();
method @Deprecated public String getValidNotBefore();
method public java.util.Date getValidNotBeforeDate();
- method public java.security.cert.X509Certificate getX509Certificate();
+ method @Nullable public java.security.cert.X509Certificate getX509Certificate();
method public static android.net.http.SslCertificate restoreState(android.os.Bundle);
method public static android.os.Bundle saveState(android.net.http.SslCertificate);
}
@@ -29193,10 +29194,10 @@
method public boolean isDefaultServiceForCategory(android.content.ComponentName, String);
method public boolean registerAidsForService(android.content.ComponentName, String, java.util.List<java.lang.String>);
method public boolean removeAidsForService(android.content.ComponentName, String);
- method public boolean setOffHostForService(android.content.ComponentName, String);
+ method public boolean setOffHostForService(@NonNull android.content.ComponentName, @NonNull String);
method public boolean setPreferredService(android.app.Activity, android.content.ComponentName);
method public boolean supportsAidPrefixRegistration();
- method public boolean unsetOffHostForService(android.content.ComponentName);
+ method public boolean unsetOffHostForService(@NonNull android.content.ComponentName);
method public boolean unsetPreferredService(android.app.Activity);
field public static final String ACTION_CHANGE_DEFAULT = "android.nfc.cardemulation.action.ACTION_CHANGE_DEFAULT";
field public static final String CATEGORY_OTHER = "other";
@@ -37320,7 +37321,7 @@
}
public static final class Telephony.CarrierId implements android.provider.BaseColumns {
- method public static android.net.Uri getPreciseCarrierIdUriForSubscriptionId(int);
+ method @NonNull public static android.net.Uri getPreciseCarrierIdUriForSubscriptionId(int);
method public static android.net.Uri getUriForSubscriptionId(int);
field public static final String CARRIER_ID = "carrier_id";
field public static final String CARRIER_NAME = "carrier_name";
@@ -39439,7 +39440,7 @@
public class CarrierIdentifier implements android.os.Parcelable {
ctor public CarrierIdentifier(String, String, @Nullable String, @Nullable String, @Nullable String, @Nullable String);
- ctor public CarrierIdentifier(String, String, @Nullable String, @Nullable String, @Nullable String, @Nullable String, int, int);
+ ctor public CarrierIdentifier(@NonNull String, @NonNull String, @Nullable String, @Nullable String, @Nullable String, @Nullable String, int, int);
ctor public CarrierIdentifier(byte[], @Nullable String, @Nullable String);
method public int describeContents();
method public int getCarrierId();
@@ -41262,14 +41263,14 @@
field public static final android.os.Parcelable.Creator<android.telecom.CallIdentification> CREATOR;
}
- public static class CallIdentification.Builder {
+ public static final class CallIdentification.Builder {
ctor public CallIdentification.Builder();
- method public android.telecom.CallIdentification build();
- method public android.telecom.CallIdentification.Builder setDescription(@Nullable CharSequence);
- method public android.telecom.CallIdentification.Builder setDetails(@Nullable CharSequence);
- method public android.telecom.CallIdentification.Builder setName(@Nullable CharSequence);
- method public android.telecom.CallIdentification.Builder setNuisanceConfidence(int);
- method public android.telecom.CallIdentification.Builder setPhoto(@Nullable android.graphics.drawable.Icon);
+ method @NonNull public android.telecom.CallIdentification build();
+ method @NonNull public android.telecom.CallIdentification.Builder setDescription(@Nullable CharSequence);
+ method @NonNull public android.telecom.CallIdentification.Builder setDetails(@Nullable CharSequence);
+ method @NonNull public android.telecom.CallIdentification.Builder setName(@Nullable CharSequence);
+ method @NonNull public android.telecom.CallIdentification.Builder setNuisanceConfidence(int);
+ method @NonNull public android.telecom.CallIdentification.Builder setPhoto(@Nullable android.graphics.drawable.Icon);
}
public abstract class CallRedirectionService extends android.app.Service {
@@ -41735,8 +41736,9 @@
}
public final class PhoneAccountSuggestion implements android.os.Parcelable {
+ ctor public PhoneAccountSuggestion(@NonNull android.telecom.PhoneAccountHandle, int, boolean);
method public int describeContents();
- method public android.telecom.PhoneAccountHandle getPhoneAccountHandle();
+ method @NonNull public android.telecom.PhoneAccountHandle getPhoneAccountHandle();
method public int getReason();
method public boolean shouldAutoSelect();
method public void writeToParcel(android.os.Parcel, int);
@@ -41890,8 +41892,8 @@
method public android.telecom.PhoneAccount getPhoneAccount(android.telecom.PhoneAccountHandle);
method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public java.util.List<android.telecom.PhoneAccountHandle> getSelfManagedPhoneAccounts();
method public android.telecom.PhoneAccountHandle getSimCallManager();
- method public String getSystemDialerPackage();
- method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public android.telecom.PhoneAccountHandle getUserSelectedOutgoingPhoneAccount();
+ method @Nullable public String getSystemDialerPackage();
+ method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) @Nullable public android.telecom.PhoneAccountHandle getUserSelectedOutgoingPhoneAccount();
method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public String getVoiceMailNumber(android.telecom.PhoneAccountHandle);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean handleMmi(String);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean handleMmi(String, android.telecom.PhoneAccountHandle);
@@ -42268,6 +42270,7 @@
field public static final String KEY_SUPPORT_PAUSE_IMS_VIDEO_CALLS_BOOL = "support_pause_ims_video_calls_bool";
field public static final String KEY_SUPPORT_SWAP_AFTER_MERGE_BOOL = "support_swap_after_merge_bool";
field public static final String KEY_TREAT_DOWNGRADED_VIDEO_CALLS_AS_VIDEO_CALLS_BOOL = "treat_downgraded_video_calls_as_video_calls_bool";
+ field public static final String KEY_TTY_SUPPORTED_BOOL = "tty_supported_bool";
field public static final String KEY_USE_HFA_FOR_PROVISIONING_BOOL = "use_hfa_for_provisioning_bool";
field public static final String KEY_USE_OTASP_FOR_PROVISIONING_BOOL = "use_otasp_for_provisioning_bool";
field public static final String KEY_USE_RCS_PRESENCE_BOOL = "use_rcs_presence_bool";
@@ -42335,10 +42338,10 @@
}
public final class CellIdentityNr extends android.telephony.CellIdentity {
- method public int getChannelNumber();
method public String getMccString();
method public String getMncString();
method public long getNci();
+ method public int getNrarfcn();
method public int getPci();
method public int getTac();
method public void writeToParcel(android.os.Parcel, int);
@@ -42382,6 +42385,7 @@
field public static final int CONNECTION_UNKNOWN = 2147483647; // 0x7fffffff
field public static final android.os.Parcelable.Creator<android.telephony.CellInfo> CREATOR;
field public static final int UNAVAILABLE = 2147483647; // 0x7fffffff
+ field public static final long UNAVAILABLE_LONG = 9223372036854775807L; // 0x7fffffffffffffffL
}
public final class CellInfoCdma extends android.telephony.CellInfo implements android.os.Parcelable {
@@ -42557,7 +42561,7 @@
public class MbmsGroupCallSession implements java.lang.AutoCloseable {
method public void close();
method @Nullable public static android.telephony.MbmsGroupCallSession create(@NonNull android.content.Context, int, @NonNull java.util.concurrent.Executor, @NonNull android.telephony.mbms.MbmsGroupCallSessionCallback);
- method public static android.telephony.MbmsGroupCallSession create(@NonNull android.content.Context, @NonNull java.util.concurrent.Executor, @NonNull android.telephony.mbms.MbmsGroupCallSessionCallback);
+ method @Nullable public static android.telephony.MbmsGroupCallSession create(@NonNull android.content.Context, @NonNull java.util.concurrent.Executor, @NonNull android.telephony.mbms.MbmsGroupCallSessionCallback);
method @Nullable public android.telephony.mbms.GroupCall startGroupCall(long, @NonNull java.util.List<java.lang.Integer>, @NonNull java.util.List<java.lang.Integer>, @NonNull java.util.concurrent.Executor, @NonNull android.telephony.mbms.GroupCallCallback);
}
@@ -42725,7 +42729,7 @@
public class ServiceState implements android.os.Parcelable {
ctor public ServiceState();
ctor public ServiceState(android.telephony.ServiceState);
- ctor public ServiceState(android.os.Parcel);
+ ctor @Deprecated public ServiceState(android.os.Parcel);
method protected void copyFrom(android.telephony.ServiceState);
method public int describeContents();
method public int getCdmaNetworkId();
@@ -42762,7 +42766,7 @@
method @Deprecated public int getCdmaDbm();
method @Deprecated public int getCdmaEcio();
method @NonNull public java.util.List<android.telephony.CellSignalStrength> getCellSignalStrengths();
- method public <T extends android.telephony.CellSignalStrength> java.util.List<T> getCellSignalStrengths(@NonNull Class<T>);
+ method @NonNull public <T extends android.telephony.CellSignalStrength> java.util.List<T> getCellSignalStrengths(@NonNull Class<T>);
method @Deprecated public int getEvdoDbm();
method @Deprecated public int getEvdoEcio();
method @Deprecated public int getEvdoSnr();
@@ -42916,9 +42920,9 @@
method public String getIccId();
method public int getIconTint();
method @Deprecated public int getMcc();
- method public String getMccString();
+ method @Nullable public String getMccString();
method @Deprecated public int getMnc();
- method public String getMncString();
+ method @Nullable public String getMncString();
method public String getNumber();
method public int getSimSlotIndex();
method public int getSubscriptionId();
@@ -43041,8 +43045,8 @@
method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public String getImei();
method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public String getImei(int);
method @RequiresPermission(anyOf={android.Manifest.permission.READ_PHONE_STATE, android.Manifest.permission.READ_SMS, android.Manifest.permission.READ_PHONE_NUMBERS}) public String getLine1Number();
- method public String getManufacturerCode();
- method public String getManufacturerCode(int);
+ method @Nullable public String getManufacturerCode();
+ method @Nullable public String getManufacturerCode(int);
method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public String getMeid();
method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public String getMeid(int);
method public String getMmsUAProfUrl();
@@ -43069,8 +43073,8 @@
method public int getSimState();
method public int getSimState(int);
method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public String getSubscriberId();
- method public String getTypeAllocationCode();
- method public String getTypeAllocationCode(int);
+ method @Nullable public String getTypeAllocationCode();
+ method @Nullable public String getTypeAllocationCode(int);
method @RequiresPermission("android.permission.READ_PRIVILEGED_PHONE_STATE") @NonNull public java.util.List<android.telephony.UiccCardInfo> getUiccCardsInfo();
method @Nullable @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public String getVisualVoicemailPackageName();
method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public String getVoiceMailAlphaTag();
@@ -43193,6 +43197,9 @@
field public static final int PHONE_TYPE_GSM = 1; // 0x1
field public static final int PHONE_TYPE_NONE = 0; // 0x0
field public static final int PHONE_TYPE_SIP = 3; // 0x3
+ field public static final int SET_OPPORTUNISTIC_SUB_INVALID_PARAMETER = 2; // 0x2
+ field public static final int SET_OPPORTUNISTIC_SUB_SUCCESS = 0; // 0x0
+ field public static final int SET_OPPORTUNISTIC_SUB_VALIDATION_FAILED = 1; // 0x1
field public static final int SIM_STATE_ABSENT = 1; // 0x1
field public static final int SIM_STATE_CARD_IO_ERROR = 8; // 0x8
field public static final int SIM_STATE_CARD_RESTRICTED = 9; // 0x9
@@ -43362,6 +43369,7 @@
field public static final int TYPE_HIPRI = 16; // 0x10
field public static final int TYPE_IA = 256; // 0x100
field public static final int TYPE_IMS = 64; // 0x40
+ field public static final int TYPE_MCX = 1024; // 0x400
field public static final int TYPE_MMS = 2; // 0x2
field public static final int TYPE_SUPL = 4; // 0x4
}
@@ -43373,7 +43381,7 @@
method public android.telephony.data.ApnSetting.Builder setApnTypeBitmask(int);
method public android.telephony.data.ApnSetting.Builder setAuthType(int);
method public android.telephony.data.ApnSetting.Builder setCarrierEnabled(boolean);
- method public android.telephony.data.ApnSetting.Builder setCarrierId(int);
+ method @NonNull public android.telephony.data.ApnSetting.Builder setCarrierId(int);
method public android.telephony.data.ApnSetting.Builder setEntryName(String);
method @Deprecated public android.telephony.data.ApnSetting.Builder setMmsProxyAddress(java.net.InetAddress);
method public android.telephony.data.ApnSetting.Builder setMmsProxyAddress(String);
@@ -43451,7 +43459,7 @@
}
public class EuiccManager {
- method public android.telephony.euicc.EuiccManager createForCardId(int);
+ method @NonNull public android.telephony.euicc.EuiccManager createForCardId(int);
method @RequiresPermission("android.permission.WRITE_EMBEDDED_SUBSCRIPTIONS") public void deleteSubscription(int, android.app.PendingIntent);
method @RequiresPermission("android.permission.WRITE_EMBEDDED_SUBSCRIPTIONS") public void downloadSubscription(android.telephony.euicc.DownloadableSubscription, boolean, android.app.PendingIntent);
method @Nullable public String getEid();
diff --git a/api/removed.txt b/api/removed.txt
index 72202ad..d6169cb 100644
--- a/api/removed.txt
+++ b/api/removed.txt
@@ -304,11 +304,17 @@
package android.net {
public class ConnectivityManager {
+ method @Deprecated public void getLatestTetheringEntitlementValue(int, boolean, @NonNull android.net.ConnectivityManager.TetheringEntitlementValueListener, @Nullable android.os.Handler);
method @Deprecated public boolean requestRouteToHost(int, int);
method @Deprecated public int startUsingNetworkFeature(int, String);
method @Deprecated public int stopUsingNetworkFeature(int, String);
}
+ @Deprecated public abstract static class ConnectivityManager.TetheringEntitlementValueListener {
+ ctor public ConnectivityManager.TetheringEntitlementValueListener();
+ method public void onEntitlementResult(int);
+ }
+
@Deprecated public class NetworkBadging {
method @NonNull public static android.graphics.drawable.Drawable getWifiIcon(@IntRange(from=0, to=4) int, int, @Nullable android.content.res.Resources.Theme);
field public static final int BADGING_4K = 30; // 0x1e
diff --git a/api/system-current.txt b/api/system-current.txt
index 67ff89f..24df5f1 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -3098,7 +3098,7 @@
method @RequiresPermission(android.Manifest.permission.PACKET_KEEPALIVE_OFFLOAD) public android.net.SocketKeepalive createSocketKeepalive(@NonNull android.net.Network, @NonNull java.net.Socket, @NonNull java.util.concurrent.Executor, @NonNull android.net.SocketKeepalive.Callback);
method public boolean getAvoidBadWifi();
method @RequiresPermission(android.Manifest.permission.LOCAL_MAC_ADDRESS) public String getCaptivePortalServerUrl();
- method @RequiresPermission(android.Manifest.permission.TETHER_PRIVILEGED) public void getLatestTetheringEntitlementValue(int, boolean, @NonNull android.net.ConnectivityManager.TetheringEntitlementValueListener, @Nullable android.os.Handler);
+ method @RequiresPermission(android.Manifest.permission.TETHER_PRIVILEGED) public void getLatestTetheringEntitlementResult(int, boolean, @NonNull java.util.concurrent.Executor, @NonNull android.net.ConnectivityManager.OnTetheringEntitlementResultListener);
method @RequiresPermission(anyOf={android.Manifest.permission.TETHER_PRIVILEGED, android.Manifest.permission.WRITE_SETTINGS}) public boolean isTetheringSupported();
method @RequiresPermission(anyOf={"android.permission.NETWORK_SETTINGS", android.Manifest.permission.NETWORK_SETUP_WIZARD, "android.permission.NETWORK_STACK"}) public void setAirplaneMode(boolean);
method @RequiresPermission(android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK) public void startCaptivePortalApp(android.net.Network, android.os.Bundle);
@@ -3121,8 +3121,7 @@
method public void onTetheringStarted();
}
- public abstract static class ConnectivityManager.TetheringEntitlementValueListener {
- ctor public ConnectivityManager.TetheringEntitlementValueListener();
+ public static interface ConnectivityManager.OnTetheringEntitlementResultListener {
method public void onEntitlementResult(int);
}
@@ -3133,8 +3132,8 @@
public class LinkAddress implements android.os.Parcelable {
ctor public LinkAddress(java.net.InetAddress, int, int, int);
- ctor public LinkAddress(java.net.InetAddress, int);
- ctor public LinkAddress(String);
+ ctor public LinkAddress(@NonNull java.net.InetAddress, int);
+ ctor public LinkAddress(@NonNull String);
ctor public LinkAddress(String, int, int);
method public boolean isGlobalPreferred();
method public boolean isIPv4();
@@ -3516,19 +3515,16 @@
package android.net.util {
public class SocketUtils {
- method public static void addArpEntry(java.net.Inet4Address, android.net.MacAddress, String, java.io.FileDescriptor) throws java.io.IOException;
- method public static void attachControlPacketFilter(java.io.FileDescriptor, int) throws java.net.SocketException;
- method public static void attachDhcpFilter(java.io.FileDescriptor) throws java.net.SocketException;
- method public static void attachRaFilter(java.io.FileDescriptor, int) throws java.net.SocketException;
- method public static void bindSocket(java.io.FileDescriptor, java.net.SocketAddress) throws android.system.ErrnoException, java.net.SocketException;
- method public static void bindSocketToInterface(java.io.FileDescriptor, String) throws android.system.ErrnoException;
- method public static void closeSocket(java.io.FileDescriptor) throws java.io.IOException;
- method public static void connectSocket(java.io.FileDescriptor, java.net.SocketAddress) throws android.system.ErrnoException, java.net.SocketException;
+ method public static void addArpEntry(@NonNull java.net.Inet4Address, @NonNull android.net.MacAddress, @NonNull String, @NonNull java.io.FileDescriptor) throws java.io.IOException;
+ method public static void attachControlPacketFilter(@NonNull java.io.FileDescriptor, int) throws java.net.SocketException;
+ method public static void attachDhcpFilter(@NonNull java.io.FileDescriptor) throws java.net.SocketException;
+ method public static void attachRaFilter(@NonNull java.io.FileDescriptor, int) throws java.net.SocketException;
+ method public static void bindSocketToInterface(@NonNull java.io.FileDescriptor, @NonNull String) throws android.system.ErrnoException;
+ method public static void closeSocket(@Nullable java.io.FileDescriptor) throws java.io.IOException;
method public static java.net.SocketAddress makeNetlinkSocketAddress(int, int);
method public static java.net.SocketAddress makePacketSocketAddress(short, int);
- method public static java.net.SocketAddress makePacketSocketAddress(int, byte[]);
- method public static void sendTo(java.io.FileDescriptor, byte[], int, int, int, java.net.SocketAddress) throws android.system.ErrnoException, java.net.SocketException;
- method public static void setSocketTimeValueOption(java.io.FileDescriptor, int, int, long) throws android.system.ErrnoException;
+ method public static java.net.SocketAddress makePacketSocketAddress(int, @NonNull byte[]);
+ method public static void setSocketTimeValueOption(@NonNull java.io.FileDescriptor, int, int, long) throws android.system.ErrnoException;
}
}
@@ -4100,7 +4096,7 @@
method public final void putInt64Array(long, long[]);
method public final void putInt8(long, byte);
method public final void putInt8Array(long, byte[]);
- method public final void putNativeHandle(long, android.os.NativeHandle);
+ method public final void putNativeHandle(long, @Nullable android.os.NativeHandle);
method public final void putString(long, String);
method public static Boolean[] wrapArray(@NonNull boolean[]);
method public static Long[] wrapArray(@NonNull long[]);
@@ -4120,7 +4116,7 @@
method public final double readDouble();
method public final java.util.ArrayList<java.lang.Double> readDoubleVector();
method public final android.os.HwBlob readEmbeddedBuffer(long, long, long, boolean);
- method public final android.os.NativeHandle readEmbeddedNativeHandle(long, long);
+ method @Nullable public final android.os.NativeHandle readEmbeddedNativeHandle(long, long);
method public final float readFloat();
method public final java.util.ArrayList<java.lang.Float> readFloatVector();
method public final short readInt16();
@@ -4131,8 +4127,8 @@
method public final java.util.ArrayList<java.lang.Long> readInt64Vector();
method public final byte readInt8();
method public final java.util.ArrayList<java.lang.Byte> readInt8Vector();
- method public final android.os.NativeHandle readNativeHandle();
- method public final java.util.ArrayList<android.os.NativeHandle> readNativeHandleVector();
+ method @Nullable public final android.os.NativeHandle readNativeHandle();
+ method @NonNull public final java.util.ArrayList<android.os.NativeHandle> readNativeHandleVector();
method public final String readString();
method public final java.util.ArrayList<java.lang.String> readStringVector();
method public final android.os.IHwBinder readStrongBinder();
@@ -4156,8 +4152,8 @@
method public final void writeInt8(byte);
method public final void writeInt8Vector(java.util.ArrayList<java.lang.Byte>);
method public final void writeInterfaceToken(String);
- method public final void writeNativeHandle(android.os.NativeHandle);
- method public final void writeNativeHandleVector(java.util.ArrayList<android.os.NativeHandle>);
+ method public final void writeNativeHandle(@Nullable android.os.NativeHandle);
+ method public final void writeNativeHandleVector(@NonNull java.util.ArrayList<android.os.NativeHandle>);
method public final void writeStatus(int);
method public final void writeString(String);
method public final void writeStringVector(java.util.ArrayList<java.lang.String>);
@@ -4207,10 +4203,10 @@
ctor public NativeHandle(@NonNull java.io.FileDescriptor, boolean);
ctor public NativeHandle(@NonNull java.io.FileDescriptor[], @NonNull int[], boolean);
method public void close() throws java.io.IOException;
- method public android.os.NativeHandle dup() throws java.io.IOException;
- method public java.io.FileDescriptor getFileDescriptor();
- method public java.io.FileDescriptor[] getFileDescriptors();
- method public int[] getInts();
+ method @NonNull public android.os.NativeHandle dup() throws java.io.IOException;
+ method @NonNull public java.io.FileDescriptor getFileDescriptor();
+ method @NonNull public java.io.FileDescriptor[] getFileDescriptors();
+ method @NonNull public int[] getInts();
method public boolean hasSingleFileDescriptor();
}
@@ -4655,6 +4651,7 @@
field public static final String CARRIER_APP_WHITELIST = "carrier_app_whitelist";
field public static final String DATA_STALL_CONSECUTIVE_DNS_TIMEOUT_THRESHOLD = "data_stall_consecutive_dns_timeout_threshold";
field public static final String DATA_STALL_EVALUATION_TYPE = "data_stall_evaluation_type";
+ field public static final int DATA_STALL_EVALUATION_TYPE_DNS = 1; // 0x1
field public static final String DATA_STALL_MIN_EVALUATE_INTERVAL = "data_stall_min_evaluate_interval";
field public static final String DATA_STALL_VALID_DNS_TIME_THRESHOLD = "data_stall_valid_dns_time_threshold";
field public static final String DEFAULT_SM_DP_PLUS = "default_sm_dp_plus";
@@ -4863,8 +4860,8 @@
public abstract class ApnService extends android.app.Service {
ctor public ApnService();
- method public android.os.IBinder onBind(android.content.Intent);
- method @WorkerThread public abstract java.util.List<android.content.ContentValues> onRestoreApns(int);
+ method @NonNull public android.os.IBinder onBind(@Nullable android.content.Intent);
+ method @WorkerThread @NonNull public abstract java.util.List<android.content.ContentValues> onRestoreApns(int);
}
}
@@ -4947,12 +4944,15 @@
method public abstract void onStartOtaIfNecessary(int, android.service.euicc.EuiccService.OtaStatusChangedCallback);
method public abstract int onSwitchToSubscription(int, @Nullable String, boolean);
method public abstract int onUpdateSubscriptionNickname(int, String, String);
+ field public static final String ACTION_DELETE_SUBSCRIPTION_PRIVILEGED = "android.service.euicc.action.DELETE_SUBSCRIPTION_PRIVILEGED";
field public static final String ACTION_MANAGE_EMBEDDED_SUBSCRIPTIONS = "android.service.euicc.action.MANAGE_EMBEDDED_SUBSCRIPTIONS";
field public static final String ACTION_PROVISION_EMBEDDED_SUBSCRIPTION = "android.service.euicc.action.PROVISION_EMBEDDED_SUBSCRIPTION";
+ field public static final String ACTION_RENAME_SUBSCRIPTION_PRIVILEGED = "android.service.euicc.action.RENAME_SUBSCRIPTION_PRIVILEGED";
field @Deprecated public static final String ACTION_RESOLVE_CONFIRMATION_CODE = "android.service.euicc.action.RESOLVE_CONFIRMATION_CODE";
field public static final String ACTION_RESOLVE_DEACTIVATE_SIM = "android.service.euicc.action.RESOLVE_DEACTIVATE_SIM";
field public static final String ACTION_RESOLVE_NO_PRIVILEGES = "android.service.euicc.action.RESOLVE_NO_PRIVILEGES";
field public static final String ACTION_RESOLVE_RESOLVABLE_ERRORS = "android.service.euicc.action.RESOLVE_RESOLVABLE_ERRORS";
+ field public static final String ACTION_TOGGLE_SUBSCRIPTION_PRIVILEGED = "android.service.euicc.action.TOGGLE_SUBSCRIPTION_PRIVILEGED";
field public static final String CATEGORY_EUICC_UI = "android.service.euicc.category.EUICC_UI";
field public static final String EUICC_SERVICE_INTERFACE = "android.service.euicc.EuiccService";
field public static final String EXTRA_RESOLUTION_ALLOW_POLICY_RULES = "android.service.euicc.extra.RESOLUTION_ALLOW_POLICY_RULES";
@@ -5409,10 +5409,6 @@
field public static final int CAPABILITY_MULTI_USER = 32; // 0x20
}
- public final class PhoneAccountSuggestion implements android.os.Parcelable {
- ctor public PhoneAccountSuggestion(android.telecom.PhoneAccountHandle, int, boolean);
- }
-
public class PhoneAccountSuggestionService extends android.app.Service {
ctor public PhoneAccountSuggestionService();
method public void onAccountSuggestionRequest(@NonNull String);
@@ -5488,8 +5484,8 @@
method @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public java.util.List<android.telecom.PhoneAccountHandle> getPhoneAccountsSupportingScheme(String);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean isInEmergencyCall();
method @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public boolean isRinging();
- method @Deprecated @RequiresPermission(allOf={android.Manifest.permission.MODIFY_PHONE_STATE, android.Manifest.permission.WRITE_SECURE_SETTINGS}) public boolean setDefaultDialer(String);
- method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setUserSelectedOutgoingPhoneAccount(android.telecom.PhoneAccountHandle);
+ method @Deprecated @RequiresPermission(allOf={android.Manifest.permission.MODIFY_PHONE_STATE, android.Manifest.permission.WRITE_SECURE_SETTINGS}) public boolean setDefaultDialer(@Nullable String);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setUserSelectedOutgoingPhoneAccount(@Nullable android.telecom.PhoneAccountHandle);
field public static final String EXTRA_CALL_BACK_INTENT = "android.telecom.extra.CALL_BACK_INTENT";
field public static final String EXTRA_CLEAR_MISSED_CALLS_INTENT = "android.telecom.extra.CLEAR_MISSED_CALLS_INTENT";
field public static final String EXTRA_CONNECTION_SERVICE = "android.telecom.extra.CONNECTION_SERVICE";
@@ -5509,12 +5505,12 @@
field public static final int WWAN = 1; // 0x1
}
- public class CallAttributes implements android.os.Parcelable {
- ctor public CallAttributes(android.telephony.PreciseCallState, int, android.telephony.CallQuality);
+ public final class CallAttributes implements android.os.Parcelable {
+ ctor public CallAttributes(@NonNull android.telephony.PreciseCallState, int, @NonNull android.telephony.CallQuality);
method public int describeContents();
- method public android.telephony.CallQuality getCallQuality();
+ method @NonNull public android.telephony.CallQuality getCallQuality();
method public int getNetworkType();
- method public android.telephony.PreciseCallState getPreciseCallState();
+ method @NonNull public android.telephony.PreciseCallState getPreciseCallState();
method public void writeToParcel(android.os.Parcel, int);
field public static final android.os.Parcelable.Creator<android.telephony.CallAttributes> CREATOR;
}
@@ -5551,13 +5547,13 @@
}
public final class CarrierRestrictionRules implements android.os.Parcelable {
+ method @NonNull public java.util.List<java.lang.Boolean> areCarrierIdentifiersAllowed(@NonNull java.util.List<android.service.carrier.CarrierIdentifier>);
method public int describeContents();
method @NonNull public java.util.List<android.service.carrier.CarrierIdentifier> getAllowedCarriers();
method public int getDefaultCarrierRestriction();
method @NonNull public java.util.List<android.service.carrier.CarrierIdentifier> getExcludedCarriers();
method public int getMultiSimPolicy();
method public boolean isAllCarriersAllowed();
- method public java.util.List<java.lang.Boolean> isCarrierIdentifiersAllowed(@NonNull java.util.List<android.service.carrier.CarrierIdentifier>);
method public void writeToParcel(android.os.Parcel, int);
field public static final int CARRIER_RESTRICTION_DEFAULT_ALLOWED = 1; // 0x1
field public static final int CARRIER_RESTRICTION_DEFAULT_NOT_ALLOWED = 0; // 0x0
@@ -5566,13 +5562,13 @@
field public static final int MULTISIM_POLICY_ONE_VALID_SIM_MUST_BE_PRESENT = 1; // 0x1
}
- public static class CarrierRestrictionRules.Builder {
- method public android.telephony.CarrierRestrictionRules build();
- method public android.telephony.CarrierRestrictionRules.Builder setAllCarriersAllowed();
- method public android.telephony.CarrierRestrictionRules.Builder setAllowedCarriers(java.util.List<android.service.carrier.CarrierIdentifier>);
- method public android.telephony.CarrierRestrictionRules.Builder setDefaultCarrierRestriction(int);
- method public android.telephony.CarrierRestrictionRules.Builder setExcludedCarriers(java.util.List<android.service.carrier.CarrierIdentifier>);
- method public android.telephony.CarrierRestrictionRules.Builder setMultiSimPolicy(int);
+ public static final class CarrierRestrictionRules.Builder {
+ method @NonNull public android.telephony.CarrierRestrictionRules build();
+ method @NonNull public android.telephony.CarrierRestrictionRules.Builder setAllCarriersAllowed();
+ method @NonNull public android.telephony.CarrierRestrictionRules.Builder setAllowedCarriers(@NonNull java.util.List<android.service.carrier.CarrierIdentifier>);
+ method @NonNull public android.telephony.CarrierRestrictionRules.Builder setDefaultCarrierRestriction(int);
+ method @NonNull public android.telephony.CarrierRestrictionRules.Builder setExcludedCarriers(@NonNull java.util.List<android.service.carrier.CarrierIdentifier>);
+ method @NonNull public android.telephony.CarrierRestrictionRules.Builder setMultiSimPolicy(int);
}
public final class DataFailCause {
@@ -6027,12 +6023,11 @@
}
public class NetworkRegistrationState implements android.os.Parcelable {
- ctor public NetworkRegistrationState(int, int, int, int, int, boolean, int[], @Nullable android.telephony.CellIdentity);
- ctor protected NetworkRegistrationState(android.os.Parcel);
+ ctor public NetworkRegistrationState(int, int, int, int, int, boolean, @NonNull int[], @Nullable android.telephony.CellIdentity);
method public int describeContents();
method public int getAccessNetworkTechnology();
- method public int[] getAvailableServices();
- method public android.telephony.CellIdentity getCellIdentity();
+ method @NonNull public int[] getAvailableServices();
+ method @Nullable public android.telephony.CellIdentity getCellIdentity();
method @Nullable public android.telephony.DataSpecificRegistrationStates getDataSpecificStates();
method public int getDomain();
method public int getRegState();
@@ -6058,22 +6053,38 @@
field public static final int SERVICE_TYPE_VOICE = 1; // 0x1
}
+ public static class NetworkRegistrationState.Builder {
+ ctor public NetworkRegistrationState.Builder();
+ method @NonNull public android.telephony.NetworkRegistrationState build();
+ method @NonNull public android.telephony.NetworkRegistrationState.Builder setAccessNetworkTechnology(int);
+ method @NonNull public android.telephony.NetworkRegistrationState.Builder setAvailableServices(@NonNull int[]);
+ method @NonNull public android.telephony.NetworkRegistrationState.Builder setCellIdentity(@Nullable android.telephony.CellIdentity);
+ method @NonNull public android.telephony.NetworkRegistrationState.Builder setDomain(int);
+ method @NonNull public android.telephony.NetworkRegistrationState.Builder setEmergencyOnly(boolean);
+ method @NonNull public android.telephony.NetworkRegistrationState.Builder setNrStatus(int);
+ method @NonNull public android.telephony.NetworkRegistrationState.Builder setRegState(int);
+ method @NonNull public android.telephony.NetworkRegistrationState.Builder setRejectCause(int);
+ method @NonNull public android.telephony.NetworkRegistrationState.Builder setRoamingType(int);
+ method @NonNull public android.telephony.NetworkRegistrationState.Builder setTransportType(int);
+ }
+
public abstract class NetworkService extends android.app.Service {
ctor public NetworkService();
- method protected abstract android.telephony.NetworkService.NetworkServiceProvider createNetworkServiceProvider(int);
+ method public android.os.IBinder onBind(android.content.Intent);
+ method @Nullable public abstract android.telephony.NetworkService.NetworkServiceProvider onCreateNetworkServiceProvider(int);
field public static final String NETWORK_SERVICE_INTERFACE = "android.telephony.NetworkService";
}
public abstract class NetworkService.NetworkServiceProvider implements java.lang.AutoCloseable {
ctor public NetworkService.NetworkServiceProvider(int);
method public abstract void close();
- method public void getNetworkRegistrationState(int, android.telephony.NetworkServiceCallback);
- method public final int getSlotId();
+ method public void getNetworkRegistrationState(int, @NonNull android.telephony.NetworkServiceCallback);
+ method public final int getSlotIndex();
method public final void notifyNetworkRegistrationStateChanged();
}
public class NetworkServiceCallback {
- method public void onGetNetworkRegistrationStateComplete(int, android.telephony.NetworkRegistrationState);
+ method public void onGetNetworkRegistrationStateComplete(int, @Nullable android.telephony.NetworkRegistrationState);
field public static final int RESULT_ERROR_BUSY = 3; // 0x3
field public static final int RESULT_ERROR_FAILED = 5; // 0x5
field public static final int RESULT_ERROR_ILLEGAL_STATE = 4; // 0x4
@@ -6097,7 +6108,7 @@
public final class PhoneNumberRange implements android.os.Parcelable {
ctor public PhoneNumberRange(@NonNull String, @NonNull String, @NonNull String, @NonNull String);
method public int describeContents();
- method public boolean matches(String);
+ method public boolean matches(@NonNull String);
method public void writeToParcel(android.os.Parcel, int);
field public static final android.os.Parcelable.Creator<android.telephony.PhoneNumberRange> CREATOR;
}
@@ -6107,7 +6118,7 @@
method @RequiresPermission("android.permission.READ_PRECISE_PHONE_STATE") public void onCallDisconnectCauseChanged(int, int);
method @RequiresPermission("android.permission.READ_PRECISE_PHONE_STATE") public void onImsCallDisconnectCauseChanged(@NonNull android.telephony.ims.ImsReasonInfo);
method @RequiresPermission("android.permission.READ_PRECISE_PHONE_STATE") public void onPreciseCallStateChanged(@NonNull android.telephony.PreciseCallState);
- method @RequiresPermission("android.permission.READ_PRECISE_PHONE_STATE") public void onPreciseDataConnectionStateChanged(android.telephony.PreciseDataConnectionState);
+ method @RequiresPermission("android.permission.READ_PRECISE_PHONE_STATE") public void onPreciseDataConnectionStateChanged(@NonNull android.telephony.PreciseDataConnectionState);
method public void onRadioPowerStateChanged(int);
method public void onSrvccStateChanged(int);
method public void onVoiceActivationStateChanged(int);
@@ -6142,7 +6153,7 @@
public final class PreciseDataConnectionState implements android.os.Parcelable {
method public int describeContents();
- method public String getDataConnectionApn();
+ method @Nullable public String getDataConnectionApn();
method public int getDataConnectionApnTypeBitMask();
method public int getDataConnectionFailCause();
method public int getDataConnectionState();
@@ -6248,12 +6259,12 @@
}
public class ServiceState implements android.os.Parcelable {
- method public android.telephony.NetworkRegistrationState getNetworkRegistrationState(int, int);
- method public java.util.List<android.telephony.NetworkRegistrationState> getNetworkRegistrationStates();
- method @Deprecated public java.util.List<android.telephony.NetworkRegistrationState> getNetworkRegistrationStates(int);
- method @Deprecated public android.telephony.NetworkRegistrationState getNetworkRegistrationStates(int, int);
- method public java.util.List<android.telephony.NetworkRegistrationState> getNetworkRegistrationStatesForDomain(int);
- method public java.util.List<android.telephony.NetworkRegistrationState> getNetworkRegistrationStatesForTransportType(int);
+ method @Nullable public android.telephony.NetworkRegistrationState getNetworkRegistrationState(int, int);
+ method @NonNull public java.util.List<android.telephony.NetworkRegistrationState> getNetworkRegistrationStates();
+ method @Deprecated @NonNull public java.util.List<android.telephony.NetworkRegistrationState> getNetworkRegistrationStates(int);
+ method @Deprecated @Nullable public android.telephony.NetworkRegistrationState getNetworkRegistrationStates(int, int);
+ method @NonNull public java.util.List<android.telephony.NetworkRegistrationState> getNetworkRegistrationStatesForDomain(int);
+ method @NonNull public java.util.List<android.telephony.NetworkRegistrationState> getNetworkRegistrationStatesForTransportType(int);
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
@@ -6295,18 +6306,19 @@
method public void requestEmbeddedSubscriptionInfoListRefresh(int);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setDefaultDataSubId(int);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setDefaultSmsSubId(int);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setPreferredDataSubscriptionId(int, boolean, @NonNull java.util.concurrent.Executor, java.util.function.Consumer<java.lang.Integer>);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean setSubscriptionEnabled(int, boolean);
- field public static final android.net.Uri ADVANCED_CALLING_ENABLED_CONTENT_URI;
+ field @NonNull public static final android.net.Uri ADVANCED_CALLING_ENABLED_CONTENT_URI;
field public static final int PROFILE_CLASS_DEFAULT = -1; // 0xffffffff
field public static final int PROFILE_CLASS_OPERATIONAL = 2; // 0x2
field public static final int PROFILE_CLASS_PROVISIONING = 1; // 0x1
field public static final int PROFILE_CLASS_TESTING = 0; // 0x0
field public static final int PROFILE_CLASS_UNSET = -1; // 0xffffffff
- field public static final android.net.Uri VT_ENABLED_CONTENT_URI;
- field public static final android.net.Uri WFC_ENABLED_CONTENT_URI;
- field public static final android.net.Uri WFC_MODE_CONTENT_URI;
- field public static final android.net.Uri WFC_ROAMING_ENABLED_CONTENT_URI;
- field public static final android.net.Uri WFC_ROAMING_MODE_CONTENT_URI;
+ field @NonNull public static final android.net.Uri VT_ENABLED_CONTENT_URI;
+ field @NonNull public static final android.net.Uri WFC_ENABLED_CONTENT_URI;
+ field @NonNull public static final android.net.Uri WFC_MODE_CONTENT_URI;
+ field @NonNull public static final android.net.Uri WFC_ROAMING_ENABLED_CONTENT_URI;
+ field @NonNull public static final android.net.Uri WFC_ROAMING_MODE_CONTENT_URI;
}
public static class SubscriptionPlan.Builder {
@@ -6344,7 +6356,7 @@
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean enableDataConnectivity();
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean enableModemForSlot(int, boolean);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void enableVideoCalling(boolean);
- method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public String getAidForAppType(int);
+ method @Nullable @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public String getAidForAppType(int);
method @Deprecated @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public java.util.List<android.service.carrier.CarrierIdentifier> getAllowedCarriers(int);
method public java.util.List<java.lang.String> getCarrierPackageNamesForIntent(android.content.Intent);
method public java.util.List<java.lang.String> getCarrierPackageNamesForIntentAndPhone(android.content.Intent, int);
@@ -6360,9 +6372,10 @@
method @Deprecated public boolean getDataEnabled();
method @Deprecated public boolean getDataEnabled(int);
method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean getEmergencyCallbackMode();
- method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public String getIsimDomain();
- method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public String getIsimIst();
+ method @Nullable @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public String getIsimDomain();
+ method @Nullable @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public String getIsimIst();
method @NonNull @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public java.util.List<android.util.Pair<java.lang.Integer,java.lang.Integer>> getLogicalToPhysicalSlotMapping();
+ method public static long getMaxNumberVerificationTimeoutMillis();
method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public long getPreferredNetworkTypeBitmap();
method @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public int getRadioPowerState();
method public int getSimApplicationState();
@@ -6423,7 +6436,6 @@
field public static final String EXTRA_SIM_STATE = "android.telephony.extra.SIM_STATE";
field public static final String EXTRA_VISUAL_VOICEMAIL_ENABLED_BY_USER_BOOL = "android.telephony.extra.VISUAL_VOICEMAIL_ENABLED_BY_USER_BOOL";
field public static final String EXTRA_VOICEMAIL_SCRAMBLED_PIN_STRING = "android.telephony.extra.VOICEMAIL_SCRAMBLED_PIN_STRING";
- field public static final long MAX_NUMBER_VERIFICATION_TIMEOUT_MILLIS = 60000L; // 0xea60L
field public static final long NETWORK_TYPE_BITMASK_1xRTT = 64L; // 0x40L
field public static final long NETWORK_TYPE_BITMASK_CDMA = 8L; // 0x8L
field public static final long NETWORK_TYPE_BITMASK_EDGE = 2L; // 0x2L
@@ -6504,7 +6516,6 @@
public final class DataCallResponse implements android.os.Parcelable {
ctor public DataCallResponse(int, int, int, int, int, @Nullable String, @Nullable java.util.List<android.net.LinkAddress>, @Nullable java.util.List<java.net.InetAddress>, @Nullable java.util.List<java.net.InetAddress>, @Nullable java.util.List<java.lang.String>, int);
- ctor public DataCallResponse(android.os.Parcel);
method public int describeContents();
method public int getActive();
method @NonNull public java.util.List<android.net.LinkAddress> getAddresses();
@@ -6546,7 +6557,8 @@
public abstract class DataService extends android.app.Service {
ctor public DataService();
- method public abstract android.telephony.data.DataService.DataServiceProvider createDataServiceProvider(int);
+ method public android.os.IBinder onBind(android.content.Intent);
+ method @Nullable public abstract android.telephony.data.DataService.DataServiceProvider onCreateDataServiceProvider(int);
field public static final String DATA_SERVICE_INTERFACE = "android.telephony.data.DataService";
field public static final int REQUEST_REASON_HANDOVER = 3; // 0x3
field public static final int REQUEST_REASON_NORMAL = 1; // 0x1
@@ -6558,20 +6570,20 @@
method public abstract void close();
method public void deactivateDataCall(int, int, @Nullable android.telephony.data.DataServiceCallback);
method public void getDataCallList(@NonNull android.telephony.data.DataServiceCallback);
- method public final int getSlotId();
+ method public final int getSlotIndex();
method public final void notifyDataCallListChanged(java.util.List<android.telephony.data.DataCallResponse>);
- method public void setDataProfile(java.util.List<android.telephony.data.DataProfile>, boolean, @Nullable android.telephony.data.DataServiceCallback);
- method public void setInitialAttachApn(android.telephony.data.DataProfile, boolean, @Nullable android.telephony.data.DataServiceCallback);
- method public void setupDataCall(int, android.telephony.data.DataProfile, boolean, boolean, int, @Nullable android.net.LinkProperties, @Nullable android.telephony.data.DataServiceCallback);
+ method public void setDataProfile(@NonNull java.util.List<android.telephony.data.DataProfile>, boolean, @Nullable android.telephony.data.DataServiceCallback);
+ method public void setInitialAttachApn(@NonNull android.telephony.data.DataProfile, boolean, @Nullable android.telephony.data.DataServiceCallback);
+ method public void setupDataCall(int, @NonNull android.telephony.data.DataProfile, boolean, boolean, int, @Nullable android.net.LinkProperties, @Nullable android.telephony.data.DataServiceCallback);
}
public class DataServiceCallback {
- method public void onDataCallListChanged(java.util.List<android.telephony.data.DataCallResponse>);
+ method public void onDataCallListChanged(@NonNull java.util.List<android.telephony.data.DataCallResponse>);
method public void onDeactivateDataCallComplete(int);
- method public void onGetDataCallListComplete(int, java.util.List<android.telephony.data.DataCallResponse>);
+ method public void onGetDataCallListComplete(int, @NonNull java.util.List<android.telephony.data.DataCallResponse>);
method public void onSetDataProfileComplete(int);
method public void onSetInitialAttachApnComplete(int);
- method public void onSetupDataCallComplete(int, android.telephony.data.DataCallResponse);
+ method public void onSetupDataCallComplete(int, @Nullable android.telephony.data.DataCallResponse);
field public static final int RESULT_ERROR_BUSY = 3; // 0x3
field public static final int RESULT_ERROR_ILLEGAL_STATE = 4; // 0x4
field public static final int RESULT_ERROR_INVALID_ARG = 2; // 0x2
@@ -6581,7 +6593,7 @@
public abstract class QualifiedNetworksService extends android.app.Service {
ctor public QualifiedNetworksService();
- method public abstract android.telephony.data.QualifiedNetworksService.NetworkAvailabilityUpdater createNetworkAvailabilityUpdater(int);
+ method @NonNull public abstract android.telephony.data.QualifiedNetworksService.NetworkAvailabilityUpdater createNetworkAvailabilityUpdater(int);
field public static final String QUALIFIED_NETWORKS_SERVICE_INTERFACE = "android.telephony.data.QualifiedNetworksService";
}
@@ -6589,7 +6601,7 @@
ctor public QualifiedNetworksService.NetworkAvailabilityUpdater(int);
method public abstract void close();
method public final int getSlotIndex();
- method public final void updateQualifiedNetworkTypes(int, int[]);
+ method public final void updateQualifiedNetworkTypes(int, @Nullable int[]);
}
}
@@ -6663,14 +6675,20 @@
method @RequiresPermission(android.Manifest.permission.WRITE_EMBEDDED_SUBSCRIPTIONS) public void getDefaultDownloadableSubscriptionList(android.app.PendingIntent);
method @RequiresPermission(android.Manifest.permission.WRITE_EMBEDDED_SUBSCRIPTIONS) public void getDownloadableSubscriptionMetadata(android.telephony.euicc.DownloadableSubscription, android.app.PendingIntent);
method @RequiresPermission(android.Manifest.permission.WRITE_EMBEDDED_SUBSCRIPTIONS) public int getOtaStatus();
+ field public static final String ACTION_DELETE_SUBSCRIPTION_PRIVILEGED = "android.telephony.euicc.action.DELETE_SUBSCRIPTION_PRIVILEGED";
field @RequiresPermission(android.Manifest.permission.WRITE_EMBEDDED_SUBSCRIPTIONS) public static final String ACTION_OTA_STATUS_CHANGED = "android.telephony.euicc.action.OTA_STATUS_CHANGED";
field public static final String ACTION_PROVISION_EMBEDDED_SUBSCRIPTION = "android.telephony.euicc.action.PROVISION_EMBEDDED_SUBSCRIPTION";
+ field public static final String ACTION_RENAME_SUBSCRIPTION_PRIVILEGED = "android.telephony.euicc.action.RENAME_SUBSCRIPTION_PRIVILEGED";
+ field public static final String ACTION_TOGGLE_SUBSCRIPTION_PRIVILEGED = "android.telephony.euicc.action.TOGGLE_SUBSCRIPTION_PRIVILEGED";
field public static final int EUICC_OTA_FAILED = 2; // 0x2
field public static final int EUICC_OTA_IN_PROGRESS = 1; // 0x1
field public static final int EUICC_OTA_NOT_NEEDED = 4; // 0x4
field public static final int EUICC_OTA_STATUS_UNAVAILABLE = 5; // 0x5
field public static final int EUICC_OTA_SUCCEEDED = 3; // 0x3
field public static final String EXTRA_EMBEDDED_SUBSCRIPTION_DOWNLOADABLE_SUBSCRIPTIONS = "android.telephony.euicc.extra.EMBEDDED_SUBSCRIPTION_DOWNLOADABLE_SUBSCRIPTIONS";
+ field public static final String EXTRA_ENABLE_SUBSCRIPTION = "android.telephony.euicc.extra.ENABLE_SUBSCRIPTION";
+ field public static final String EXTRA_SUBSCRIPTION_ID = "android.telephony.euicc.extra.SUBSCRIPTION_ID";
+ field public static final String EXTRA_SUBSCRIPTION_NICKNAME = "android.telephony.euicc.extra.SUBSCRIPTION_NICKNAME";
}
@IntDef(prefix={"EUICC_OTA_"}, value={android.telephony.euicc.EuiccManager.EUICC_OTA_IN_PROGRESS, android.telephony.euicc.EuiccManager.EUICC_OTA_FAILED, android.telephony.euicc.EuiccManager.EUICC_OTA_SUCCEEDED, android.telephony.euicc.EuiccManager.EUICC_OTA_NOT_NEEDED, android.telephony.euicc.EuiccManager.EUICC_OTA_STATUS_UNAVAILABLE}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface EuiccManager.OtaStatus {
@@ -6825,7 +6843,7 @@
}
public class ImsCallSessionListener {
- method public void callQualityChanged(android.telephony.CallQuality);
+ method public void callQualityChanged(@NonNull android.telephony.CallQuality);
method public void callSessionConferenceExtendFailed(android.telephony.ims.ImsReasonInfo);
method public void callSessionConferenceExtendReceived(android.telephony.ims.stub.ImsCallSessionImplBase, android.telephony.ims.ImsCallProfile);
method public void callSessionConferenceExtended(android.telephony.ims.stub.ImsCallSessionImplBase, android.telephony.ims.ImsCallProfile);
@@ -6850,7 +6868,7 @@
method public void callSessionResumeFailed(android.telephony.ims.ImsReasonInfo);
method public void callSessionResumeReceived(android.telephony.ims.ImsCallProfile);
method public void callSessionResumed(android.telephony.ims.ImsCallProfile);
- method public void callSessionRttAudioIndicatorChanged(android.telephony.ims.ImsStreamMediaProfile);
+ method public void callSessionRttAudioIndicatorChanged(@NonNull android.telephony.ims.ImsStreamMediaProfile);
method public void callSessionRttMessageReceived(String);
method public void callSessionRttModifyRequestReceived(android.telephony.ims.ImsCallProfile);
method public void callSessionRttModifyResponseReceived(int);
@@ -6891,7 +6909,7 @@
public class ImsException extends java.lang.Exception {
ctor public ImsException(@Nullable String);
ctor public ImsException(@Nullable String, int);
- ctor public ImsException(@Nullable String, int, Throwable);
+ ctor public ImsException(@Nullable String, int, @Nullable Throwable);
method public int getCode();
field public static final int CODE_ERROR_SERVICE_UNAVAILABLE = 1; // 0x1
field public static final int CODE_ERROR_UNSPECIFIED = 0; // 0x0
@@ -6899,13 +6917,13 @@
}
public final class ImsExternalCallState implements android.os.Parcelable {
- ctor public ImsExternalCallState(String, android.net.Uri, android.net.Uri, boolean, int, int, boolean);
+ ctor public ImsExternalCallState(@NonNull String, @NonNull android.net.Uri, @Nullable android.net.Uri, boolean, int, int, boolean);
method public int describeContents();
- method public android.net.Uri getAddress();
+ method @NonNull public android.net.Uri getAddress();
method public int getCallId();
method public int getCallState();
method public int getCallType();
- method public android.net.Uri getLocalAddress();
+ method @Nullable public android.net.Uri getLocalAddress();
method public boolean isCallHeld();
method public boolean isCallPullable();
method public void writeToParcel(android.os.Parcel, int);
@@ -6915,7 +6933,7 @@
}
public class ImsMmTelManager {
- method public static android.telephony.ims.ImsMmTelManager createForSubscriptionId(int);
+ method @NonNull public static android.telephony.ims.ImsMmTelManager createForSubscriptionId(int);
method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getVoWiFiModeSetting();
method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getVoWiFiRoamingModeSetting();
method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isAdvancedCallingSettingEnabled();
@@ -6924,16 +6942,16 @@
method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isVoWiFiRoamingSettingEnabled();
method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isVoWiFiSettingEnabled();
method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isVtSettingEnabled();
- method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void registerImsRegistrationCallback(java.util.concurrent.Executor, @NonNull android.telephony.ims.ImsMmTelManager.RegistrationCallback) throws android.telephony.ims.ImsException;
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void registerImsRegistrationCallback(@NonNull java.util.concurrent.Executor, @NonNull android.telephony.ims.ImsMmTelManager.RegistrationCallback) throws android.telephony.ims.ImsException;
method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void registerMmTelCapabilityCallback(@NonNull java.util.concurrent.Executor, @NonNull android.telephony.ims.ImsMmTelManager.CapabilityCallback) throws android.telephony.ims.ImsException;
- method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setAdvancedCallingSetting(boolean);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setAdvancedCallingSettingEnabled(boolean);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setRttCapabilitySetting(boolean);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setVoWiFiModeSetting(int);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setVoWiFiNonPersistent(boolean, int);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setVoWiFiRoamingModeSetting(int);
- method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setVoWiFiRoamingSetting(boolean);
- method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setVoWiFiSetting(boolean);
- method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setVtSetting(boolean);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setVoWiFiRoamingSettingEnabled(boolean);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setVoWiFiSettingEnabled(boolean);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setVtSettingEnabled(boolean);
method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void unregisterImsRegistrationCallback(@NonNull android.telephony.ims.ImsMmTelManager.RegistrationCallback);
method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void unregisterMmTelCapabilityCallback(@NonNull android.telephony.ims.ImsMmTelManager.CapabilityCallback);
field public static final int WIFI_MODE_CELLULAR_PREFERRED = 1; // 0x1
@@ -6943,15 +6961,15 @@
public static class ImsMmTelManager.CapabilityCallback {
ctor public ImsMmTelManager.CapabilityCallback();
- method public void onCapabilitiesStatusChanged(android.telephony.ims.feature.MmTelFeature.MmTelCapabilities);
+ method public void onCapabilitiesStatusChanged(@NonNull android.telephony.ims.feature.MmTelFeature.MmTelCapabilities);
}
public static class ImsMmTelManager.RegistrationCallback {
ctor public ImsMmTelManager.RegistrationCallback();
- method public void onDeregistered(android.telephony.ims.ImsReasonInfo);
method public void onRegistered(int);
method public void onRegistering(int);
- method public void onTechnologyChangeFailed(int, android.telephony.ims.ImsReasonInfo);
+ method public void onTechnologyChangeFailed(int, @Nullable android.telephony.ims.ImsReasonInfo);
+ method public void onUnregistered(@Nullable android.telephony.ims.ImsReasonInfo);
}
public final class ImsReasonInfo implements android.os.Parcelable {
@@ -7154,12 +7172,12 @@
public final class ImsSsData implements android.os.Parcelable {
ctor public ImsSsData(int, int, int, int, int);
method public int describeContents();
- method public android.telephony.ims.ImsCallForwardInfo[] getCallForwardInfo();
+ method @Nullable public java.util.List<android.telephony.ims.ImsCallForwardInfo> getCallForwardInfo();
method public int getRequestType();
method public int getResult();
method public int getServiceClass();
method public int getServiceType();
- method @NonNull public android.telephony.ims.ImsSsInfo[] getSuppServiceInfo();
+ method @NonNull public java.util.List<android.telephony.ims.ImsSsInfo> getSuppServiceInfo();
method public int getTeleserviceType();
method public boolean isTypeBarring();
method public boolean isTypeCf();
@@ -7219,11 +7237,11 @@
field public static final int SS_WAIT = 12; // 0xc
}
- public static class ImsSsData.Builder {
+ public static final class ImsSsData.Builder {
ctor public ImsSsData.Builder(int, int, int, int, int);
method @NonNull public android.telephony.ims.ImsSsData build();
- method @NonNull public android.telephony.ims.ImsSsData.Builder setCallForwardingInfo(@NonNull android.telephony.ims.ImsCallForwardInfo[]);
- method @NonNull public android.telephony.ims.ImsSsData.Builder setSuppServiceInfo(@NonNull android.telephony.ims.ImsSsInfo[]);
+ method @NonNull public android.telephony.ims.ImsSsData.Builder setCallForwardingInfo(@NonNull java.util.List<android.telephony.ims.ImsCallForwardInfo>);
+ method @NonNull public android.telephony.ims.ImsSsData.Builder setSuppServiceInfo(@NonNull java.util.List<android.telephony.ims.ImsSsInfo>);
}
public final class ImsSsInfo implements android.os.Parcelable {
@@ -7232,7 +7250,7 @@
method public int getClirInterrogationStatus();
method public int getClirOutgoingState();
method @Deprecated public String getIcbNum();
- method public String getIncomingCommunicationBarringNumber();
+ method @Nullable public String getIncomingCommunicationBarringNumber();
method public int getProvisionStatus();
method public int getStatus();
method public void writeToParcel(android.os.Parcel, int);
@@ -7253,7 +7271,7 @@
field public static final int SERVICE_PROVISIONING_UNKNOWN = -1; // 0xffffffff
}
- public static class ImsSsInfo.Builder {
+ public static final class ImsSsInfo.Builder {
ctor public ImsSsInfo.Builder(int);
method @NonNull public android.telephony.ims.ImsSsInfo build();
method @NonNull public android.telephony.ims.ImsSsInfo.Builder setClirInterrogationStatus(int);
@@ -7360,14 +7378,14 @@
}
public class ProvisioningManager {
- method public static android.telephony.ims.ProvisioningManager createForSubscriptionId(int);
+ method @NonNull public static android.telephony.ims.ProvisioningManager createForSubscriptionId(int);
method @WorkerThread @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getProvisioningIntValue(int);
- method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean getProvisioningStatusForCapability(@android.telephony.ims.feature.MmTelFeature.MmTelCapabilities.MmTelCapability int, int);
- method @WorkerThread @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public String getProvisioningStringValue(int);
- method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void registerProvisioningChangedCallback(java.util.concurrent.Executor, @NonNull android.telephony.ims.ProvisioningManager.Callback) throws android.telephony.ims.ImsException;
+ method @WorkerThread @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean getProvisioningStatusForCapability(@android.telephony.ims.feature.MmTelFeature.MmTelCapabilities.MmTelCapability int, int);
+ method @Nullable @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) @WorkerThread public String getProvisioningStringValue(int);
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void registerProvisioningChangedCallback(@NonNull java.util.concurrent.Executor, @NonNull android.telephony.ims.ProvisioningManager.Callback) throws android.telephony.ims.ImsException;
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) @WorkerThread public int setProvisioningIntValue(int, int);
- method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setProvisioningStatusForCapability(@android.telephony.ims.feature.MmTelFeature.MmTelCapabilities.MmTelCapability int, int, boolean);
- method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) @WorkerThread public int setProvisioningStringValue(int, String);
+ method @WorkerThread @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setProvisioningStatusForCapability(@android.telephony.ims.feature.MmTelFeature.MmTelCapabilities.MmTelCapability int, int, boolean);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) @WorkerThread public int setProvisioningStringValue(int, @NonNull String);
method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void unregisterProvisioningChangedCallback(@NonNull android.telephony.ims.ProvisioningManager.Callback);
field public static final int KEY_VOICE_OVER_WIFI_MODE_OVERRIDE = 27; // 0x1b
field public static final int KEY_VOICE_OVER_WIFI_ROAMING_ENABLED_OVERRIDE = 26; // 0x1a
@@ -7380,7 +7398,7 @@
public static class ProvisioningManager.Callback {
ctor public ProvisioningManager.Callback();
method public void onProvisioningIntChanged(int, int);
- method public void onProvisioningStringChanged(int, String);
+ method public void onProvisioningStringChanged(int, @NonNull String);
}
}
@@ -7701,12 +7719,12 @@
public class MbmsGroupCallServiceBase extends android.app.Service {
ctor public MbmsGroupCallServiceBase();
method public void dispose(int) throws android.os.RemoteException;
- method public int initialize(android.telephony.mbms.MbmsGroupCallSessionCallback, int) throws android.os.RemoteException;
+ method public int initialize(@NonNull android.telephony.mbms.MbmsGroupCallSessionCallback, int) throws android.os.RemoteException;
method public void onAppCallbackDied(int, int);
method public android.os.IBinder onBind(android.content.Intent);
- method public int startGroupCall(int, long, java.util.List<java.lang.Integer>, java.util.List<java.lang.Integer>, android.telephony.mbms.GroupCallCallback);
+ method public int startGroupCall(int, long, @NonNull java.util.List<java.lang.Integer>, @NonNull java.util.List<java.lang.Integer>, @NonNull android.telephony.mbms.GroupCallCallback);
method public void stopGroupCall(int, long);
- method public void updateGroupCall(int, long, java.util.List<java.lang.Integer>, java.util.List<java.lang.Integer>);
+ method public void updateGroupCall(int, long, @NonNull java.util.List<java.lang.Integer>, @NonNull java.util.List<java.lang.Integer>);
}
public class MbmsStreamingServiceBase extends android.os.Binder {
diff --git a/api/test-current.txt b/api/test-current.txt
index 400046b..0550663 100644
--- a/api/test-current.txt
+++ b/api/test-current.txt
@@ -626,8 +626,8 @@
public class LinkAddress implements android.os.Parcelable {
ctor public LinkAddress(java.net.InetAddress, int, int, int);
- ctor public LinkAddress(java.net.InetAddress, int);
- ctor public LinkAddress(String);
+ ctor public LinkAddress(@NonNull java.net.InetAddress, int);
+ ctor public LinkAddress(@NonNull String);
ctor public LinkAddress(String, int, int);
method public boolean isGlobalPreferred();
method public boolean isIPv4();
@@ -703,6 +703,21 @@
field public static final android.os.Parcelable.Creator<android.net.StaticIpConfiguration> CREATOR;
}
+ public final class TestNetworkInterface implements android.os.Parcelable {
+ ctor public TestNetworkInterface(android.os.ParcelFileDescriptor, String);
+ method public int describeContents();
+ method public android.os.ParcelFileDescriptor getFileDescriptor();
+ method public String getInterfaceName();
+ method public void writeToParcel(android.os.Parcel, int);
+ field public static final android.os.Parcelable.Creator<android.net.TestNetworkInterface> CREATOR;
+ }
+
+ public class TestNetworkManager {
+ method public android.net.TestNetworkInterface createTunInterface(@NonNull android.net.LinkAddress[]);
+ method public void setupTestNetwork(@NonNull String, @NonNull android.os.IBinder);
+ method public void teardownTestNetwork(@NonNull android.net.Network);
+ }
+
public class TrafficStats {
method public static long getLoopbackRxBytes();
method public static long getLoopbackRxPackets();
@@ -917,19 +932,16 @@
package android.net.util {
public class SocketUtils {
- method public static void addArpEntry(java.net.Inet4Address, android.net.MacAddress, String, java.io.FileDescriptor) throws java.io.IOException;
- method public static void attachControlPacketFilter(java.io.FileDescriptor, int) throws java.net.SocketException;
- method public static void attachDhcpFilter(java.io.FileDescriptor) throws java.net.SocketException;
- method public static void attachRaFilter(java.io.FileDescriptor, int) throws java.net.SocketException;
- method public static void bindSocket(java.io.FileDescriptor, java.net.SocketAddress) throws android.system.ErrnoException, java.net.SocketException;
- method public static void bindSocketToInterface(java.io.FileDescriptor, String) throws android.system.ErrnoException;
- method public static void closeSocket(java.io.FileDescriptor) throws java.io.IOException;
- method public static void connectSocket(java.io.FileDescriptor, java.net.SocketAddress) throws android.system.ErrnoException, java.net.SocketException;
+ method public static void addArpEntry(@NonNull java.net.Inet4Address, @NonNull android.net.MacAddress, @NonNull String, @NonNull java.io.FileDescriptor) throws java.io.IOException;
+ method public static void attachControlPacketFilter(@NonNull java.io.FileDescriptor, int) throws java.net.SocketException;
+ method public static void attachDhcpFilter(@NonNull java.io.FileDescriptor) throws java.net.SocketException;
+ method public static void attachRaFilter(@NonNull java.io.FileDescriptor, int) throws java.net.SocketException;
+ method public static void bindSocketToInterface(@NonNull java.io.FileDescriptor, @NonNull String) throws android.system.ErrnoException;
+ method public static void closeSocket(@Nullable java.io.FileDescriptor) throws java.io.IOException;
method public static java.net.SocketAddress makeNetlinkSocketAddress(int, int);
method public static java.net.SocketAddress makePacketSocketAddress(short, int);
- method public static java.net.SocketAddress makePacketSocketAddress(int, byte[]);
- method public static void sendTo(java.io.FileDescriptor, byte[], int, int, int, java.net.SocketAddress) throws android.system.ErrnoException, java.net.SocketException;
- method public static void setSocketTimeValueOption(java.io.FileDescriptor, int, int, long) throws android.system.ErrnoException;
+ method public static java.net.SocketAddress makePacketSocketAddress(int, @NonNull byte[]);
+ method public static void setSocketTimeValueOption(@NonNull java.io.FileDescriptor, int, int, long) throws android.system.ErrnoException;
}
}
@@ -995,7 +1007,7 @@
method public final void putInt64Array(long, long[]);
method public final void putInt8(long, byte);
method public final void putInt8Array(long, byte[]);
- method public final void putNativeHandle(long, android.os.NativeHandle);
+ method public final void putNativeHandle(long, @Nullable android.os.NativeHandle);
method public final void putString(long, String);
method public static Boolean[] wrapArray(@NonNull boolean[]);
method public static Long[] wrapArray(@NonNull long[]);
@@ -1015,7 +1027,7 @@
method public final double readDouble();
method public final java.util.ArrayList<java.lang.Double> readDoubleVector();
method public final android.os.HwBlob readEmbeddedBuffer(long, long, long, boolean);
- method public final android.os.NativeHandle readEmbeddedNativeHandle(long, long);
+ method @Nullable public final android.os.NativeHandle readEmbeddedNativeHandle(long, long);
method public final float readFloat();
method public final java.util.ArrayList<java.lang.Float> readFloatVector();
method public final short readInt16();
@@ -1026,8 +1038,8 @@
method public final java.util.ArrayList<java.lang.Long> readInt64Vector();
method public final byte readInt8();
method public final java.util.ArrayList<java.lang.Byte> readInt8Vector();
- method public final android.os.NativeHandle readNativeHandle();
- method public final java.util.ArrayList<android.os.NativeHandle> readNativeHandleVector();
+ method @Nullable public final android.os.NativeHandle readNativeHandle();
+ method @NonNull public final java.util.ArrayList<android.os.NativeHandle> readNativeHandleVector();
method public final String readString();
method public final java.util.ArrayList<java.lang.String> readStringVector();
method public final android.os.IHwBinder readStrongBinder();
@@ -1051,8 +1063,8 @@
method public final void writeInt8(byte);
method public final void writeInt8Vector(java.util.ArrayList<java.lang.Byte>);
method public final void writeInterfaceToken(String);
- method public final void writeNativeHandle(android.os.NativeHandle);
- method public final void writeNativeHandleVector(java.util.ArrayList<android.os.NativeHandle>);
+ method public final void writeNativeHandle(@Nullable android.os.NativeHandle);
+ method public final void writeNativeHandleVector(@NonNull java.util.ArrayList<android.os.NativeHandle>);
method public final void writeStatus(int);
method public final void writeString(String);
method public final void writeStringVector(java.util.ArrayList<java.lang.String>);
@@ -1102,10 +1114,10 @@
ctor public NativeHandle(@NonNull java.io.FileDescriptor, boolean);
ctor public NativeHandle(@NonNull java.io.FileDescriptor[], @NonNull int[], boolean);
method public void close() throws java.io.IOException;
- method public android.os.NativeHandle dup() throws java.io.IOException;
- method public java.io.FileDescriptor getFileDescriptor();
- method public java.io.FileDescriptor[] getFileDescriptors();
- method public int[] getInts();
+ method @NonNull public android.os.NativeHandle dup() throws java.io.IOException;
+ method @NonNull public java.io.FileDescriptor getFileDescriptor();
+ method @NonNull public java.io.FileDescriptor[] getFileDescriptors();
+ method @NonNull public int[] getInts();
method public boolean hasSingleFileDescriptor();
}
@@ -1227,6 +1239,7 @@
field public static final String CAPTIVE_PORTAL_USE_HTTPS = "captive_portal_use_https";
field public static final String DATA_STALL_CONSECUTIVE_DNS_TIMEOUT_THRESHOLD = "data_stall_consecutive_dns_timeout_threshold";
field public static final String DATA_STALL_EVALUATION_TYPE = "data_stall_evaluation_type";
+ field public static final int DATA_STALL_EVALUATION_TYPE_DNS = 1; // 0x1
field public static final String DATA_STALL_MIN_EVALUATE_INTERVAL = "data_stall_min_evaluate_interval";
field public static final String DATA_STALL_VALID_DNS_TIME_THRESHOLD = "data_stall_valid_dns_time_threshold";
field public static final String HIDDEN_API_BLACKLIST_EXEMPTIONS = "hidden_api_blacklist_exemptions";
@@ -1439,8 +1452,8 @@
ctor public CallAudioState(boolean, int, int, @Nullable android.bluetooth.BluetoothDevice, @NonNull java.util.Collection<android.bluetooth.BluetoothDevice>);
}
- public final class PhoneAccountSuggestion implements android.os.Parcelable {
- ctor public PhoneAccountSuggestion(android.telecom.PhoneAccountHandle, int, boolean);
+ public abstract class Conference extends android.telecom.Conferenceable {
+ method public android.telecom.Connection getPrimaryConnection();
}
public class PhoneAccountSuggestionService extends android.app.Service {
@@ -1451,6 +1464,16 @@
field public static final String SERVICE_INTERFACE = "android.telecom.PhoneAccountSuggestionService";
}
+ public class TelecomManager {
+ method @RequiresPermission("android.permission.READ_PRIVILEGED_PHONE_STATE") public int getCurrentTtyMode();
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean isInEmergencyCall();
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setUserSelectedOutgoingPhoneAccount(@Nullable android.telecom.PhoneAccountHandle);
+ field public static final int TTY_MODE_FULL = 1; // 0x1
+ field public static final int TTY_MODE_HCO = 2; // 0x2
+ field public static final int TTY_MODE_OFF = 0; // 0x0
+ field public static final int TTY_MODE_VCO = 3; // 0x3
+ }
+
}
package android.telephony {
@@ -1544,12 +1567,12 @@
public class MbmsGroupCallServiceBase extends android.app.Service {
ctor public MbmsGroupCallServiceBase();
method public void dispose(int) throws android.os.RemoteException;
- method public int initialize(android.telephony.mbms.MbmsGroupCallSessionCallback, int) throws android.os.RemoteException;
+ method public int initialize(@NonNull android.telephony.mbms.MbmsGroupCallSessionCallback, int) throws android.os.RemoteException;
method public void onAppCallbackDied(int, int);
method public android.os.IBinder onBind(android.content.Intent);
- method public int startGroupCall(int, long, java.util.List<java.lang.Integer>, java.util.List<java.lang.Integer>, android.telephony.mbms.GroupCallCallback);
+ method public int startGroupCall(int, long, @NonNull java.util.List<java.lang.Integer>, @NonNull java.util.List<java.lang.Integer>, @NonNull android.telephony.mbms.GroupCallCallback);
method public void stopGroupCall(int, long);
- method public void updateGroupCall(int, long, java.util.List<java.lang.Integer>, java.util.List<java.lang.Integer>);
+ method public void updateGroupCall(int, long, @NonNull java.util.List<java.lang.Integer>, @NonNull java.util.List<java.lang.Integer>);
}
public class MbmsStreamingServiceBase extends android.os.Binder {
diff --git a/cmds/hid/hid b/cmds/hid/hid
index 2359fcd..3931da1 100755
--- a/cmds/hid/hid
+++ b/cmds/hid/hid
@@ -5,4 +5,10 @@
#
base=/system
export CLASSPATH=$base/framework/hid.jar
+
+# Preload the native portion libhidcommand_jni.so to bypass the dependency
+# checks in the Java classloader, which prohibit dependencies that aren't
+# listed in system/core/rootdir/etc/public.libraries.android.txt.
+export LD_PRELOAD=libhidcommand_jni.so
+
exec app_process $base/bin com.android.commands.hid.Hid "$@"
diff --git a/cmds/statsd/OWNERS b/cmds/statsd/OWNERS
index deebd4e..1315750 100644
--- a/cmds/statsd/OWNERS
+++ b/cmds/statsd/OWNERS
@@ -1,7 +1,6 @@
bookatz@google.com
cjyu@google.com
dwchen@google.com
-gaillard@google.com
jinyithu@google.com
joeo@google.com
kwekua@google.com
diff --git a/cmds/statsd/src/atoms.proto b/cmds/statsd/src/atoms.proto
index 2fe6caf..47eccdb 100644
--- a/cmds/statsd/src/atoms.proto
+++ b/cmds/statsd/src/atoms.proto
@@ -2410,6 +2410,9 @@
// The elapsed real time of start of the process.
optional int64 process_start_time_nanos = 9;
+
+ // Min oom adj score considered by lmkd.
+ optional int32 min_oom_score = 10;
}
/*
diff --git a/config/hiddenapi-greylist.txt b/config/hiddenapi-greylist.txt
index 4a43616..36936d1 100644
--- a/config/hiddenapi-greylist.txt
+++ b/config/hiddenapi-greylist.txt
@@ -5,21 +5,10 @@
Landroid/accounts/IAccountAuthenticator$Stub$Proxy;->mRemote:Landroid/os/IBinder;
Landroid/accounts/IAccountAuthenticator$Stub;-><init>()V
Landroid/accounts/IAccountAuthenticator$Stub;->asInterface(Landroid/os/IBinder;)Landroid/accounts/IAccountAuthenticator;
-Landroid/accounts/IAccountAuthenticator;->addAccount(Landroid/accounts/IAccountAuthenticatorResponse;Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Landroid/os/Bundle;)V
-Landroid/accounts/IAccountAuthenticator;->confirmCredentials(Landroid/accounts/IAccountAuthenticatorResponse;Landroid/accounts/Account;Landroid/os/Bundle;)V
-Landroid/accounts/IAccountAuthenticator;->editProperties(Landroid/accounts/IAccountAuthenticatorResponse;Ljava/lang/String;)V
-Landroid/accounts/IAccountAuthenticator;->getAccountRemovalAllowed(Landroid/accounts/IAccountAuthenticatorResponse;Landroid/accounts/Account;)V
-Landroid/accounts/IAccountAuthenticator;->getAuthToken(Landroid/accounts/IAccountAuthenticatorResponse;Landroid/accounts/Account;Ljava/lang/String;Landroid/os/Bundle;)V
-Landroid/accounts/IAccountAuthenticator;->getAuthTokenLabel(Landroid/accounts/IAccountAuthenticatorResponse;Ljava/lang/String;)V
-Landroid/accounts/IAccountAuthenticator;->hasFeatures(Landroid/accounts/IAccountAuthenticatorResponse;Landroid/accounts/Account;[Ljava/lang/String;)V
-Landroid/accounts/IAccountAuthenticator;->updateCredentials(Landroid/accounts/IAccountAuthenticatorResponse;Landroid/accounts/Account;Ljava/lang/String;Landroid/os/Bundle;)V
Landroid/accounts/IAccountAuthenticatorResponse$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
Landroid/accounts/IAccountAuthenticatorResponse$Stub$Proxy;->mRemote:Landroid/os/IBinder;
Landroid/accounts/IAccountAuthenticatorResponse$Stub;-><init>()V
Landroid/accounts/IAccountAuthenticatorResponse$Stub;->asInterface(Landroid/os/IBinder;)Landroid/accounts/IAccountAuthenticatorResponse;
-Landroid/accounts/IAccountAuthenticatorResponse;->onError(ILjava/lang/String;)V
-Landroid/accounts/IAccountAuthenticatorResponse;->onRequestContinued()V
-Landroid/accounts/IAccountAuthenticatorResponse;->onResult(Landroid/os/Bundle;)V
Landroid/accounts/IAccountManager$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
Landroid/accounts/IAccountManager$Stub;-><init>()V
Landroid/accounts/IAccountManager$Stub;->asInterface(Landroid/os/IBinder;)Landroid/accounts/IAccountManager;
@@ -27,8 +16,6 @@
Landroid/accounts/IAccountManagerResponse$Stub$Proxy;->mRemote:Landroid/os/IBinder;
Landroid/accounts/IAccountManagerResponse$Stub;-><init>()V
Landroid/accounts/IAccountManagerResponse$Stub;->asInterface(Landroid/os/IBinder;)Landroid/accounts/IAccountManagerResponse;
-Landroid/accounts/IAccountManagerResponse;->onError(ILjava/lang/String;)V
-Landroid/accounts/IAccountManagerResponse;->onResult(Landroid/os/Bundle;)V
Landroid/app/ActivityManagerNative;-><init>()V
Landroid/app/ActivityThread$AppBindData;-><init>()V
Landroid/app/ActivityThread$CreateServiceData;-><init>()V
@@ -36,21 +23,9 @@
Landroid/app/admin/IDevicePolicyManager$Stub;->asInterface(Landroid/os/IBinder;)Landroid/app/admin/IDevicePolicyManager;
Landroid/app/admin/IDevicePolicyManager$Stub;->TRANSACTION_packageHasActiveAdmins:I
Landroid/app/admin/IDevicePolicyManager$Stub;->TRANSACTION_removeActiveAdmin:I
-Landroid/app/admin/IDevicePolicyManager;->packageHasActiveAdmins(Ljava/lang/String;I)Z
Landroid/app/backup/IBackupManager$Stub;->asInterface(Landroid/os/IBinder;)Landroid/app/backup/IBackupManager;
-Landroid/app/backup/IBackupManager;->acknowledgeFullBackupOrRestore(IZLjava/lang/String;Ljava/lang/String;Landroid/app/backup/IFullBackupRestoreObserver;)V
-Landroid/app/backup/IBackupManager;->clearBackupData(Ljava/lang/String;Ljava/lang/String;)V
-Landroid/app/backup/IBackupManager;->dataChanged(Ljava/lang/String;)V
-Landroid/app/backup/IBackupManager;->getCurrentTransport()Ljava/lang/String;
-Landroid/app/backup/IBackupManager;->isBackupEnabled()Z
-Landroid/app/backup/IBackupManager;->isBackupServiceActive(I)Z
-Landroid/app/backup/IBackupManager;->listAllTransports()[Ljava/lang/String;
-Landroid/app/backup/IBackupManager;->selectBackupTransport(Ljava/lang/String;)Ljava/lang/String;
-Landroid/app/backup/IBackupManager;->setAutoRestore(Z)V
-Landroid/app/backup/IBackupManager;->setBackupEnabled(Z)V
Landroid/app/backup/IFullBackupRestoreObserver$Stub;-><init>()V
Landroid/app/backup/IRestoreObserver$Stub;-><init>()V
-Landroid/app/DownloadManager;->restartDownload([J)V
Landroid/app/IActivityController$Stub;-><init>()V
Landroid/app/IActivityManager$Stub$Proxy;->getConfiguration()Landroid/content/res/Configuration;
Landroid/app/IActivityManager$Stub$Proxy;->getLaunchedFromUid(Landroid/os/IBinder;)I
@@ -62,136 +37,51 @@
Landroid/app/IActivityManager$Stub$Proxy;->updatePersistentConfiguration(Landroid/content/res/Configuration;)V
Landroid/app/IActivityManager$Stub;->asInterface(Landroid/os/IBinder;)Landroid/app/IActivityManager;
Landroid/app/IActivityManager;->bindService(Landroid/app/IApplicationThread;Landroid/os/IBinder;Landroid/content/Intent;Ljava/lang/String;Landroid/app/IServiceConnection;ILjava/lang/String;I)I
-Landroid/app/IActivityManager;->broadcastIntent(Landroid/app/IApplicationThread;Landroid/content/Intent;Ljava/lang/String;Landroid/content/IIntentReceiver;ILjava/lang/String;Landroid/os/Bundle;[Ljava/lang/String;ILandroid/os/Bundle;ZZI)I
-Landroid/app/IActivityManager;->cancelRecentsAnimation(Z)V
-Landroid/app/IActivityManager;->cancelTaskWindowTransition(I)V
-Landroid/app/IActivityManager;->checkPermission(Ljava/lang/String;II)I
-Landroid/app/IActivityManager;->closeSystemDialogs(Ljava/lang/String;)V
Landroid/app/IActivityManager;->finishActivity(Landroid/os/IBinder;ILandroid/content/Intent;I)Z
-Landroid/app/IActivityManager;->finishHeavyWeightApp()V
Landroid/app/IActivityManager;->finishReceiver(Landroid/os/IBinder;ILjava/lang/String;Landroid/os/Bundle;ZI)V
-Landroid/app/IActivityManager;->forceStopPackage(Ljava/lang/String;I)V
-Landroid/app/IActivityManager;->getAllStackInfos()Ljava/util/List;
-Landroid/app/IActivityManager;->getConfiguration()Landroid/content/res/Configuration;
-Landroid/app/IActivityManager;->getCurrentUser()Landroid/content/pm/UserInfo;
-Landroid/app/IActivityManager;->getFilteredTasks(III)Ljava/util/List;
-Landroid/app/IActivityManager;->getIntentForIntentSender(Landroid/content/IIntentSender;)Landroid/content/Intent;
Landroid/app/IActivityManager;->getIntentSender(ILjava/lang/String;Landroid/os/IBinder;Ljava/lang/String;I[Landroid/content/Intent;[Ljava/lang/String;ILandroid/os/Bundle;I)Landroid/content/IIntentSender;
Landroid/app/IActivityManager;->getLaunchedFromPackage(Landroid/os/IBinder;)Ljava/lang/String;
Landroid/app/IActivityManager;->getLaunchedFromUid(Landroid/os/IBinder;)I
-Landroid/app/IActivityManager;->getLockTaskModeState()I
Landroid/app/IActivityManager;->getMemoryInfo(Landroid/app/ActivityManager$MemoryInfo;)V
-Landroid/app/IActivityManager;->getPackageProcessState(Ljava/lang/String;Ljava/lang/String;)I
-Landroid/app/IActivityManager;->getProcessLimit()I
Landroid/app/IActivityManager;->getProcessMemoryInfo([I)[Landroid/os/Debug$MemoryInfo;
Landroid/app/IActivityManager;->getProcessPss([I)[J
-Landroid/app/IActivityManager;->getProviderMimeType(Landroid/net/Uri;I)Ljava/lang/String;
-Landroid/app/IActivityManager;->getRecentTasks(III)Landroid/content/pm/ParceledListSlice;
-Landroid/app/IActivityManager;->getRunningAppProcesses()Ljava/util/List;
-Landroid/app/IActivityManager;->getServices(II)Ljava/util/List;
-Landroid/app/IActivityManager;->getTaskBounds(I)Landroid/graphics/Rect;
Landroid/app/IActivityManager;->getTaskForActivity(Landroid/os/IBinder;Z)I
Landroid/app/IActivityManager;->getTaskSnapshot(IZ)Landroid/app/ActivityManager$TaskSnapshot;
Landroid/app/IActivityManager;->handleApplicationStrictModeViolation(Landroid/os/IBinder;ILandroid/os/StrictMode$ViolationInfo;)V
Landroid/app/IActivityManager;->hang(Landroid/os/IBinder;Z)V
-Landroid/app/IActivityManager;->isInLockTaskMode()Z
-Landroid/app/IActivityManager;->isIntentSenderAnActivity(Landroid/content/IIntentSender;)Z
Landroid/app/IActivityManager;->isTopOfTask(Landroid/os/IBinder;)Z
-Landroid/app/IActivityManager;->isUserRunning(II)Z
-Landroid/app/IActivityManager;->killAllBackgroundProcesses()V
-Landroid/app/IActivityManager;->killBackgroundProcesses(Ljava/lang/String;I)V
Landroid/app/IActivityManager;->moveActivityTaskToBack(Landroid/os/IBinder;Z)Z
-Landroid/app/IActivityManager;->moveTaskToFront(IILandroid/os/Bundle;)V
-Landroid/app/IActivityManager;->moveTaskToStack(IIZ)V
-Landroid/app/IActivityManager;->moveTopActivityToPinnedStack(ILandroid/graphics/Rect;)Z
-Landroid/app/IActivityManager;->positionTaskInStack(III)V
-Landroid/app/IActivityManager;->profileControl(Ljava/lang/String;IZLandroid/app/ProfilerInfo;I)Z
-Landroid/app/IActivityManager;->publishContentProviders(Landroid/app/IApplicationThread;Ljava/util/List;)V
-Landroid/app/IActivityManager;->registerProcessObserver(Landroid/app/IProcessObserver;)V
-Landroid/app/IActivityManager;->registerReceiver(Landroid/app/IApplicationThread;Ljava/lang/String;Landroid/content/IIntentReceiver;Landroid/content/IntentFilter;Ljava/lang/String;II)Landroid/content/Intent;
-Landroid/app/IActivityManager;->registerTaskStackListener(Landroid/app/ITaskStackListener;)V
-Landroid/app/IActivityManager;->registerUserSwitchObserver(Landroid/app/IUserSwitchObserver;Ljava/lang/String;)V
Landroid/app/IActivityManager;->removeContentProviderExternal(Ljava/lang/String;Landroid/os/IBinder;)V
-Landroid/app/IActivityManager;->removeStack(I)V
-Landroid/app/IActivityManager;->removeTask(I)Z
-Landroid/app/IActivityManager;->requestBugReport(I)V
-Landroid/app/IActivityManager;->resizeDockedStack(Landroid/graphics/Rect;Landroid/graphics/Rect;Landroid/graphics/Rect;Landroid/graphics/Rect;Landroid/graphics/Rect;)V
-Landroid/app/IActivityManager;->resizeStack(ILandroid/graphics/Rect;ZZZI)V
-Landroid/app/IActivityManager;->resizeTask(ILandroid/graphics/Rect;I)V
-Landroid/app/IActivityManager;->restart()V
-Landroid/app/IActivityManager;->resumeAppSwitches()V
-Landroid/app/IActivityManager;->sendIdleJobTrigger()V
Landroid/app/IActivityManager;->serviceDoneExecuting(Landroid/os/IBinder;III)V
-Landroid/app/IActivityManager;->setActivityController(Landroid/app/IActivityController;Z)V
-Landroid/app/IActivityManager;->setAlwaysFinish(Z)V
-Landroid/app/IActivityManager;->setDebugApp(Ljava/lang/String;ZZ)V
-Landroid/app/IActivityManager;->setDumpHeapDebugLimit(Ljava/lang/String;IJLjava/lang/String;)V
-Landroid/app/IActivityManager;->setPackageScreenCompatMode(Ljava/lang/String;I)V
Landroid/app/IActivityManager;->setProcessImportant(Landroid/os/IBinder;IZLjava/lang/String;)V
-Landroid/app/IActivityManager;->setProcessLimit(I)V
-Landroid/app/IActivityManager;->setProcessMemoryTrimLevel(Ljava/lang/String;II)Z
Landroid/app/IActivityManager;->setRequestedOrientation(Landroid/os/IBinder;I)V
-Landroid/app/IActivityManager;->setTaskResizeable(II)V
-Landroid/app/IActivityManager;->shutdown(I)Z
Landroid/app/IActivityManager;->startActivity(Landroid/app/IApplicationThread;Ljava/lang/String;Landroid/content/Intent;Ljava/lang/String;Landroid/os/IBinder;Ljava/lang/String;IILandroid/app/ProfilerInfo;Landroid/os/Bundle;)I
Landroid/app/IActivityManager;->startActivityAsUser(Landroid/app/IApplicationThread;Ljava/lang/String;Landroid/content/Intent;Ljava/lang/String;Landroid/os/IBinder;Ljava/lang/String;IILandroid/app/ProfilerInfo;Landroid/os/Bundle;I)I
-Landroid/app/IActivityManager;->startActivityFromRecents(ILandroid/os/Bundle;)I
-Landroid/app/IActivityManager;->startBinderTracking()Z
-Landroid/app/IActivityManager;->startInstrumentation(Landroid/content/ComponentName;Ljava/lang/String;ILandroid/os/Bundle;Landroid/app/IInstrumentationWatcher;Landroid/app/IUiAutomationConnection;ILjava/lang/String;)Z
-Landroid/app/IActivityManager;->startRecentsActivity(Landroid/content/Intent;Landroid/app/IAssistDataReceiver;Landroid/view/IRecentsAnimationRunner;)V
-Landroid/app/IActivityManager;->startSystemLockTaskMode(I)V
-Landroid/app/IActivityManager;->startUserInBackground(I)Z
-Landroid/app/IActivityManager;->stopAppSwitches()V
Landroid/app/IActivityManager;->stopBinderTrackingAndDump(Landroid/os/ParcelFileDescriptor;)Z
-Landroid/app/IActivityManager;->stopService(Landroid/app/IApplicationThread;Landroid/content/Intent;Ljava/lang/String;I)I
-Landroid/app/IActivityManager;->stopUser(IZLandroid/app/IStopUserCallback;)I
-Landroid/app/IActivityManager;->suppressResizeConfigChanges(Z)V
-Landroid/app/IActivityManager;->switchUser(I)Z
-Landroid/app/IActivityManager;->unbindService(Landroid/app/IServiceConnection;)Z
-Landroid/app/IActivityManager;->unhandledBack()V
-Landroid/app/IActivityManager;->unlockUser(I[B[BLandroid/os/IProgressListener;)Z
-Landroid/app/IActivityManager;->unregisterProcessObserver(Landroid/app/IProcessObserver;)V
-Landroid/app/IActivityManager;->unregisterReceiver(Landroid/content/IIntentReceiver;)V
Landroid/app/IActivityManager;->unstableProviderDied(Landroid/os/IBinder;)V
-Landroid/app/IActivityManager;->updateConfiguration(Landroid/content/res/Configuration;)Z
-Landroid/app/IActivityManager;->updatePersistentConfiguration(Landroid/content/res/Configuration;)V
Landroid/app/IAlarmManager$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
Landroid/app/IAlarmManager$Stub;->asInterface(Landroid/os/IBinder;)Landroid/app/IAlarmManager;
Landroid/app/IAlarmManager$Stub;->TRANSACTION_remove:I
Landroid/app/IAlarmManager$Stub;->TRANSACTION_set:I
Landroid/app/IAlarmManager;->getNextAlarmClock(I)Landroid/app/AlarmManager$AlarmClockInfo;
Landroid/app/IAlarmManager;->set(Ljava/lang/String;IJJJILandroid/app/PendingIntent;Landroid/app/IAlarmListener;Ljava/lang/String;Landroid/os/WorkSource;Landroid/app/AlarmManager$AlarmClockInfo;)V
-Landroid/app/IAlarmManager;->setTime(J)Z
Landroid/app/IApplicationThread;->scheduleBindService(Landroid/os/IBinder;Landroid/content/Intent;ZI)V
Landroid/app/IApplicationThread;->scheduleCreateService(Landroid/os/IBinder;Landroid/content/pm/ServiceInfo;Landroid/content/res/CompatibilityInfo;I)V
Landroid/app/IApplicationThread;->scheduleStopService(Landroid/os/IBinder;)V
-Landroid/app/IApplicationThread;->scheduleTrimMemory(I)V
Landroid/app/IApplicationThread;->scheduleUnbindService(Landroid/os/IBinder;Landroid/content/Intent;)V
Landroid/app/IAppTask;->getTaskInfo()Landroid/app/ActivityManager$RecentTaskInfo;
Landroid/app/IAssistDataReceiver$Stub;-><init>()V
-Landroid/app/IAssistDataReceiver;->onHandleAssistData(Landroid/os/Bundle;)V
-Landroid/app/IAssistDataReceiver;->onHandleAssistScreenshot(Landroid/graphics/Bitmap;)V
-Landroid/app/IInputForwarder;->forwardEvent(Landroid/view/InputEvent;)Z
Landroid/app/IInstrumentationWatcher$Stub;-><init>()V
-Landroid/app/IInstrumentationWatcher;->instrumentationStatus(Landroid/content/ComponentName;ILandroid/os/Bundle;)V
Landroid/app/INotificationManager$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
Landroid/app/INotificationManager$Stub$Proxy;->areNotificationsEnabledForPackage(Ljava/lang/String;I)Z
Landroid/app/INotificationManager$Stub;->asInterface(Landroid/os/IBinder;)Landroid/app/INotificationManager;
Landroid/app/INotificationManager$Stub;->TRANSACTION_enqueueNotificationWithTag:I
-Landroid/app/INotificationManager;->areNotificationsEnabledForPackage(Ljava/lang/String;I)Z
-Landroid/app/INotificationManager;->cancelAllNotifications(Ljava/lang/String;I)V
-Landroid/app/INotificationManager;->cancelNotificationWithTag(Ljava/lang/String;Ljava/lang/String;II)V
-Landroid/app/INotificationManager;->cancelToast(Ljava/lang/String;Landroid/app/ITransientNotification;)V
-Landroid/app/INotificationManager;->enqueueToast(Ljava/lang/String;Landroid/app/ITransientNotification;I)V
Landroid/app/INotificationManager;->getActiveNotifications(Ljava/lang/String;)[Landroid/service/notification/StatusBarNotification;
Landroid/app/INotificationManager;->getHistoricalNotifications(Ljava/lang/String;I)[Landroid/service/notification/StatusBarNotification;
-Landroid/app/INotificationManager;->getZenMode()I
-Landroid/app/INotificationManager;->getZenModeConfig()Landroid/service/notification/ZenModeConfig;
Landroid/app/IProcessObserver$Stub;-><init>()V
Landroid/app/ISearchManager$Stub$Proxy;->getGlobalSearchActivity()Landroid/content/ComponentName;
Landroid/app/ISearchManager$Stub$Proxy;->getWebSearchActivity()Landroid/content/ComponentName;
Landroid/app/ISearchManager$Stub;->asInterface(Landroid/os/IBinder;)Landroid/app/ISearchManager;
-Landroid/app/ISearchManager;->getGlobalSearchActivity()Landroid/content/ComponentName;
Landroid/app/IServiceConnection$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
Landroid/app/IServiceConnection$Stub$Proxy;->mRemote:Landroid/os/IBinder;
Landroid/app/IServiceConnection$Stub;-><init>()V
@@ -200,49 +90,30 @@
Landroid/app/IStopUserCallback$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
Landroid/app/IStopUserCallback$Stub$Proxy;->mRemote:Landroid/os/IBinder;
Landroid/app/IStopUserCallback$Stub;-><init>()V
-Landroid/app/IStopUserCallback;->userStopped(I)V
Landroid/app/ITransientNotification$Stub;-><init>()V
Landroid/app/ITransientNotification;->show(Landroid/os/IBinder;)V
Landroid/app/IUiModeManager$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
Landroid/app/IUserSwitchObserver$Stub;-><init>()V
Landroid/app/IWallpaperManager$Stub;->asInterface(Landroid/os/IBinder;)Landroid/app/IWallpaperManager;
-Landroid/app/IWallpaperManager;->getHeightHint()I
-Landroid/app/IWallpaperManager;->getWallpaper(Ljava/lang/String;Landroid/app/IWallpaperManagerCallback;ILandroid/os/Bundle;I)Landroid/os/ParcelFileDescriptor;
-Landroid/app/IWallpaperManager;->getWallpaperInfo(I)Landroid/app/WallpaperInfo;
-Landroid/app/IWallpaperManager;->getWidthHint()I
-Landroid/app/IWallpaperManager;->hasNamedWallpaper(Ljava/lang/String;)Z
-Landroid/app/IWallpaperManager;->setWallpaperComponent(Landroid/content/ComponentName;)V
Landroid/app/IWallpaperManagerCallback$Stub;-><init>()V
Landroid/app/job/IJobCallback$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
Landroid/app/job/IJobCallback$Stub$Proxy;->mRemote:Landroid/os/IBinder;
Landroid/app/job/IJobCallback$Stub;-><init>()V
Landroid/app/job/IJobCallback$Stub;->asInterface(Landroid/os/IBinder;)Landroid/app/job/IJobCallback;
-Landroid/app/job/IJobCallback;->acknowledgeStartMessage(IZ)V
-Landroid/app/job/IJobCallback;->acknowledgeStopMessage(IZ)V
-Landroid/app/job/IJobCallback;->completeWork(II)Z
-Landroid/app/job/IJobCallback;->dequeueWork(I)Landroid/app/job/JobWorkItem;
-Landroid/app/job/IJobCallback;->jobFinished(IZ)V
Landroid/app/job/IJobScheduler$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
Landroid/app/job/IJobScheduler$Stub;->asInterface(Landroid/os/IBinder;)Landroid/app/job/IJobScheduler;
Landroid/app/job/IJobService$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
Landroid/app/job/IJobService$Stub$Proxy;->mRemote:Landroid/os/IBinder;
Landroid/app/job/IJobService$Stub;-><init>()V
Landroid/app/job/IJobService$Stub;->asInterface(Landroid/os/IBinder;)Landroid/app/job/IJobService;
-Landroid/app/job/IJobService;->startJob(Landroid/app/job/JobParameters;)V
-Landroid/app/job/IJobService;->stopJob(Landroid/app/job/JobParameters;)V
Landroid/app/PackageDeleteObserver;-><init>()V
Landroid/app/PackageInstallObserver;-><init>()V
-Landroid/app/ReceiverRestrictedContext;-><init>(Landroid/content/Context;)V
Landroid/app/ResourcesManager$ActivityResources;-><init>()V
Landroid/app/ResourcesManager;-><init>()V
Landroid/app/TaskStackListener;-><init>()V
Landroid/app/trust/ITrustManager$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
Landroid/app/UiAutomationConnection;-><init>()V
Landroid/app/usage/IUsageStatsManager$Stub;->asInterface(Landroid/os/IBinder;)Landroid/app/usage/IUsageStatsManager;
-Landroid/app/usage/IUsageStatsManager;->isAppInactive(Ljava/lang/String;I)Z
-Landroid/app/usage/IUsageStatsManager;->queryConfigurationStats(IJJLjava/lang/String;)Landroid/content/pm/ParceledListSlice;
-Landroid/app/usage/IUsageStatsManager;->queryUsageStats(IJJLjava/lang/String;)Landroid/content/pm/ParceledListSlice;
-Landroid/app/usage/IUsageStatsManager;->setAppInactive(Ljava/lang/String;ZI)V
Landroid/app/UserSwitchObserver;-><init>()V
Landroid/app/VrStateCallback;-><init>()V
Landroid/bluetooth/IBluetooth$Stub$Proxy;->getAddress()Ljava/lang/String;
@@ -287,22 +158,14 @@
Landroid/companion/ICompanionDeviceDiscoveryServiceCallback;->onDeviceSelected(Ljava/lang/String;ILjava/lang/String;)V
Landroid/companion/ICompanionDeviceDiscoveryServiceCallback;->onDeviceSelectionCancel()V
Landroid/companion/IFindDeviceCallback;->onSuccess(Landroid/app/PendingIntent;)V
-Landroid/content/ContentProviderProxy;->mRemote:Landroid/os/IBinder;
Landroid/content/IClipboard$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
Landroid/content/IClipboard$Stub;->asInterface(Landroid/os/IBinder;)Landroid/content/IClipboard;
Landroid/content/IContentService$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
Landroid/content/IContentService$Stub;-><init>()V
Landroid/content/IContentService$Stub;->asInterface(Landroid/os/IBinder;)Landroid/content/IContentService;
-Landroid/content/IContentService;->cancelSync(Landroid/accounts/Account;Ljava/lang/String;Landroid/content/ComponentName;)V
-Landroid/content/IContentService;->getIsSyncable(Landroid/accounts/Account;Ljava/lang/String;)I
-Landroid/content/IContentService;->getMasterSyncAutomatically()Z
-Landroid/content/IContentService;->getSyncAdapterTypes()[Landroid/content/SyncAdapterType;
-Landroid/content/IContentService;->isSyncActive(Landroid/accounts/Account;Ljava/lang/String;Landroid/content/ComponentName;)Z
-Landroid/content/IContentService;->setMasterSyncAutomatically(Z)V
Landroid/content/IIntentReceiver$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
Landroid/content/IIntentReceiver$Stub$Proxy;->mRemote:Landroid/os/IBinder;
Landroid/content/IIntentReceiver$Stub;-><init>()V
-Landroid/content/IIntentReceiver;->performReceive(Landroid/content/Intent;ILjava/lang/String;Landroid/os/Bundle;ZZI)V
Landroid/content/IOnPrimaryClipChangedListener$Stub;-><init>()V
Landroid/content/IOnPrimaryClipChangedListener$Stub;->asInterface(Landroid/os/IBinder;)Landroid/content/IOnPrimaryClipChangedListener;
Landroid/content/IRestrictionsManager$Stub;->asInterface(Landroid/os/IBinder;)Landroid/content/IRestrictionsManager;
@@ -310,24 +173,16 @@
Landroid/content/ISyncAdapter$Stub$Proxy;->mRemote:Landroid/os/IBinder;
Landroid/content/ISyncAdapter$Stub;-><init>()V
Landroid/content/ISyncAdapter$Stub;->asInterface(Landroid/os/IBinder;)Landroid/content/ISyncAdapter;
-Landroid/content/ISyncAdapter;->cancelSync(Landroid/content/ISyncContext;)V
-Landroid/content/ISyncAdapter;->onUnsyncableAccount(Landroid/content/ISyncAdapterUnsyncableAccountCallback;)V
-Landroid/content/ISyncAdapter;->startSync(Landroid/content/ISyncContext;Ljava/lang/String;Landroid/accounts/Account;Landroid/os/Bundle;)V
Landroid/content/ISyncContext$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
Landroid/content/ISyncContext$Stub$Proxy;->mRemote:Landroid/os/IBinder;
Landroid/content/ISyncContext$Stub;-><init>()V
Landroid/content/ISyncContext$Stub;->asInterface(Landroid/os/IBinder;)Landroid/content/ISyncContext;
Landroid/content/ISyncServiceAdapter$Stub;->asInterface(Landroid/os/IBinder;)Landroid/content/ISyncServiceAdapter;
-Landroid/content/ISyncServiceAdapter;->cancelSync(Landroid/content/ISyncContext;)V
-Landroid/content/ISyncServiceAdapter;->startSync(Landroid/content/ISyncContext;Landroid/os/Bundle;)V
Landroid/content/ISyncStatusObserver$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
Landroid/content/ISyncStatusObserver$Stub$Proxy;->mRemote:Landroid/os/IBinder;
Landroid/content/ISyncStatusObserver$Stub;-><init>()V
Landroid/content/ISyncStatusObserver$Stub;->asInterface(Landroid/os/IBinder;)Landroid/content/ISyncStatusObserver;
-Landroid/content/ISyncStatusObserver;->onStatusChanged(I)V
Landroid/content/om/IOverlayManager$Stub;->asInterface(Landroid/os/IBinder;)Landroid/content/om/IOverlayManager;
-Landroid/content/om/IOverlayManager;->getAllOverlays(I)Ljava/util/Map;
-Landroid/content/om/IOverlayManager;->getOverlayInfo(Ljava/lang/String;I)Landroid/content/om/OverlayInfo;
Landroid/content/pm/IPackageDataObserver$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
Landroid/content/pm/IPackageDataObserver$Stub$Proxy;->mRemote:Landroid/os/IBinder;
Landroid/content/pm/IPackageDataObserver$Stub$Proxy;->onRemoveCompleted(Ljava/lang/String;Z)V
@@ -335,7 +190,6 @@
Landroid/content/pm/IPackageDataObserver$Stub;->asInterface(Landroid/os/IBinder;)Landroid/content/pm/IPackageDataObserver;
Landroid/content/pm/IPackageDataObserver$Stub;->DESCRIPTOR:Ljava/lang/String;
Landroid/content/pm/IPackageDataObserver$Stub;->TRANSACTION_onRemoveCompleted:I
-Landroid/content/pm/IPackageDataObserver;->onRemoveCompleted(Ljava/lang/String;Z)V
Landroid/content/pm/IPackageDeleteObserver$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
Landroid/content/pm/IPackageDeleteObserver$Stub;-><init>()V
Landroid/content/pm/IPackageDeleteObserver$Stub;->asInterface(Landroid/os/IBinder;)Landroid/content/pm/IPackageDeleteObserver;
@@ -345,17 +199,9 @@
Landroid/content/pm/IPackageDeleteObserver2$Stub$Proxy;->mRemote:Landroid/os/IBinder;
Landroid/content/pm/IPackageDeleteObserver2$Stub;-><init>()V
Landroid/content/pm/IPackageDeleteObserver2$Stub;->asInterface(Landroid/os/IBinder;)Landroid/content/pm/IPackageDeleteObserver2;
-Landroid/content/pm/IPackageDeleteObserver2;->onPackageDeleted(Ljava/lang/String;ILjava/lang/String;)V
-Landroid/content/pm/IPackageDeleteObserver;->packageDeleted(Ljava/lang/String;I)V
-Landroid/content/pm/IPackageInstaller;->uninstall(Landroid/content/pm/VersionedPackage;Ljava/lang/String;ILandroid/content/IntentSender;I)V
Landroid/content/pm/IPackageInstallerCallback$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
Landroid/content/pm/IPackageInstallerCallback$Stub$Proxy;->mRemote:Landroid/os/IBinder;
Landroid/content/pm/IPackageInstallerCallback$Stub;->asInterface(Landroid/os/IBinder;)Landroid/content/pm/IPackageInstallerCallback;
-Landroid/content/pm/IPackageInstallerCallback;->onSessionActiveChanged(IZ)V
-Landroid/content/pm/IPackageInstallerCallback;->onSessionBadgingChanged(I)V
-Landroid/content/pm/IPackageInstallerCallback;->onSessionCreated(I)V
-Landroid/content/pm/IPackageInstallerCallback;->onSessionFinished(IZ)V
-Landroid/content/pm/IPackageInstallerCallback;->onSessionProgressChanged(IF)V
Landroid/content/pm/IPackageInstallerSession$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
Landroid/content/pm/IPackageInstallerSession$Stub$Proxy;->mRemote:Landroid/os/IBinder;
Landroid/content/pm/IPackageInstallerSession$Stub;-><init>()V
@@ -364,8 +210,6 @@
Landroid/content/pm/IPackageInstallObserver2$Stub$Proxy;->mRemote:Landroid/os/IBinder;
Landroid/content/pm/IPackageInstallObserver2$Stub;-><init>()V
Landroid/content/pm/IPackageInstallObserver2$Stub;->asInterface(Landroid/os/IBinder;)Landroid/content/pm/IPackageInstallObserver2;
-Landroid/content/pm/IPackageInstallObserver2;->onPackageInstalled(Ljava/lang/String;ILjava/lang/String;Landroid/os/Bundle;)V
-Landroid/content/pm/IPackageInstallObserver2;->onUserActionRequired(Landroid/content/Intent;)V
Landroid/content/pm/IPackageManager$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
Landroid/content/pm/IPackageManager$Stub$Proxy;->checkUidPermission(Ljava/lang/String;I)I
Landroid/content/pm/IPackageManager$Stub$Proxy;->getAppOpPermissionPackages(Ljava/lang/String;)[Ljava/lang/String;
@@ -377,62 +221,6 @@
Landroid/content/pm/IPackageManager$Stub$Proxy;->getSystemSharedLibraryNames()[Ljava/lang/String;
Landroid/content/pm/IPackageManager$Stub;->asInterface(Landroid/os/IBinder;)Landroid/content/pm/IPackageManager;
Landroid/content/pm/IPackageManager$Stub;->TRANSACTION_getApplicationInfo:I
-Landroid/content/pm/IPackageManager;->addPermission(Landroid/content/pm/PermissionInfo;)Z
-Landroid/content/pm/IPackageManager;->addPermissionAsync(Landroid/content/pm/PermissionInfo;)Z
-Landroid/content/pm/IPackageManager;->canonicalToCurrentPackageNames([Ljava/lang/String;)[Ljava/lang/String;
-Landroid/content/pm/IPackageManager;->checkPermission(Ljava/lang/String;Ljava/lang/String;I)I
-Landroid/content/pm/IPackageManager;->checkSignatures(Ljava/lang/String;Ljava/lang/String;)I
-Landroid/content/pm/IPackageManager;->checkUidSignatures(II)I
-Landroid/content/pm/IPackageManager;->clearPackagePreferredActivities(Ljava/lang/String;)V
-Landroid/content/pm/IPackageManager;->currentToCanonicalPackageNames([Ljava/lang/String;)[Ljava/lang/String;
-Landroid/content/pm/IPackageManager;->deleteApplicationCacheFiles(Ljava/lang/String;Landroid/content/pm/IPackageDataObserver;)V
-Landroid/content/pm/IPackageManager;->getActivityInfo(Landroid/content/ComponentName;II)Landroid/content/pm/ActivityInfo;
-Landroid/content/pm/IPackageManager;->getApplicationEnabledSetting(Ljava/lang/String;I)I
-Landroid/content/pm/IPackageManager;->getApplicationInfo(Ljava/lang/String;II)Landroid/content/pm/ApplicationInfo;
-Landroid/content/pm/IPackageManager;->getAppOpPermissionPackages(Ljava/lang/String;)[Ljava/lang/String;
-Landroid/content/pm/IPackageManager;->getBlockUninstallForUser(Ljava/lang/String;I)Z
-Landroid/content/pm/IPackageManager;->getComponentEnabledSetting(Landroid/content/ComponentName;I)I
-Landroid/content/pm/IPackageManager;->getFlagsForUid(I)I
-Landroid/content/pm/IPackageManager;->getHomeActivities(Ljava/util/List;)Landroid/content/ComponentName;
-Landroid/content/pm/IPackageManager;->getInstalledApplications(II)Landroid/content/pm/ParceledListSlice;
-Landroid/content/pm/IPackageManager;->getInstalledPackages(II)Landroid/content/pm/ParceledListSlice;
-Landroid/content/pm/IPackageManager;->getInstallerPackageName(Ljava/lang/String;)Ljava/lang/String;
-Landroid/content/pm/IPackageManager;->getInstallLocation()I
-Landroid/content/pm/IPackageManager;->getInstrumentationInfo(Landroid/content/ComponentName;I)Landroid/content/pm/InstrumentationInfo;
-Landroid/content/pm/IPackageManager;->getLastChosenActivity(Landroid/content/Intent;Ljava/lang/String;I)Landroid/content/pm/ResolveInfo;
-Landroid/content/pm/IPackageManager;->getNameForUid(I)Ljava/lang/String;
-Landroid/content/pm/IPackageManager;->getPackageInfo(Ljava/lang/String;II)Landroid/content/pm/PackageInfo;
-Landroid/content/pm/IPackageManager;->getPackageInstaller()Landroid/content/pm/IPackageInstaller;
-Landroid/content/pm/IPackageManager;->getPackagesForUid(I)[Ljava/lang/String;
-Landroid/content/pm/IPackageManager;->getPackageUid(Ljava/lang/String;II)I
-Landroid/content/pm/IPackageManager;->getPermissionControllerPackageName()Ljava/lang/String;
-Landroid/content/pm/IPackageManager;->getPermissionGroupInfo(Ljava/lang/String;I)Landroid/content/pm/PermissionGroupInfo;
-Landroid/content/pm/IPackageManager;->getPreferredActivities(Ljava/util/List;Ljava/util/List;Ljava/lang/String;)I
-Landroid/content/pm/IPackageManager;->getProviderInfo(Landroid/content/ComponentName;II)Landroid/content/pm/ProviderInfo;
-Landroid/content/pm/IPackageManager;->getReceiverInfo(Landroid/content/ComponentName;II)Landroid/content/pm/ActivityInfo;
-Landroid/content/pm/IPackageManager;->getServiceInfo(Landroid/content/ComponentName;II)Landroid/content/pm/ServiceInfo;
-Landroid/content/pm/IPackageManager;->getServicesSystemSharedLibraryPackageName()Ljava/lang/String;
-Landroid/content/pm/IPackageManager;->getSharedSystemSharedLibraryPackageName()Ljava/lang/String;
-Landroid/content/pm/IPackageManager;->getSystemSharedLibraryNames()[Ljava/lang/String;
-Landroid/content/pm/IPackageManager;->getUidForSharedUser(Ljava/lang/String;)I
-Landroid/content/pm/IPackageManager;->grantRuntimePermission(Ljava/lang/String;Ljava/lang/String;I)V
-Landroid/content/pm/IPackageManager;->hasSystemUidErrors()Z
-Landroid/content/pm/IPackageManager;->isPackageAvailable(Ljava/lang/String;I)Z
-Landroid/content/pm/IPackageManager;->isSafeMode()Z
-Landroid/content/pm/IPackageManager;->isStorageLow()Z
-Landroid/content/pm/IPackageManager;->isUidPrivileged(I)Z
-Landroid/content/pm/IPackageManager;->queryInstrumentation(Ljava/lang/String;I)Landroid/content/pm/ParceledListSlice;
-Landroid/content/pm/IPackageManager;->queryIntentActivities(Landroid/content/Intent;Ljava/lang/String;II)Landroid/content/pm/ParceledListSlice;
-Landroid/content/pm/IPackageManager;->querySyncProviders(Ljava/util/List;Ljava/util/List;)V
-Landroid/content/pm/IPackageManager;->removePermission(Ljava/lang/String;)V
-Landroid/content/pm/IPackageManager;->replacePreferredActivity(Landroid/content/IntentFilter;I[Landroid/content/ComponentName;Landroid/content/ComponentName;I)V
-Landroid/content/pm/IPackageManager;->resolveIntent(Landroid/content/Intent;Ljava/lang/String;II)Landroid/content/pm/ResolveInfo;
-Landroid/content/pm/IPackageManager;->setApplicationEnabledSetting(Ljava/lang/String;IIILjava/lang/String;)V
-Landroid/content/pm/IPackageManager;->setApplicationHiddenSettingAsUser(Ljava/lang/String;ZI)Z
-Landroid/content/pm/IPackageManager;->setComponentEnabledSetting(Landroid/content/ComponentName;III)V
-Landroid/content/pm/IPackageManager;->setInstallerPackageName(Ljava/lang/String;Ljava/lang/String;)V
-Landroid/content/pm/IPackageManager;->setLastChosenActivity(Landroid/content/Intent;Ljava/lang/String;ILandroid/content/IntentFilter;ILandroid/content/ComponentName;)V
-Landroid/content/pm/IPackageManager;->setPackageStoppedState(Ljava/lang/String;ZI)V
Landroid/content/pm/IPackageMoveObserver$Stub;-><init>()V
Landroid/content/pm/IPackageMoveObserver$Stub;->asInterface(Landroid/os/IBinder;)Landroid/content/pm/IPackageMoveObserver;
Landroid/content/pm/IPackageStatsObserver$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
@@ -441,13 +229,11 @@
Landroid/content/pm/IPackageStatsObserver$Stub;->asInterface(Landroid/os/IBinder;)Landroid/content/pm/IPackageStatsObserver;
Landroid/content/pm/IPackageStatsObserver$Stub;->DESCRIPTOR:Ljava/lang/String;
Landroid/content/pm/IPackageStatsObserver$Stub;->TRANSACTION_onGetStatsCompleted:I
-Landroid/content/pm/IPackageStatsObserver;->onGetStatsCompleted(Landroid/content/pm/PackageStats;Z)V
Landroid/content/pm/IShortcutService$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
Landroid/content/pm/IShortcutService$Stub;->asInterface(Landroid/os/IBinder;)Landroid/content/pm/IShortcutService;
Landroid/content/res/ConfigurationBoundResourceCache;-><init>()V
Landroid/content/res/DrawableCache;-><init>()V
Landroid/content/UndoManager;-><init>()V
-Landroid/database/BulkCursorProxy;->mRemote:Landroid/os/IBinder;
Landroid/database/IContentObserver$Stub;-><init>()V
Landroid/database/IContentObserver$Stub;->asInterface(Landroid/os/IBinder;)Landroid/database/IContentObserver;
Landroid/database/IContentObserver;->onChange(ZLandroid/net/Uri;I)V
@@ -509,16 +295,13 @@
Landroid/hardware/camera2/CaptureResult;->TONEMAP_CURVE_RED:Landroid/hardware/camera2/CaptureResult$Key;
Landroid/hardware/camera2/utils/HashCodeHelpers;->hashCode([I)I
Landroid/hardware/display/IDisplayManager$Stub;->asInterface(Landroid/os/IBinder;)Landroid/hardware/display/IDisplayManager;
-Landroid/hardware/display/IDisplayManager;->getDisplayInfo(I)Landroid/view/DisplayInfo;
Landroid/hardware/fingerprint/IFingerprintService$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
Landroid/hardware/fingerprint/IFingerprintService$Stub;->asInterface(Landroid/os/IBinder;)Landroid/hardware/fingerprint/IFingerprintService;
Landroid/hardware/ICameraService$Stub;->asInterface(Landroid/os/IBinder;)Landroid/hardware/ICameraService;
Landroid/hardware/input/IInputManager$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
Landroid/hardware/input/IInputManager$Stub;->asInterface(Landroid/os/IBinder;)Landroid/hardware/input/IInputManager;
Landroid/hardware/input/IInputManager$Stub;->TRANSACTION_injectInputEvent:I
-Landroid/hardware/input/IInputManager;->injectInputEvent(Landroid/view/InputEvent;I)Z
Landroid/hardware/location/IActivityRecognitionHardwareClient$Stub;-><init>()V
-Landroid/hardware/location/IActivityRecognitionHardwareClient;->onAvailabilityChanged(ZLandroid/hardware/location/IActivityRecognitionHardware;)V
Landroid/hardware/location/IContextHubService$Stub;->asInterface(Landroid/os/IBinder;)Landroid/hardware/location/IContextHubService;
Landroid/hardware/usb/IUsbManager$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
Landroid/hardware/usb/IUsbManager$Stub;->asInterface(Landroid/os/IBinder;)Landroid/hardware/usb/IUsbManager;
@@ -528,48 +311,28 @@
Landroid/location/ICountryListener$Stub;-><init>()V
Landroid/location/IGeocodeProvider$Stub;-><init>()V
Landroid/location/IGeocodeProvider$Stub;->asInterface(Landroid/os/IBinder;)Landroid/location/IGeocodeProvider;
-Landroid/location/IGeocodeProvider;->getFromLocation(DDILandroid/location/GeocoderParams;Ljava/util/List;)Ljava/lang/String;
-Landroid/location/IGeocodeProvider;->getFromLocationName(Ljava/lang/String;DDDDILandroid/location/GeocoderParams;Ljava/util/List;)Ljava/lang/String;
Landroid/location/IGeofenceProvider$Stub;-><init>()V
-Landroid/location/IGeofenceProvider;->setGeofenceHardware(Landroid/hardware/location/IGeofenceHardware;)V
Landroid/location/ILocationListener$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
Landroid/location/ILocationListener$Stub$Proxy;->mRemote:Landroid/os/IBinder;
Landroid/location/ILocationListener$Stub;-><init>()V
Landroid/location/ILocationListener$Stub;->asInterface(Landroid/os/IBinder;)Landroid/location/ILocationListener;
-Landroid/location/ILocationListener;->onLocationChanged(Landroid/location/Location;)V
-Landroid/location/ILocationListener;->onProviderDisabled(Ljava/lang/String;)V
-Landroid/location/ILocationListener;->onProviderEnabled(Ljava/lang/String;)V
-Landroid/location/ILocationListener;->onStatusChanged(Ljava/lang/String;ILandroid/os/Bundle;)V
Landroid/location/ILocationManager$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
Landroid/location/ILocationManager$Stub;->asInterface(Landroid/os/IBinder;)Landroid/location/ILocationManager;
Landroid/location/ILocationManager$Stub;->TRANSACTION_getAllProviders:I
-Landroid/location/ILocationManager;->getAllProviders()Ljava/util/List;
-Landroid/location/ILocationManager;->getNetworkProviderPackage()Ljava/lang/String;
-Landroid/location/ILocationManager;->reportLocation(Landroid/location/Location;Z)V
Landroid/location/INetInitiatedListener$Stub;-><init>()V
-Landroid/location/INetInitiatedListener;->sendNiResponse(II)Z
Landroid/location/LocationManager$ListenerTransport;-><init>(Landroid/location/LocationManager;Landroid/location/LocationListener;Landroid/os/Looper;)V
Landroid/media/effect/SingleFilterEffect;-><init>(Landroid/media/effect/EffectContext;Ljava/lang/String;Ljava/lang/Class;Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)V
-Landroid/media/IAudioFocusDispatcher;->dispatchAudioFocusChange(ILjava/lang/String;)V
Landroid/media/IAudioRoutesObserver$Stub;-><init>()V
Landroid/media/IAudioService$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
Landroid/media/IAudioService$Stub;-><init>()V
Landroid/media/IAudioService$Stub;->asInterface(Landroid/os/IBinder;)Landroid/media/IAudioService;
-Landroid/media/IAudioService;->getStreamMaxVolume(I)I
-Landroid/media/IAudioService;->getStreamVolume(I)I
-Landroid/media/IAudioService;->setStreamVolume(IIILjava/lang/String;)V
-Landroid/media/IAudioService;->startWatchingRoutes(Landroid/media/IAudioRoutesObserver;)Landroid/media/AudioRoutesInfo;
Landroid/media/IMediaRouterService$Stub;->asInterface(Landroid/os/IBinder;)Landroid/media/IMediaRouterService;
Landroid/media/IMediaScannerListener$Stub;-><init>()V
Landroid/media/IMediaScannerService$Stub;->asInterface(Landroid/os/IBinder;)Landroid/media/IMediaScannerService;
-Landroid/media/IMediaScannerService;->requestScanFile(Ljava/lang/String;Ljava/lang/String;Landroid/media/IMediaScannerListener;)V
-Landroid/media/IMediaScannerService;->scanFile(Ljava/lang/String;Ljava/lang/String;)V
-Landroid/media/IRemoteDisplayCallback;->onStateChanged(Landroid/media/RemoteDisplayState;)V
Landroid/media/IRingtonePlayer;->play(Landroid/os/IBinder;Landroid/net/Uri;Landroid/media/AudioAttributes;FZ)V
Landroid/media/IVolumeController$Stub;->asInterface(Landroid/os/IBinder;)Landroid/media/IVolumeController;
Landroid/media/MediaFile;-><init>()V
Landroid/media/MediaScanner$MyMediaScannerClient;-><init>(Landroid/media/MediaScanner;)V
-Landroid/media/projection/IMediaProjectionManager;->hasProjectionPermission(ILjava/lang/String;)Z
Landroid/media/session/ISessionManager$Stub;->asInterface(Landroid/os/IBinder;)Landroid/media/session/ISessionManager;
Landroid/media/tv/ITvRemoteProvider$Stub;-><init>()V
Landroid/media/tv/ITvRemoteServiceInput;->clearInputBridge(Landroid/os/IBinder;)V
@@ -592,41 +355,13 @@
Landroid/net/IConnectivityManager$Stub$Proxy;->getTetheredIfaces()[Ljava/lang/String;
Landroid/net/IConnectivityManager$Stub$Proxy;->mRemote:Landroid/os/IBinder;
Landroid/net/IConnectivityManager$Stub;->asInterface(Landroid/os/IBinder;)Landroid/net/IConnectivityManager;
-Landroid/net/IConnectivityManager;->getActiveLinkProperties()Landroid/net/LinkProperties;
-Landroid/net/IConnectivityManager;->getActiveNetworkInfo()Landroid/net/NetworkInfo;
-Landroid/net/IConnectivityManager;->getAllNetworkInfo()[Landroid/net/NetworkInfo;
-Landroid/net/IConnectivityManager;->getAllNetworkState()[Landroid/net/NetworkState;
-Landroid/net/IConnectivityManager;->getLastTetherError(Ljava/lang/String;)I
-Landroid/net/IConnectivityManager;->getTetherableIfaces()[Ljava/lang/String;
-Landroid/net/IConnectivityManager;->getTetherableUsbRegexs()[Ljava/lang/String;
-Landroid/net/IConnectivityManager;->getTetherableWifiRegexs()[Ljava/lang/String;
-Landroid/net/IConnectivityManager;->getTetheredIfaces()[Ljava/lang/String;
-Landroid/net/IConnectivityManager;->getTetheringErroredIfaces()[Ljava/lang/String;
-Landroid/net/IConnectivityManager;->startLegacyVpn(Lcom/android/internal/net/VpnProfile;)V
Landroid/net/INetworkManagementEventObserver$Stub;-><init>()V
Landroid/net/INetworkPolicyListener$Stub;-><init>()V
Landroid/net/INetworkPolicyManager$Stub;->asInterface(Landroid/os/IBinder;)Landroid/net/INetworkPolicyManager;
-Landroid/net/INetworkPolicyManager;->getNetworkQuotaInfo(Landroid/net/NetworkState;)Landroid/net/NetworkQuotaInfo;
-Landroid/net/INetworkPolicyManager;->getRestrictBackground()Z
-Landroid/net/INetworkPolicyManager;->getUidPolicy(I)I
-Landroid/net/INetworkPolicyManager;->setNetworkPolicies([Landroid/net/NetworkPolicy;)V
-Landroid/net/INetworkPolicyManager;->setRestrictBackground(Z)V
-Landroid/net/INetworkPolicyManager;->setUidPolicy(II)V
-Landroid/net/INetworkPolicyManager;->snoozeLimit(Landroid/net/NetworkTemplate;)V
Landroid/net/INetworkScoreService$Stub;->asInterface(Landroid/os/IBinder;)Landroid/net/INetworkScoreService;
Landroid/net/INetworkStatsService$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
Landroid/net/INetworkStatsService$Stub$Proxy;->getMobileIfaces()[Ljava/lang/String;
Landroid/net/INetworkStatsService$Stub;->asInterface(Landroid/os/IBinder;)Landroid/net/INetworkStatsService;
-Landroid/net/INetworkStatsService;->forceUpdate()V
-Landroid/net/INetworkStatsService;->getDataLayerSnapshotForUid(I)Landroid/net/NetworkStats;
-Landroid/net/INetworkStatsService;->getMobileIfaces()[Ljava/lang/String;
-Landroid/net/INetworkStatsService;->openSession()Landroid/net/INetworkStatsSession;
-Landroid/net/INetworkStatsService;->openSessionForUsageStats(ILjava/lang/String;)Landroid/net/INetworkStatsSession;
-Landroid/net/INetworkStatsSession;->close()V
-Landroid/net/INetworkStatsSession;->getHistoryForNetwork(Landroid/net/NetworkTemplate;I)Landroid/net/NetworkStatsHistory;
-Landroid/net/INetworkStatsSession;->getHistoryForUid(Landroid/net/NetworkTemplate;IIII)Landroid/net/NetworkStatsHistory;
-Landroid/net/INetworkStatsSession;->getSummaryForAllUid(Landroid/net/NetworkTemplate;JJZ)Landroid/net/NetworkStats;
-Landroid/net/INetworkStatsSession;->getSummaryForNetwork(Landroid/net/NetworkTemplate;JJ)Landroid/net/NetworkStats;
Landroid/net/InterfaceConfiguration;-><init>()V
Landroid/net/LinkProperties$ProvisioningChange;->values()[Landroid/net/LinkProperties$ProvisioningChange;
Landroid/net/MobileLinkQualityInfo;-><init>()V
@@ -637,22 +372,12 @@
Landroid/net/wifi/IWifiManager$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
Landroid/net/wifi/IWifiManager$Stub;->asInterface(Landroid/os/IBinder;)Landroid/net/wifi/IWifiManager;
Landroid/net/wifi/IWifiManager$Stub;->TRANSACTION_getScanResults:I
-Landroid/net/wifi/IWifiManager;->getCurrentNetwork()Landroid/net/Network;
-Landroid/net/wifi/IWifiManager;->getWifiApConfiguration()Landroid/net/wifi/WifiConfiguration;
-Landroid/net/wifi/IWifiManager;->getWifiApEnabledState()I
Landroid/net/wifi/IWifiScanner$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
Landroid/net/wifi/IWifiScanner$Stub$Proxy;->mRemote:Landroid/os/IBinder;
Landroid/net/wifi/IWifiScanner$Stub;-><init>()V
Landroid/net/wifi/IWifiScanner$Stub;->asInterface(Landroid/os/IBinder;)Landroid/net/wifi/IWifiScanner;
Landroid/net/wifi/p2p/IWifiP2pManager$Stub;->asInterface(Landroid/os/IBinder;)Landroid/net/wifi/p2p/IWifiP2pManager;
Landroid/nfc/INfcAdapter$Stub;->TRANSACTION_enable:I
-Landroid/nfc/INfcAdapterExtras;->authenticate(Ljava/lang/String;[B)V
-Landroid/nfc/INfcAdapterExtras;->close(Ljava/lang/String;Landroid/os/IBinder;)Landroid/os/Bundle;
-Landroid/nfc/INfcAdapterExtras;->getCardEmulationRoute(Ljava/lang/String;)I
-Landroid/nfc/INfcAdapterExtras;->getDriverName(Ljava/lang/String;)Ljava/lang/String;
-Landroid/nfc/INfcAdapterExtras;->open(Ljava/lang/String;Landroid/os/IBinder;)Landroid/os/Bundle;
-Landroid/nfc/INfcAdapterExtras;->setCardEmulationRoute(Ljava/lang/String;I)V
-Landroid/nfc/INfcAdapterExtras;->transceive(Ljava/lang/String;[B)Landroid/os/Bundle;
Landroid/os/AsyncResult;-><init>(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Throwable;)V
Landroid/os/AsyncResult;->exception:Ljava/lang/Throwable;
Landroid/os/AsyncResult;->forMessage(Landroid/os/Message;)Landroid/os/AsyncResult;
@@ -1458,9 +1183,7 @@
Landroid/R$styleable;->Window:[I
Landroid/R$styleable;->Window_windowBackground:I
Landroid/R$styleable;->Window_windowFrame:I
-Landroid/security/Credentials;->convertToPem([Ljava/security/cert/Certificate;)[B
Landroid/security/IKeyChainService$Stub;->asInterface(Landroid/os/IBinder;)Landroid/security/IKeyChainService;
-Landroid/security/IKeyChainService;->requestPrivateKey(Ljava/lang/String;)Ljava/lang/String;
Landroid/security/keymaster/KeymasterBlobArgument;-><init>(ILandroid/os/Parcel;)V
Landroid/security/keymaster/KeymasterBlobArgument;-><init>(I[B)V
Landroid/security/keymaster/KeymasterBlobArgument;->blob:[B
@@ -1484,22 +1207,7 @@
Landroid/security/keystore/IKeystoreService;->reset()I
Landroid/security/keystore/IKeystoreService;->ungrant(Ljava/lang/String;I)I
Landroid/service/dreams/IDreamManager$Stub;->asInterface(Landroid/os/IBinder;)Landroid/service/dreams/IDreamManager;
-Landroid/service/dreams/IDreamManager;->awaken()V
-Landroid/service/dreams/IDreamManager;->dream()V
-Landroid/service/dreams/IDreamManager;->getDreamComponents()[Landroid/content/ComponentName;
-Landroid/service/dreams/IDreamManager;->isDreaming()Z
-Landroid/service/dreams/IDreamManager;->setDreamComponents([Landroid/content/ComponentName;)V
-Landroid/service/euicc/IDeleteSubscriptionCallback;->onComplete(I)V
-Landroid/service/euicc/IEraseSubscriptionsCallback;->onComplete(I)V
Landroid/service/euicc/IEuiccService$Stub;-><init>()V
-Landroid/service/euicc/IGetDefaultDownloadableSubscriptionListCallback;->onComplete(Landroid/service/euicc/GetDefaultDownloadableSubscriptionListResult;)V
-Landroid/service/euicc/IGetDownloadableSubscriptionMetadataCallback;->onComplete(Landroid/service/euicc/GetDownloadableSubscriptionMetadataResult;)V
-Landroid/service/euicc/IGetEidCallback;->onSuccess(Ljava/lang/String;)V
-Landroid/service/euicc/IGetEuiccInfoCallback;->onSuccess(Landroid/telephony/euicc/EuiccInfo;)V
-Landroid/service/euicc/IGetEuiccProfileInfoListCallback;->onComplete(Landroid/service/euicc/GetEuiccProfileInfoListResult;)V
-Landroid/service/euicc/IRetainSubscriptionsForFactoryResetCallback;->onComplete(I)V
-Landroid/service/euicc/ISwitchToSubscriptionCallback;->onComplete(I)V
-Landroid/service/euicc/IUpdateSubscriptionNicknameCallback;->onComplete(I)V
Landroid/service/media/IMediaBrowserServiceCallbacks$Stub;->asInterface(Landroid/os/IBinder;)Landroid/service/media/IMediaBrowserServiceCallbacks;
Landroid/service/media/IMediaBrowserServiceCallbacks;->onConnect(Ljava/lang/String;Landroid/media/session/MediaSession$Token;Landroid/os/Bundle;)V
Landroid/service/media/IMediaBrowserServiceCallbacks;->onConnectFailed()V
@@ -1508,15 +1216,8 @@
Landroid/service/notification/INotificationListener$Stub;-><init>()V
Landroid/service/persistentdata/IPersistentDataBlockService$Stub;->asInterface(Landroid/os/IBinder;)Landroid/service/persistentdata/IPersistentDataBlockService;
Landroid/service/vr/IVrManager$Stub;->asInterface(Landroid/os/IBinder;)Landroid/service/vr/IVrManager;
-Landroid/service/vr/IVrManager;->getVr2dDisplayId()I
-Landroid/service/vr/IVrManager;->getVrModeState()Z
Landroid/service/wallpaper/IWallpaperConnection$Stub;-><init>()V
-Landroid/service/wallpaper/IWallpaperEngine;->destroy()V
-Landroid/service/wallpaper/IWallpaperEngine;->dispatchPointer(Landroid/view/MotionEvent;)V
-Landroid/service/wallpaper/IWallpaperEngine;->dispatchWallpaperCommand(Ljava/lang/String;IIILandroid/os/Bundle;)V
-Landroid/service/wallpaper/IWallpaperEngine;->setVisibility(Z)V
Landroid/service/wallpaper/IWallpaperService$Stub;->asInterface(Landroid/os/IBinder;)Landroid/service/wallpaper/IWallpaperService;
-Landroid/speech/IRecognitionListener;->onEvent(ILandroid/os/Bundle;)V
Landroid/telecom/Log;->i(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)V
Landroid/telecom/Log;->w(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)V
Landroid/telephony/ims/compat/feature/MMTelFeature;-><init>()V
@@ -1527,10 +1228,6 @@
Landroid/telephony/mbms/IMbmsStreamingSessionCallback$Stub;-><init>()V
Landroid/telephony/mbms/IStreamingServiceCallback$Stub;-><init>()V
Landroid/telephony/mbms/vendor/IMbmsStreamingService$Stub;->asInterface(Landroid/os/IBinder;)Landroid/telephony/mbms/vendor/IMbmsStreamingService;
-Landroid/telephony/mbms/vendor/IMbmsStreamingService;->getPlaybackUri(ILjava/lang/String;)Landroid/net/Uri;
-Landroid/telephony/mbms/vendor/IMbmsStreamingService;->initialize(Landroid/telephony/mbms/IMbmsStreamingSessionCallback;I)I
-Landroid/telephony/mbms/vendor/IMbmsStreamingService;->requestUpdateStreamingServices(ILjava/util/List;)I
-Landroid/telephony/mbms/vendor/IMbmsStreamingService;->startStreaming(ILjava/lang/String;Landroid/telephony/mbms/IStreamingServiceCallback;)I
Landroid/telephony/SmsCbCmasInfo;->getCategory()I
Landroid/telephony/SmsCbCmasInfo;->getCertainty()I
Landroid/telephony/SmsCbCmasInfo;->getMessageClass()I
@@ -1556,9 +1253,6 @@
Landroid/telephony/SmsCbMessage;->isCmasMessage()Z
Landroid/telephony/SmsCbMessage;->isEmergencyMessage()Z
Landroid/telephony/TelephonyManager$MultiSimVariants;->values()[Landroid/telephony/TelephonyManager$MultiSimVariants;
-Landroid/test/AndroidTestCase;->getTestContext()Landroid/content/Context;
-Landroid/test/AndroidTestCase;->setTestContext(Landroid/content/Context;)V
-Landroid/test/InstrumentationTestCase;->runMethod(Ljava/lang/reflect/Method;I)V
Landroid/util/Singleton;-><init>()V
Landroid/util/XmlPullAttributes;-><init>(Lorg/xmlpull/v1/XmlPullParser;)V
Landroid/util/XmlPullAttributes;->mParser:Lorg/xmlpull/v1/XmlPullParser;
@@ -1575,17 +1269,9 @@
Landroid/view/IDockedStackListener$Stub;-><init>()V
Landroid/view/IGraphicsStats$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
Landroid/view/IGraphicsStats$Stub;->asInterface(Landroid/os/IBinder;)Landroid/view/IGraphicsStats;
-Landroid/view/IRecentsAnimationController;->finish(Z)V
Landroid/view/IRecentsAnimationController;->screenshotTask(I)Landroid/app/ActivityManager$TaskSnapshot;
-Landroid/view/IRecentsAnimationController;->setAnimationTargetsBehindSystemBars(Z)V
-Landroid/view/IRecentsAnimationController;->setInputConsumerEnabled(Z)V
Landroid/view/IRecentsAnimationRunner$Stub;-><init>()V
-Landroid/view/IRecentsAnimationRunner;->onAnimationCanceled()V
-Landroid/view/IRecentsAnimationRunner;->onAnimationStart(Landroid/view/IRecentsAnimationController;[Landroid/view/RemoteAnimationTarget;Landroid/graphics/Rect;Landroid/graphics/Rect;)V
-Landroid/view/IRemoteAnimationFinishedCallback;->onAnimationFinished()V
Landroid/view/IRemoteAnimationRunner$Stub;-><init>()V
-Landroid/view/IRemoteAnimationRunner;->onAnimationCancelled()V
-Landroid/view/IRemoteAnimationRunner;->onAnimationStart([Landroid/view/RemoteAnimationTarget;Landroid/view/IRemoteAnimationFinishedCallback;)V
Landroid/view/IRotationWatcher$Stub;-><init>()V
Landroid/view/IWindow$Stub;-><init>()V
Landroid/view/IWindow$Stub;->asInterface(Landroid/os/IBinder;)Landroid/view/IWindow;
@@ -1598,45 +1284,11 @@
Landroid/view/IWindowManager$Stub;-><init>()V
Landroid/view/IWindowManager$Stub;->asInterface(Landroid/os/IBinder;)Landroid/view/IWindowManager;
Landroid/view/IWindowManager;->createInputConsumer(Landroid/os/IBinder;Ljava/lang/String;Landroid/view/InputChannel;)V
-Landroid/view/IWindowManager;->destroyInputConsumer(Ljava/lang/String;)Z
-Landroid/view/IWindowManager;->endProlongedAnimations()V
-Landroid/view/IWindowManager;->executeAppTransition()V
-Landroid/view/IWindowManager;->freezeRotation(I)V
-Landroid/view/IWindowManager;->getAnimationScale(I)F
Landroid/view/IWindowManager;->getAnimationScales()[F
-Landroid/view/IWindowManager;->getBaseDisplaySize(ILandroid/graphics/Point;)V
-Landroid/view/IWindowManager;->getDockedStackSide()I
-Landroid/view/IWindowManager;->getInitialDisplayDensity(I)I
-Landroid/view/IWindowManager;->getInitialDisplaySize(ILandroid/graphics/Point;)V
-Landroid/view/IWindowManager;->getPendingAppTransition()I
-Landroid/view/IWindowManager;->getStableInsets(ILandroid/graphics/Rect;)V
-Landroid/view/IWindowManager;->hasNavigationBar()Z
-Landroid/view/IWindowManager;->isKeyguardLocked()Z
-Landroid/view/IWindowManager;->isKeyguardSecure()Z
-Landroid/view/IWindowManager;->isSafeModeEnabled()Z
-Landroid/view/IWindowManager;->lockNow(Landroid/os/Bundle;)V
-Landroid/view/IWindowManager;->overridePendingAppTransitionMultiThumbFuture(Landroid/view/IAppTransitionAnimationSpecsFuture;Landroid/os/IRemoteCallback;Z)V
-Landroid/view/IWindowManager;->overridePendingAppTransitionRemote(Landroid/view/RemoteAnimationAdapter;)V
-Landroid/view/IWindowManager;->registerDockedStackListener(Landroid/view/IDockedStackListener;)V
-Landroid/view/IWindowManager;->removeRotationWatcher(Landroid/view/IRotationWatcher;)V
-Landroid/view/IWindowManager;->setAnimationScale(IF)V
-Landroid/view/IWindowManager;->setAnimationScales([F)V
-Landroid/view/IWindowManager;->setNavBarVirtualKeyHapticFeedbackEnabled(Z)V
-Landroid/view/IWindowManager;->setShelfHeight(ZI)V
-Landroid/view/IWindowManager;->setStrictModeVisualIndicatorPreference(Ljava/lang/String;)V
-Landroid/view/IWindowManager;->thawRotation()V
Landroid/view/IWindowSession$Stub$Proxy;->relayout(Landroid/view/IWindow;ILandroid/view/WindowManager$LayoutParams;IIIIJLandroid/graphics/Rect;Landroid/graphics/Rect;Landroid/graphics/Rect;Landroid/graphics/Rect;Landroid/graphics/Rect;Landroid/graphics/Rect;Landroid/graphics/Rect;Landroid/view/DisplayCutout$ParcelableWrapper;Landroid/util/MergedConfiguration;Landroid/view/Surface;)I
Landroid/view/IWindowSession$Stub;->asInterface(Landroid/os/IBinder;)Landroid/view/IWindowSession;
-Landroid/view/IWindowSession;->finishDrawing(Landroid/view/IWindow;)V
-Landroid/view/IWindowSession;->getInTouchMode()Z
-Landroid/view/IWindowSession;->performDrag(Landroid/view/IWindow;ILandroid/view/SurfaceControl;IFFFFLandroid/content/ClipData;)Landroid/os/IBinder;
-Landroid/view/IWindowSession;->performHapticFeedback(Landroid/view/IWindow;IZ)Z
-Landroid/view/IWindowSession;->remove(Landroid/view/IWindow;)V
-Landroid/view/IWindowSession;->setInTouchMode(Z)V
-Landroid/view/IWindowSession;->setTransparentRegion(Landroid/view/IWindow;Landroid/graphics/Region;)V
Landroid/view/IWindowSession;->wallpaperCommandComplete(Landroid/os/IBinder;Landroid/os/Bundle;)V
Landroid/view/IWindowSession;->wallpaperOffsetsComplete(Landroid/os/IBinder;)V
-Landroid/view/RenderNodeAnimator;->setDuration(J)Landroid/view/RenderNodeAnimator;
Landroid/view/View$AttachInfo$InvalidateInfo;-><init>()V
Landroid/view/View$CheckForLongPress;-><init>(Landroid/view/View;)V
Landroid/view/View$ListenerInfo;-><init>()V
@@ -1645,9 +1297,7 @@
Landroid/webkit/IWebViewUpdateService$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
Landroid/webkit/IWebViewUpdateService$Stub$Proxy;->waitForAndGetProvider()Landroid/webkit/WebViewProviderResponse;
Landroid/webkit/IWebViewUpdateService$Stub;->asInterface(Landroid/os/IBinder;)Landroid/webkit/IWebViewUpdateService;
-Landroid/webkit/IWebViewUpdateService;->getCurrentWebViewPackageName()Ljava/lang/String;
Landroid/webkit/IWebViewUpdateService;->getValidWebViewPackages()[Landroid/webkit/WebViewProviderInfo;
-Landroid/webkit/IWebViewUpdateService;->isFallbackPackage(Ljava/lang/String;)Z
Landroid/widget/DigitalClock$FormatChangeObserver;-><init>(Landroid/widget/DigitalClock;)V
Landroid/widget/QuickContactBadge$QueryHandler;-><init>(Landroid/widget/QuickContactBadge;Landroid/content/ContentResolver;)V
Landroid/widget/RelativeLayout$DependencyGraph$Node;-><init>()V
@@ -1658,7 +1308,6 @@
Lcom/android/ims/ImsCall;->reject(I)V
Lcom/android/ims/ImsCall;->terminate(I)V
Lcom/android/ims/ImsConfigListener$Stub;-><init>()V
-Lcom/android/ims/ImsConfigListener;->onSetFeatureResponse(IIII)V
Lcom/android/ims/ImsEcbm;->exitEmergencyCallbackMode()V
Lcom/android/ims/ImsManager;->getConfigInterface()Lcom/android/ims/ImsConfig;
Lcom/android/ims/ImsManager;->getInstance(Landroid/content/Context;I)Lcom/android/ims/ImsManager;
@@ -1668,104 +1317,17 @@
Lcom/android/ims/ImsUtInterface;->queryCallForward(ILjava/lang/String;Landroid/os/Message;)V
Lcom/android/ims/internal/IImsCallSession$Stub;-><init>()V
Lcom/android/ims/internal/IImsCallSession$Stub;->asInterface(Landroid/os/IBinder;)Lcom/android/ims/internal/IImsCallSession;
-Lcom/android/ims/internal/IImsCallSessionListener;->callSessionConferenceStateUpdated(Lcom/android/ims/internal/IImsCallSession;Landroid/telephony/ims/ImsConferenceState;)V
-Lcom/android/ims/internal/IImsCallSessionListener;->callSessionHandover(Lcom/android/ims/internal/IImsCallSession;IILandroid/telephony/ims/ImsReasonInfo;)V
-Lcom/android/ims/internal/IImsCallSessionListener;->callSessionHandoverFailed(Lcom/android/ims/internal/IImsCallSession;IILandroid/telephony/ims/ImsReasonInfo;)V
-Lcom/android/ims/internal/IImsCallSessionListener;->callSessionHeld(Lcom/android/ims/internal/IImsCallSession;Landroid/telephony/ims/ImsCallProfile;)V
-Lcom/android/ims/internal/IImsCallSessionListener;->callSessionHoldFailed(Lcom/android/ims/internal/IImsCallSession;Landroid/telephony/ims/ImsReasonInfo;)V
-Lcom/android/ims/internal/IImsCallSessionListener;->callSessionHoldReceived(Lcom/android/ims/internal/IImsCallSession;Landroid/telephony/ims/ImsCallProfile;)V
-Lcom/android/ims/internal/IImsCallSessionListener;->callSessionInviteParticipantsRequestDelivered(Lcom/android/ims/internal/IImsCallSession;)V
-Lcom/android/ims/internal/IImsCallSessionListener;->callSessionInviteParticipantsRequestFailed(Lcom/android/ims/internal/IImsCallSession;Landroid/telephony/ims/ImsReasonInfo;)V
-Lcom/android/ims/internal/IImsCallSessionListener;->callSessionMergeComplete(Lcom/android/ims/internal/IImsCallSession;)V
-Lcom/android/ims/internal/IImsCallSessionListener;->callSessionMergeFailed(Lcom/android/ims/internal/IImsCallSession;Landroid/telephony/ims/ImsReasonInfo;)V
-Lcom/android/ims/internal/IImsCallSessionListener;->callSessionMergeStarted(Lcom/android/ims/internal/IImsCallSession;Lcom/android/ims/internal/IImsCallSession;Landroid/telephony/ims/ImsCallProfile;)V
-Lcom/android/ims/internal/IImsCallSessionListener;->callSessionMultipartyStateChanged(Lcom/android/ims/internal/IImsCallSession;Z)V
-Lcom/android/ims/internal/IImsCallSessionListener;->callSessionProgressing(Lcom/android/ims/internal/IImsCallSession;Landroid/telephony/ims/ImsStreamMediaProfile;)V
-Lcom/android/ims/internal/IImsCallSessionListener;->callSessionResumed(Lcom/android/ims/internal/IImsCallSession;Landroid/telephony/ims/ImsCallProfile;)V
-Lcom/android/ims/internal/IImsCallSessionListener;->callSessionResumeFailed(Lcom/android/ims/internal/IImsCallSession;Landroid/telephony/ims/ImsReasonInfo;)V
-Lcom/android/ims/internal/IImsCallSessionListener;->callSessionResumeReceived(Lcom/android/ims/internal/IImsCallSession;Landroid/telephony/ims/ImsCallProfile;)V
-Lcom/android/ims/internal/IImsCallSessionListener;->callSessionStarted(Lcom/android/ims/internal/IImsCallSession;Landroid/telephony/ims/ImsCallProfile;)V
-Lcom/android/ims/internal/IImsCallSessionListener;->callSessionStartFailed(Lcom/android/ims/internal/IImsCallSession;Landroid/telephony/ims/ImsReasonInfo;)V
-Lcom/android/ims/internal/IImsCallSessionListener;->callSessionSuppServiceReceived(Lcom/android/ims/internal/IImsCallSession;Landroid/telephony/ims/ImsSuppServiceNotification;)V
-Lcom/android/ims/internal/IImsCallSessionListener;->callSessionTerminated(Lcom/android/ims/internal/IImsCallSession;Landroid/telephony/ims/ImsReasonInfo;)V
-Lcom/android/ims/internal/IImsCallSessionListener;->callSessionTtyModeReceived(Lcom/android/ims/internal/IImsCallSession;I)V
-Lcom/android/ims/internal/IImsCallSessionListener;->callSessionUpdated(Lcom/android/ims/internal/IImsCallSession;Landroid/telephony/ims/ImsCallProfile;)V
Lcom/android/ims/internal/IImsConfig$Stub;-><init>()V
Lcom/android/ims/internal/IImsEcbm$Stub;-><init>()V
-Lcom/android/ims/internal/IImsRegistrationListener;->registrationAssociatedUriChanged([Landroid/net/Uri;)V
-Lcom/android/ims/internal/IImsRegistrationListener;->registrationChangeFailed(ILandroid/telephony/ims/ImsReasonInfo;)V
-Lcom/android/ims/internal/IImsRegistrationListener;->registrationConnected()V
-Lcom/android/ims/internal/IImsRegistrationListener;->registrationConnectedWithRadioTech(I)V
-Lcom/android/ims/internal/IImsRegistrationListener;->registrationDisconnected(Landroid/telephony/ims/ImsReasonInfo;)V
-Lcom/android/ims/internal/IImsRegistrationListener;->registrationFeatureCapabilityChanged(I[I[I)V
-Lcom/android/ims/internal/IImsRegistrationListener;->registrationProgressingWithRadioTech(I)V
-Lcom/android/ims/internal/IImsRegistrationListener;->voiceMessageCountUpdate(I)V
Lcom/android/ims/internal/IImsService$Stub;-><init>()V
Lcom/android/ims/internal/IImsService$Stub;->asInterface(Landroid/os/IBinder;)Lcom/android/ims/internal/IImsService;
Lcom/android/ims/internal/IImsUt$Stub;-><init>()V
-Lcom/android/ims/internal/IImsUtListener;->utConfigurationCallBarringQueried(Lcom/android/ims/internal/IImsUt;I[Landroid/telephony/ims/ImsSsInfo;)V
-Lcom/android/ims/internal/IImsUtListener;->utConfigurationCallForwardQueried(Lcom/android/ims/internal/IImsUt;I[Landroid/telephony/ims/ImsCallForwardInfo;)V
-Lcom/android/ims/internal/IImsUtListener;->utConfigurationCallWaitingQueried(Lcom/android/ims/internal/IImsUt;I[Landroid/telephony/ims/ImsSsInfo;)V
-Lcom/android/ims/internal/IImsUtListener;->utConfigurationQueried(Lcom/android/ims/internal/IImsUt;ILandroid/os/Bundle;)V
-Lcom/android/ims/internal/IImsUtListener;->utConfigurationQueryFailed(Lcom/android/ims/internal/IImsUt;ILandroid/telephony/ims/ImsReasonInfo;)V
-Lcom/android/ims/internal/IImsUtListener;->utConfigurationUpdated(Lcom/android/ims/internal/IImsUt;I)V
-Lcom/android/ims/internal/IImsUtListener;->utConfigurationUpdateFailed(Lcom/android/ims/internal/IImsUt;ILandroid/telephony/ims/ImsReasonInfo;)V
-Lcom/android/ims/internal/IImsVideoCallCallback;->changeCallDataUsage(J)V
-Lcom/android/ims/internal/IImsVideoCallCallback;->changeCameraCapabilities(Landroid/telecom/VideoProfile$CameraCapabilities;)V
-Lcom/android/ims/internal/IImsVideoCallCallback;->changePeerDimensions(II)V
-Lcom/android/ims/internal/IImsVideoCallCallback;->changeVideoQuality(I)V
-Lcom/android/ims/internal/IImsVideoCallCallback;->handleCallSessionEvent(I)V
-Lcom/android/ims/internal/IImsVideoCallCallback;->receiveSessionModifyRequest(Landroid/telecom/VideoProfile;)V
-Lcom/android/ims/internal/IImsVideoCallCallback;->receiveSessionModifyResponse(ILandroid/telecom/VideoProfile;Landroid/telecom/VideoProfile;)V
Lcom/android/ims/internal/IImsVideoCallProvider$Stub;-><init>()V
-Lcom/android/ims/internal/IImsVideoCallProvider;->setCallback(Lcom/android/ims/internal/IImsVideoCallCallback;)V
Lcom/android/ims/internal/ImsVideoCallProviderWrapper;-><init>(Lcom/android/ims/internal/IImsVideoCallProvider;)V
-Lcom/android/ims/internal/uce/options/IOptionsListener;->cmdStatus(Lcom/android/ims/internal/uce/options/OptionsCmdStatus;)V
-Lcom/android/ims/internal/uce/options/IOptionsListener;->getVersionCb(Ljava/lang/String;)V
-Lcom/android/ims/internal/uce/options/IOptionsListener;->incomingOptions(Ljava/lang/String;Lcom/android/ims/internal/uce/options/OptionsCapInfo;I)V
-Lcom/android/ims/internal/uce/options/IOptionsListener;->serviceAvailable(Lcom/android/ims/internal/uce/common/StatusCode;)V
-Lcom/android/ims/internal/uce/options/IOptionsListener;->serviceUnavailable(Lcom/android/ims/internal/uce/common/StatusCode;)V
-Lcom/android/ims/internal/uce/options/IOptionsListener;->sipResponseReceived(Ljava/lang/String;Lcom/android/ims/internal/uce/options/OptionsSipResponse;Lcom/android/ims/internal/uce/options/OptionsCapInfo;)V
Lcom/android/ims/internal/uce/options/IOptionsService$Stub;-><init>()V
-Lcom/android/ims/internal/uce/options/IOptionsService;->addListener(ILcom/android/ims/internal/uce/options/IOptionsListener;Lcom/android/ims/internal/uce/common/UceLong;)Lcom/android/ims/internal/uce/common/StatusCode;
-Lcom/android/ims/internal/uce/options/IOptionsService;->getContactCap(ILjava/lang/String;I)Lcom/android/ims/internal/uce/common/StatusCode;
-Lcom/android/ims/internal/uce/options/IOptionsService;->getContactListCap(I[Ljava/lang/String;I)Lcom/android/ims/internal/uce/common/StatusCode;
-Lcom/android/ims/internal/uce/options/IOptionsService;->getMyInfo(II)Lcom/android/ims/internal/uce/common/StatusCode;
-Lcom/android/ims/internal/uce/options/IOptionsService;->getVersion(I)Lcom/android/ims/internal/uce/common/StatusCode;
-Lcom/android/ims/internal/uce/options/IOptionsService;->removeListener(ILcom/android/ims/internal/uce/common/UceLong;)Lcom/android/ims/internal/uce/common/StatusCode;
-Lcom/android/ims/internal/uce/options/IOptionsService;->responseIncomingOptions(IIILjava/lang/String;Lcom/android/ims/internal/uce/options/OptionsCapInfo;Z)Lcom/android/ims/internal/uce/common/StatusCode;
-Lcom/android/ims/internal/uce/options/IOptionsService;->setMyInfo(ILcom/android/ims/internal/uce/common/CapInfo;I)Lcom/android/ims/internal/uce/common/StatusCode;
-Lcom/android/ims/internal/uce/presence/IPresenceListener;->capInfoReceived(Ljava/lang/String;[Lcom/android/ims/internal/uce/presence/PresTupleInfo;)V
-Lcom/android/ims/internal/uce/presence/IPresenceListener;->cmdStatus(Lcom/android/ims/internal/uce/presence/PresCmdStatus;)V
-Lcom/android/ims/internal/uce/presence/IPresenceListener;->getVersionCb(Ljava/lang/String;)V
-Lcom/android/ims/internal/uce/presence/IPresenceListener;->listCapInfoReceived(Lcom/android/ims/internal/uce/presence/PresRlmiInfo;[Lcom/android/ims/internal/uce/presence/PresResInfo;)V
-Lcom/android/ims/internal/uce/presence/IPresenceListener;->publishTriggering(Lcom/android/ims/internal/uce/presence/PresPublishTriggerType;)V
-Lcom/android/ims/internal/uce/presence/IPresenceListener;->serviceAvailable(Lcom/android/ims/internal/uce/common/StatusCode;)V
-Lcom/android/ims/internal/uce/presence/IPresenceListener;->serviceUnAvailable(Lcom/android/ims/internal/uce/common/StatusCode;)V
-Lcom/android/ims/internal/uce/presence/IPresenceListener;->sipResponseReceived(Lcom/android/ims/internal/uce/presence/PresSipResponse;)V
-Lcom/android/ims/internal/uce/presence/IPresenceListener;->unpublishMessageSent()V
Lcom/android/ims/internal/uce/presence/IPresenceService$Stub;-><init>()V
-Lcom/android/ims/internal/uce/presence/IPresenceService;->addListener(ILcom/android/ims/internal/uce/presence/IPresenceListener;Lcom/android/ims/internal/uce/common/UceLong;)Lcom/android/ims/internal/uce/common/StatusCode;
-Lcom/android/ims/internal/uce/presence/IPresenceService;->getContactCap(ILjava/lang/String;I)Lcom/android/ims/internal/uce/common/StatusCode;
-Lcom/android/ims/internal/uce/presence/IPresenceService;->getContactListCap(I[Ljava/lang/String;I)Lcom/android/ims/internal/uce/common/StatusCode;
-Lcom/android/ims/internal/uce/presence/IPresenceService;->getVersion(I)Lcom/android/ims/internal/uce/common/StatusCode;
-Lcom/android/ims/internal/uce/presence/IPresenceService;->publishMyCap(ILcom/android/ims/internal/uce/presence/PresCapInfo;I)Lcom/android/ims/internal/uce/common/StatusCode;
-Lcom/android/ims/internal/uce/presence/IPresenceService;->reenableService(II)Lcom/android/ims/internal/uce/common/StatusCode;
-Lcom/android/ims/internal/uce/presence/IPresenceService;->removeListener(ILcom/android/ims/internal/uce/common/UceLong;)Lcom/android/ims/internal/uce/common/StatusCode;
-Lcom/android/ims/internal/uce/presence/IPresenceService;->setNewFeatureTag(ILjava/lang/String;Lcom/android/ims/internal/uce/presence/PresServiceInfo;I)Lcom/android/ims/internal/uce/common/StatusCode;
Lcom/android/ims/internal/uce/uceservice/IUceListener$Stub;-><init>()V
-Lcom/android/ims/internal/uce/uceservice/IUceListener;->setStatus(I)V
Lcom/android/ims/internal/uce/uceservice/IUceService$Stub;-><init>()V
-Lcom/android/ims/internal/uce/uceservice/IUceService;->createOptionsService(Lcom/android/ims/internal/uce/options/IOptionsListener;Lcom/android/ims/internal/uce/common/UceLong;)I
-Lcom/android/ims/internal/uce/uceservice/IUceService;->createPresenceService(Lcom/android/ims/internal/uce/presence/IPresenceListener;Lcom/android/ims/internal/uce/common/UceLong;)I
-Lcom/android/ims/internal/uce/uceservice/IUceService;->destroyOptionsService(I)V
-Lcom/android/ims/internal/uce/uceservice/IUceService;->destroyPresenceService(I)V
-Lcom/android/ims/internal/uce/uceservice/IUceService;->getOptionsService()Lcom/android/ims/internal/uce/options/IOptionsService;
-Lcom/android/ims/internal/uce/uceservice/IUceService;->getPresenceService()Lcom/android/ims/internal/uce/presence/IPresenceService;
-Lcom/android/ims/internal/uce/uceservice/IUceService;->getServiceStatus()Z
-Lcom/android/ims/internal/uce/uceservice/IUceService;->isServiceStarted()Z
-Lcom/android/ims/internal/uce/uceservice/IUceService;->startService(Lcom/android/ims/internal/uce/uceservice/IUceListener;)Z
-Lcom/android/ims/internal/uce/uceservice/IUceService;->stopService()Z
Lcom/android/internal/app/AlertActivity;-><init>()V
Lcom/android/internal/app/AlertActivity;->mAlert:Lcom/android/internal/app/AlertController;
Lcom/android/internal/app/AlertActivity;->mAlertParams:Lcom/android/internal/app/AlertController$AlertParams;
@@ -1796,22 +1358,12 @@
Lcom/android/internal/app/IAppOpsService$Stub;->TRANSACTION_startOperation:I
Lcom/android/internal/app/IAppOpsService$Stub;->TRANSACTION_startWatchingMode:I
Lcom/android/internal/app/IAppOpsService$Stub;->TRANSACTION_stopWatchingMode:I
-Lcom/android/internal/app/IAppOpsService;->finishOperation(Landroid/os/IBinder;IILjava/lang/String;)V
-Lcom/android/internal/app/IAppOpsService;->getOpsForPackage(ILjava/lang/String;[I)Ljava/util/List;
-Lcom/android/internal/app/IAppOpsService;->getPackagesForOps([I)Ljava/util/List;
-Lcom/android/internal/app/IAppOpsService;->resetAllModes(ILjava/lang/String;)V
-Lcom/android/internal/app/IAppOpsService;->setMode(IILjava/lang/String;I)V
Lcom/android/internal/app/IBatteryStats$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
Lcom/android/internal/app/IBatteryStats$Stub;->asInterface(Landroid/os/IBinder;)Lcom/android/internal/app/IBatteryStats;
-Lcom/android/internal/app/IBatteryStats;->computeChargeTimeRemaining()J
-Lcom/android/internal/app/IBatteryStats;->getAwakeTimeBattery()J
-Lcom/android/internal/app/IBatteryStats;->getStatistics()[B
-Lcom/android/internal/app/IBatteryStats;->isCharging()Z
Lcom/android/internal/app/IMediaContainerService$Stub;->asInterface(Landroid/os/IBinder;)Lcom/android/internal/app/IMediaContainerService;
Lcom/android/internal/app/IntentForwarderActivity;->TAG:Ljava/lang/String;
Lcom/android/internal/app/IVoiceInteractionManagerService$Stub$Proxy;->showSessionFromSession(Landroid/os/IBinder;Landroid/os/Bundle;I)Z
Lcom/android/internal/app/IVoiceInteractionManagerService$Stub;->asInterface(Landroid/os/IBinder;)Lcom/android/internal/app/IVoiceInteractionManagerService;
-Lcom/android/internal/app/IVoiceInteractionManagerService;->getKeyphraseSoundModel(ILjava/lang/String;)Landroid/hardware/soundtrigger/SoundTrigger$KeyphraseSoundModel;
Lcom/android/internal/app/LocaleHelper$LocaleInfoComparator;-><init>(Ljava/util/Locale;Z)V
Lcom/android/internal/app/LocaleHelper$LocaleInfoComparator;->compare(Lcom/android/internal/app/LocaleStore$LocaleInfo;Lcom/android/internal/app/LocaleStore$LocaleInfo;)I
Lcom/android/internal/app/LocaleHelper;->getDisplayCountry(Ljava/util/Locale;Ljava/util/Locale;)Ljava/lang/String;
@@ -1839,10 +1391,6 @@
Lcom/android/internal/app/WindowDecorActionBar;->setShowHideAnimationEnabled(Z)V
Lcom/android/internal/appwidget/IAppWidgetService$Stub;->asInterface(Landroid/os/IBinder;)Lcom/android/internal/appwidget/IAppWidgetService;
Lcom/android/internal/appwidget/IAppWidgetService$Stub;->TRANSACTION_bindAppWidgetId:I
-Lcom/android/internal/appwidget/IAppWidgetService;->bindAppWidgetId(Ljava/lang/String;IILandroid/content/ComponentName;Landroid/os/Bundle;)Z
-Lcom/android/internal/appwidget/IAppWidgetService;->bindRemoteViewsService(Ljava/lang/String;ILandroid/content/Intent;Landroid/app/IApplicationThread;Landroid/os/IBinder;Landroid/app/IServiceConnection;I)Z
-Lcom/android/internal/appwidget/IAppWidgetService;->getAppWidgetIds(Landroid/content/ComponentName;)[I
-Lcom/android/internal/appwidget/IAppWidgetService;->getAppWidgetViews(Ljava/lang/String;I)Landroid/widget/RemoteViews;
Lcom/android/internal/backup/IBackupTransport$Stub;-><init>()V
Lcom/android/internal/backup/LocalTransport;->mDataDir:Ljava/io/File;
Lcom/android/internal/backup/LocalTransport;->mRestorePackage:I
@@ -1862,13 +1410,6 @@
Lcom/android/internal/location/GpsNetInitiatedHandler;->mIsHexInput:Z
Lcom/android/internal/location/ILocationProvider$Stub;-><init>()V
Lcom/android/internal/location/ILocationProvider$Stub;->asInterface(Landroid/os/IBinder;)Lcom/android/internal/location/ILocationProvider;
-Lcom/android/internal/location/ILocationProvider;->disable()V
-Lcom/android/internal/location/ILocationProvider;->enable()V
-Lcom/android/internal/location/ILocationProvider;->getProperties()Lcom/android/internal/location/ProviderProperties;
-Lcom/android/internal/location/ILocationProvider;->getStatus(Landroid/os/Bundle;)I
-Lcom/android/internal/location/ILocationProvider;->getStatusUpdateTime()J
-Lcom/android/internal/location/ILocationProvider;->sendExtraCommand(Ljava/lang/String;Landroid/os/Bundle;)Z
-Lcom/android/internal/location/ILocationProvider;->setRequest(Lcom/android/internal/location/ProviderRequest;Landroid/os/WorkSource;)V
Lcom/android/internal/logging/MetricsLogger;-><init>()V
Lcom/android/internal/net/LegacyVpnInfo;-><init>()V
Lcom/android/internal/net/VpnConfig;-><init>()V
@@ -1880,7 +1421,6 @@
Lcom/android/internal/os/BinderInternal;->handleGc()V
Lcom/android/internal/os/ClassLoaderFactory;->createClassloaderNamespace(Ljava/lang/ClassLoader;ILjava/lang/String;Ljava/lang/String;ZZ)Ljava/lang/String;
Lcom/android/internal/os/IDropBoxManagerService$Stub;->asInterface(Landroid/os/IBinder;)Lcom/android/internal/os/IDropBoxManagerService;
-Lcom/android/internal/os/IDropBoxManagerService;->getNextEntry(Ljava/lang/String;J)Landroid/os/DropBoxManager$Entry;
Lcom/android/internal/os/ProcessCpuTracker$Stats;->name:Ljava/lang/String;
Lcom/android/internal/os/ProcessCpuTracker$Stats;->rel_stime:I
Lcom/android/internal/os/ProcessCpuTracker$Stats;->rel_uptime:J
@@ -1906,8 +1446,6 @@
Lcom/android/internal/policy/DecorView;->mLastRightInset:I
Lcom/android/internal/policy/DecorView;->mWindow:Lcom/android/internal/policy/PhoneWindow;
Lcom/android/internal/policy/IKeyguardService$Stub;->asInterface(Landroid/os/IBinder;)Lcom/android/internal/policy/IKeyguardService;
-Lcom/android/internal/policy/IKeyguardService;->doKeyguardTimeout(Landroid/os/Bundle;)V
-Lcom/android/internal/policy/IKeyguardService;->setKeyguardEnabled(Z)V
Lcom/android/internal/policy/IKeyguardStateCallback$Stub;->asInterface(Landroid/os/IBinder;)Lcom/android/internal/policy/IKeyguardStateCallback;
Lcom/android/internal/policy/PhoneFallbackEventHandler;-><init>(Landroid/content/Context;)V
Lcom/android/internal/policy/PhoneFallbackEventHandler;->mContext:Landroid/content/Context;
@@ -2362,14 +1900,7 @@
Lcom/android/internal/statusbar/IStatusBar$Stub;->asInterface(Landroid/os/IBinder;)Lcom/android/internal/statusbar/IStatusBar;
Lcom/android/internal/statusbar/IStatusBarService$Stub;-><init>()V
Lcom/android/internal/statusbar/IStatusBarService$Stub;->asInterface(Landroid/os/IBinder;)Lcom/android/internal/statusbar/IStatusBarService;
-Lcom/android/internal/statusbar/IStatusBarService;->collapsePanels()V
-Lcom/android/internal/statusbar/IStatusBarService;->disable(ILandroid/os/IBinder;Ljava/lang/String;)V
-Lcom/android/internal/statusbar/IStatusBarService;->expandNotificationsPanel()V
-Lcom/android/internal/statusbar/IStatusBarService;->handleSystemKey(I)V
-Lcom/android/internal/statusbar/IStatusBarService;->removeIcon(Ljava/lang/String;)V
-Lcom/android/internal/statusbar/IStatusBarService;->setIconVisibility(Ljava/lang/String;Z)V
Lcom/android/internal/telecom/ITelecomService$Stub;->asInterface(Landroid/os/IBinder;)Lcom/android/internal/telecom/ITelecomService;
-Lcom/android/internal/telecom/ITelecomService;->getCallState()I
Lcom/android/internal/telephony/BaseCommands;->mCallStateRegistrants:Landroid/os/RegistrantList;
Lcom/android/internal/telephony/BaseCommands;->mCallWaitingInfoRegistrants:Landroid/os/RegistrantList;
Lcom/android/internal/telephony/BaseCommands;->mCatCallSetUpRegistrant:Landroid/os/Registrant;
@@ -2996,7 +2527,6 @@
Lcom/android/internal/telephony/GsmCdmaPhone;->notifyServiceStateChanged(Landroid/telephony/ServiceState;)V
Lcom/android/internal/telephony/GsmCdmaPhone;->setOnEcbModeExitResponse(Landroid/os/Handler;ILjava/lang/Object;)V
Lcom/android/internal/telephony/GsmCdmaPhone;->syncClirSetting()V
-Lcom/android/internal/telephony/ICarrierConfigLoader;->getConfigForSubId(ILjava/lang/String;)Landroid/os/PersistableBundle;
Lcom/android/internal/telephony/IccCard;->getState()Lcom/android/internal/telephony/IccCardConstants$State;
Lcom/android/internal/telephony/IccCard;->registerForNetworkLocked(Landroid/os/Handler;ILjava/lang/Object;)V
Lcom/android/internal/telephony/IccCard;->supplyNetworkDepersonalization(Ljava/lang/String;Landroid/os/Message;)V
@@ -3202,16 +2732,10 @@
Lcom/android/internal/telephony/IPhoneSubInfo$Stub$Proxy;->getDeviceId(Ljava/lang/String;)Ljava/lang/String;
Lcom/android/internal/telephony/IPhoneSubInfo$Stub;->asInterface(Landroid/os/IBinder;)Lcom/android/internal/telephony/IPhoneSubInfo;
Lcom/android/internal/telephony/IPhoneSubInfo$Stub;->TRANSACTION_getDeviceId:I
-Lcom/android/internal/telephony/IPhoneSubInfo;->getIccSerialNumber(Ljava/lang/String;)Ljava/lang/String;
-Lcom/android/internal/telephony/IPhoneSubInfo;->getSubscriberId(Ljava/lang/String;)Ljava/lang/String;
Lcom/android/internal/telephony/ISms$Stub;-><init>()V
Lcom/android/internal/telephony/ISms$Stub;->asInterface(Landroid/os/IBinder;)Lcom/android/internal/telephony/ISms;
Lcom/android/internal/telephony/ISub$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
Lcom/android/internal/telephony/ISub$Stub;->asInterface(Landroid/os/IBinder;)Lcom/android/internal/telephony/ISub;
-Lcom/android/internal/telephony/ISub;->getActiveSubIdList()[I
-Lcom/android/internal/telephony/ISub;->getDefaultDataSubId()I
-Lcom/android/internal/telephony/ISub;->getDefaultSubId()I
-Lcom/android/internal/telephony/ISub;->setDefaultDataSubId(I)V
Lcom/android/internal/telephony/ITelephony$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
Lcom/android/internal/telephony/ITelephony$Stub$Proxy;->getDeviceId(Ljava/lang/String;)Ljava/lang/String;
Lcom/android/internal/telephony/ITelephony$Stub$Proxy;->isRadioOn(Ljava/lang/String;)Z
@@ -3221,38 +2745,9 @@
Lcom/android/internal/telephony/ITelephony$Stub;->TRANSACTION_call:I
Lcom/android/internal/telephony/ITelephony$Stub;->TRANSACTION_dial:I
Lcom/android/internal/telephony/ITelephony$Stub;->TRANSACTION_getDeviceId:I
-Lcom/android/internal/telephony/ITelephony;->call(Ljava/lang/String;Ljava/lang/String;)V
-Lcom/android/internal/telephony/ITelephony;->dial(Ljava/lang/String;)V
-Lcom/android/internal/telephony/ITelephony;->disableDataConnectivity()Z
-Lcom/android/internal/telephony/ITelephony;->disableLocationUpdates()V
-Lcom/android/internal/telephony/ITelephony;->enableDataConnectivity()Z
-Lcom/android/internal/telephony/ITelephony;->enableLocationUpdates()V
-Lcom/android/internal/telephony/ITelephony;->getActivePhoneType()I
-Lcom/android/internal/telephony/ITelephony;->getCallState()I
-Lcom/android/internal/telephony/ITelephony;->getDataActivity()I
-Lcom/android/internal/telephony/ITelephony;->getDataEnabled(I)Z
-Lcom/android/internal/telephony/ITelephony;->getDataState()I
-Lcom/android/internal/telephony/ITelephony;->getNetworkType()I
-Lcom/android/internal/telephony/ITelephony;->handlePinMmi(Ljava/lang/String;)Z
-Lcom/android/internal/telephony/ITelephony;->handlePinMmiForSubscriber(ILjava/lang/String;)Z
-Lcom/android/internal/telephony/ITelephony;->hasIccCard()Z
-Lcom/android/internal/telephony/ITelephony;->iccCloseLogicalChannel(II)Z
-Lcom/android/internal/telephony/ITelephony;->iccTransmitApduLogicalChannel(IIIIIIILjava/lang/String;)Ljava/lang/String;
-Lcom/android/internal/telephony/ITelephony;->isRadioOnForSubscriber(ILjava/lang/String;)Z
-Lcom/android/internal/telephony/ITelephony;->setRadio(Z)Z
-Lcom/android/internal/telephony/ITelephony;->supplyPin(Ljava/lang/String;)Z
-Lcom/android/internal/telephony/ITelephony;->toggleRadioOnOff()V
-Lcom/android/internal/telephony/ITelephony;->updateServiceLocation()V
Lcom/android/internal/telephony/ITelephonyRegistry$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
Lcom/android/internal/telephony/ITelephonyRegistry$Stub;->asInterface(Landroid/os/IBinder;)Lcom/android/internal/telephony/ITelephonyRegistry;
-Lcom/android/internal/telephony/ITelephonyRegistry;->listen(Ljava/lang/String;Lcom/android/internal/telephony/IPhoneStateListener;IZ)V
-Lcom/android/internal/telephony/ITelephonyRegistry;->notifyCallState(ILjava/lang/String;)V
-Lcom/android/internal/telephony/ITelephonyRegistry;->notifyCellInfo(Ljava/util/List;)V
-Lcom/android/internal/telephony/ITelephonyRegistry;->notifyDataConnectionFailed(Ljava/lang/String;)V
Lcom/android/internal/telephony/IWapPushManager$Stub;->asInterface(Landroid/os/IBinder;)Lcom/android/internal/telephony/IWapPushManager;
-Lcom/android/internal/telephony/IWapPushManager;->addPackage(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;IZZ)Z
-Lcom/android/internal/telephony/IWapPushManager;->deletePackage(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Z
-Lcom/android/internal/telephony/IWapPushManager;->updatePackage(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;IZZ)Z
Lcom/android/internal/telephony/MccTable$MccEntry;->mIso:Ljava/lang/String;
Lcom/android/internal/telephony/MccTable;->countryCodeForMcc(I)Ljava/lang/String;
Lcom/android/internal/telephony/MccTable;->defaultLanguageForMcc(I)Ljava/lang/String;
@@ -3447,7 +2942,6 @@
Lcom/android/internal/telephony/ServiceStateTracker;->isInvalidOperatorNumeric(Ljava/lang/String;)Z
Lcom/android/internal/telephony/ServiceStateTracker;->log(Ljava/lang/String;)V
Lcom/android/internal/telephony/ServiceStateTracker;->loge(Ljava/lang/String;)V
-Lcom/android/internal/telephony/ServiceStateTracker;->mAttachedRegistrants:Landroid/os/RegistrantList;
Lcom/android/internal/telephony/ServiceStateTracker;->mCi:Lcom/android/internal/telephony/CommandsInterface;
Lcom/android/internal/telephony/ServiceStateTracker;->mCr:Landroid/content/ContentResolver;
Lcom/android/internal/telephony/ServiceStateTracker;->mCurDataSpn:Ljava/lang/String;
@@ -3459,7 +2953,6 @@
Lcom/android/internal/telephony/ServiceStateTracker;->mDataRoamingOnRegistrants:Landroid/os/RegistrantList;
Lcom/android/internal/telephony/ServiceStateTracker;->mDefaultRoamingIndicator:I
Lcom/android/internal/telephony/ServiceStateTracker;->mDesiredPowerState:Z
-Lcom/android/internal/telephony/ServiceStateTracker;->mDetachedRegistrants:Landroid/os/RegistrantList;
Lcom/android/internal/telephony/ServiceStateTracker;->mDeviceShuttingDown:Z
Lcom/android/internal/telephony/ServiceStateTracker;->mEmergencyOnly:Z
Lcom/android/internal/telephony/ServiceStateTracker;->mIccRecords:Lcom/android/internal/telephony/uicc/IccRecords;
@@ -3487,7 +2980,6 @@
Lcom/android/internal/telephony/ServiceStateTracker;->mUiccController:Lcom/android/internal/telephony/uicc/UiccController;
Lcom/android/internal/telephony/ServiceStateTracker;->mVoiceRoamingOffRegistrants:Landroid/os/RegistrantList;
Lcom/android/internal/telephony/ServiceStateTracker;->mVoiceRoamingOnRegistrants:Landroid/os/RegistrantList;
-Lcom/android/internal/telephony/ServiceStateTracker;->notifyDataRegStateRilRadioTechnologyChanged()V
Lcom/android/internal/telephony/ServiceStateTracker;->notifySignalStrength()Z
Lcom/android/internal/telephony/ServiceStateTracker;->pollState()V
Lcom/android/internal/telephony/ServiceStateTracker;->reRegisterNetwork(Landroid/os/Message;)V
@@ -4047,23 +3539,7 @@
Lcom/android/internal/widget/ActionBarOverlayLayout;->setWindowCallback(Landroid/view/Window$Callback;)V
Lcom/android/internal/widget/EditableInputConnection;-><init>(Landroid/widget/TextView;)V
Lcom/android/internal/widget/ILockSettings$Stub;->asInterface(Landroid/os/IBinder;)Lcom/android/internal/widget/ILockSettings;
-Lcom/android/internal/widget/ILockSettings;->getBoolean(Ljava/lang/String;ZI)Z
-Lcom/android/internal/widget/ILockSettings;->getLong(Ljava/lang/String;JI)J
-Lcom/android/internal/widget/ILockSettings;->getString(Ljava/lang/String;Ljava/lang/String;I)Ljava/lang/String;
-Lcom/android/internal/widget/ILockSettings;->havePassword(I)Z
-Lcom/android/internal/widget/ILockSettings;->havePattern(I)Z
-Lcom/android/internal/widget/ILockSettings;->setBoolean(Ljava/lang/String;ZI)V
-Lcom/android/internal/widget/ILockSettings;->setLong(Ljava/lang/String;JI)V
-Lcom/android/internal/widget/ILockSettings;->setString(Ljava/lang/String;Ljava/lang/String;I)V
Lcom/android/internal/widget/IRemoteViewsFactory$Stub;->asInterface(Landroid/os/IBinder;)Lcom/android/internal/widget/IRemoteViewsFactory;
-Lcom/android/internal/widget/IRemoteViewsFactory;->getCount()I
-Lcom/android/internal/widget/IRemoteViewsFactory;->getItemId(I)J
-Lcom/android/internal/widget/IRemoteViewsFactory;->getLoadingView()Landroid/widget/RemoteViews;
-Lcom/android/internal/widget/IRemoteViewsFactory;->getViewAt(I)Landroid/widget/RemoteViews;
-Lcom/android/internal/widget/IRemoteViewsFactory;->getViewTypeCount()I
-Lcom/android/internal/widget/IRemoteViewsFactory;->hasStableIds()Z
-Lcom/android/internal/widget/IRemoteViewsFactory;->isCreated()Z
-Lcom/android/internal/widget/IRemoteViewsFactory;->onDataSetChanged()V
Lcom/android/internal/widget/LinearLayoutWithDefaultTouchRecepient;-><init>(Landroid/content/Context;)V
Lcom/android/internal/widget/LinearLayoutWithDefaultTouchRecepient;->setDefaultTouchRecepient(Landroid/view/View;)V
Lcom/android/internal/widget/LockPatternChecker;->checkPassword(Lcom/android/internal/widget/LockPatternUtils;Ljava/lang/String;ILcom/android/internal/widget/LockPatternChecker$OnCheckCallback;)Landroid/os/AsyncTask;
@@ -4596,9 +4072,6 @@
Lgov/nist/javax/sip/address/SipUri;->setUserParam(Ljava/lang/String;)V
Lgov/nist/javax/sip/parser/URLParser;-><init>(Ljava/lang/String;)V
Lgov/nist/javax/sip/parser/URLParser;->sipURL(Z)Lgov/nist/javax/sip/address/SipUri;
-Ljunit/framework/TestCase;->fName:Ljava/lang/String;
-Ljunit/framework/TestSuite;->isPublicTestMethod(Ljava/lang/reflect/Method;)Z
-Ljunit/framework/TestSuite;->isTestMethod(Ljava/lang/reflect/Method;)Z
Lorg/apache/xalan/extensions/ExpressionContext;->getContextNode()Lorg/w3c/dom/Node;
Lorg/apache/xalan/extensions/ExpressionContext;->getErrorListener()Ljavax/xml/transform/ErrorListener;
Lorg/apache/xalan/extensions/ExpressionContext;->getVariableOrParam(Lorg/apache/xml/utils/QName;)Lorg/apache/xpath/objects/XObject;
diff --git a/core/java/android/accounts/IAccountAuthenticator.aidl b/core/java/android/accounts/IAccountAuthenticator.aidl
index 8b98ca2..701cecf 100644
--- a/core/java/android/accounts/IAccountAuthenticator.aidl
+++ b/core/java/android/accounts/IAccountAuthenticator.aidl
@@ -28,47 +28,55 @@
/**
* prompts the user for account information and adds the result to the IAccountManager
*/
+ @UnsupportedAppUsage
void addAccount(in IAccountAuthenticatorResponse response, String accountType,
String authTokenType, in String[] requiredFeatures, in Bundle options);
/**
* prompts the user for the credentials of the account
*/
+ @UnsupportedAppUsage
void confirmCredentials(in IAccountAuthenticatorResponse response, in Account account,
in Bundle options);
/**
* gets the password by either prompting the user or querying the IAccountManager
*/
+ @UnsupportedAppUsage
void getAuthToken(in IAccountAuthenticatorResponse response, in Account account,
String authTokenType, in Bundle options);
/**
* Gets the user-visible label of the given authtoken type.
*/
+ @UnsupportedAppUsage
void getAuthTokenLabel(in IAccountAuthenticatorResponse response, String authTokenType);
/**
* prompts the user for a new password and writes it to the IAccountManager
*/
+ @UnsupportedAppUsage
void updateCredentials(in IAccountAuthenticatorResponse response, in Account account,
String authTokenType, in Bundle options);
/**
* launches an activity that lets the user edit and set the properties for an authenticator
*/
+ @UnsupportedAppUsage
void editProperties(in IAccountAuthenticatorResponse response, String accountType);
/**
* returns a Bundle where the boolean value BOOLEAN_RESULT_KEY is set if the account has the
* specified features
*/
+ @UnsupportedAppUsage
void hasFeatures(in IAccountAuthenticatorResponse response, in Account account,
in String[] features);
/**
* Gets whether or not the account is allowed to be removed.
*/
+ @UnsupportedAppUsage
void getAccountRemovalAllowed(in IAccountAuthenticatorResponse response, in Account account);
/**
diff --git a/core/java/android/accounts/IAccountAuthenticatorResponse.aidl b/core/java/android/accounts/IAccountAuthenticatorResponse.aidl
index 0c75e50..fbc8e5d 100644
--- a/core/java/android/accounts/IAccountAuthenticatorResponse.aidl
+++ b/core/java/android/accounts/IAccountAuthenticatorResponse.aidl
@@ -22,7 +22,10 @@
* @hide
*/
oneway interface IAccountAuthenticatorResponse {
+ @UnsupportedAppUsage
void onResult(in Bundle value);
+ @UnsupportedAppUsage
void onRequestContinued();
+ @UnsupportedAppUsage
void onError(int errorCode, String errorMessage);
}
diff --git a/core/java/android/accounts/IAccountManagerResponse.aidl b/core/java/android/accounts/IAccountManagerResponse.aidl
index ca1203d..11d0c02 100644
--- a/core/java/android/accounts/IAccountManagerResponse.aidl
+++ b/core/java/android/accounts/IAccountManagerResponse.aidl
@@ -22,6 +22,8 @@
* @hide
*/
oneway interface IAccountManagerResponse {
+ @UnsupportedAppUsage
void onResult(in Bundle value);
+ @UnsupportedAppUsage
void onError(int errorCode, String errorMessage);
}
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java
index af451c2..9bc719e 100644
--- a/core/java/android/app/ActivityThread.java
+++ b/core/java/android/app/ActivityThread.java
@@ -300,7 +300,6 @@
String[] mInstrumentedSplitAppDirs = null;
String mInstrumentedLibDir = null;
boolean mSystemThread = false;
- boolean mJitEnabled = false;
boolean mSomeActivitiesChanged = false;
boolean mUpdatingSystemConfig = false;
/* package */ boolean mHiddenApiWarningShown = false;
@@ -1633,7 +1632,6 @@
public static final int SUICIDE = 130;
@UnsupportedAppUsage
public static final int REMOVE_PROVIDER = 131;
- public static final int ENABLE_JIT = 132;
public static final int DISPATCH_PACKAGE_BROADCAST = 133;
@UnsupportedAppUsage
public static final int SCHEDULE_CRASH = 134;
@@ -1683,7 +1681,6 @@
case DESTROY_BACKUP_AGENT: return "DESTROY_BACKUP_AGENT";
case SUICIDE: return "SUICIDE";
case REMOVE_PROVIDER: return "REMOVE_PROVIDER";
- case ENABLE_JIT: return "ENABLE_JIT";
case DISPATCH_PACKAGE_BROADCAST: return "DISPATCH_PACKAGE_BROADCAST";
case SCHEDULE_CRASH: return "SCHEDULE_CRASH";
case DUMP_HEAP: return "DUMP_HEAP";
@@ -1795,9 +1792,6 @@
completeRemoveProvider((ProviderRefCount)msg.obj);
Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER);
break;
- case ENABLE_JIT:
- ensureJitEnabled();
- break;
case DISPATCH_PACKAGE_BROADCAST:
Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "broadcastPackage");
handleDispatchPackageBroadcast(msg.arg1, (String[])msg.obj);
@@ -1933,7 +1927,6 @@
if (stopProfiling) {
mProfiler.stopProfiling();
}
- ensureJitEnabled();
return false;
}
}
@@ -2258,13 +2251,6 @@
}
}
- void ensureJitEnabled() {
- if (!mJitEnabled) {
- mJitEnabled = true;
- dalvik.system.VMRuntime.getRuntime().startJitCompilation();
- }
- }
-
@UnsupportedAppUsage
void scheduleGcIdler() {
if (!mGcIdlerScheduled) {
@@ -3690,7 +3676,6 @@
ActivityManager.getService().serviceDoneExecuting(
data.token, SERVICE_DONE_EXECUTING_ANON, 0, 0);
}
- ensureJitEnabled();
} catch (RemoteException ex) {
throw ex.rethrowFromSystemServer();
}
@@ -3804,7 +3789,6 @@
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
- ensureJitEnabled();
} catch (Exception e) {
if (!mInstrumentation.onException(s, e)) {
throw new RuntimeException(
@@ -5979,9 +5963,6 @@
if (!data.restrictedBackupMode) {
if (!ArrayUtils.isEmpty(data.providers)) {
installContentProviders(app, data.providers);
- // For process that contains content providers, we want to
- // ensure that the JIT is enabled "at some point".
- mH.sendEmptyMessageDelayed(H.ENABLE_JIT, 10*1000);
}
}
@@ -6614,12 +6595,6 @@
sCurrentActivityThread = this;
mSystemThread = system;
if (!system) {
- ViewRootImpl.addFirstDrawHandler(new Runnable() {
- @Override
- public void run() {
- ensureJitEnabled();
- }
- });
android.ddm.DdmHandleAppName.setAppName("<pre-initialized>",
UserHandle.myUserId());
RuntimeInit.setApplicationObject(mAppThread.asBinder());
diff --git a/core/java/android/app/ContextImpl.java b/core/java/android/app/ContextImpl.java
index 2256840..d6fd619 100644
--- a/core/java/android/app/ContextImpl.java
+++ b/core/java/android/app/ContextImpl.java
@@ -98,6 +98,7 @@
import java.util.concurrent.Executor;
class ReceiverRestrictedContext extends ContextWrapper {
+ @UnsupportedAppUsage
ReceiverRestrictedContext(Context base) {
super(base);
}
diff --git a/core/java/android/app/DownloadManager.java b/core/java/android/app/DownloadManager.java
index 1622c06..5b53bd0 100644
--- a/core/java/android/app/DownloadManager.java
+++ b/core/java/android/app/DownloadManager.java
@@ -1150,6 +1150,7 @@
* @param ids the IDs of the downloads
* @hide
*/
+ @UnsupportedAppUsage
public void restartDownload(long... ids) {
Cursor cursor = query(new Query().setFilterById(ids));
try {
diff --git a/core/java/android/app/IActivityManager.aidl b/core/java/android/app/IActivityManager.aidl
index 52fd841..8b84263 100644
--- a/core/java/android/app/IActivityManager.aidl
+++ b/core/java/android/app/IActivityManager.aidl
@@ -103,13 +103,17 @@
int startActivity(in IApplicationThread caller, in String callingPackage, in Intent intent,
in String resolvedType, in IBinder resultTo, in String resultWho, int requestCode,
int flags, in ProfilerInfo profilerInfo, in Bundle options);
+ @UnsupportedAppUsage
void unhandledBack();
boolean finishActivity(in IBinder token, int code, in Intent data, int finishTask);
+ @UnsupportedAppUsage
Intent registerReceiver(in IApplicationThread caller, in String callerPackage,
in IIntentReceiver receiver, in IntentFilter filter,
in String requiredPermission, int userId, int flags);
+ @UnsupportedAppUsage
void unregisterReceiver(in IIntentReceiver receiver);
+ @UnsupportedAppUsage
int broadcastIntent(in IApplicationThread caller, in Intent intent,
in String resolvedType, in IIntentReceiver resultTo, int resultCode,
in String resultData, in Bundle map, in String[] requiredPermissions,
@@ -126,13 +130,16 @@
String getCallingPackage(in IBinder token);
ComponentName getCallingActivity(in IBinder token);
List<ActivityManager.RunningTaskInfo> getTasks(int maxNum);
+ @UnsupportedAppUsage
List<ActivityManager.RunningTaskInfo> getFilteredTasks(int maxNum, int ignoreActivityType,
int ignoreWindowingMode);
+ @UnsupportedAppUsage
void moveTaskToFront(int task, int flags, in Bundle options);
void moveTaskBackwards(int task);
int getTaskForActivity(in IBinder token, in boolean onlyRoot);
ContentProviderHolder getContentProvider(in IApplicationThread caller,
in String name, int userId, boolean stable);
+ @UnsupportedAppUsage
void publishContentProviders(in IApplicationThread caller,
in List<ContentProviderHolder> providers);
boolean refContentProvider(in IBinder connection, int stableDelta, int unstableDelta);
@@ -140,17 +147,22 @@
PendingIntent getRunningServiceControlPanel(in ComponentName service);
ComponentName startService(in IApplicationThread caller, in Intent service,
in String resolvedType, boolean requireForeground, in String callingPackage, int userId);
+ @UnsupportedAppUsage
int stopService(in IApplicationThread caller, in Intent service,
in String resolvedType, int userId);
int bindService(in IApplicationThread caller, in IBinder token, in Intent service,
in String resolvedType, in IServiceConnection connection, int flags,
in String callingPackage, int userId);
+ @UnsupportedAppUsage
boolean unbindService(in IServiceConnection connection);
void publishService(in IBinder token, in Intent intent, in IBinder service);
void activityResumed(in IBinder token);
+ @UnsupportedAppUsage
void setDebugApp(in String packageName, boolean waitForDebugger, boolean persistent);
void setAgentApp(in String packageName, @nullable String agent);
+ @UnsupportedAppUsage
void setAlwaysFinish(boolean enabled);
+ @UnsupportedAppUsage
boolean startInstrumentation(in ComponentName className, in String profileFile,
int flags, in Bundle arguments, in IInstrumentationWatcher watcher,
in IUiAutomationConnection connection, int userId,
@@ -163,6 +175,7 @@
* system. Corresponds to the configuration of the default display.
* @throws RemoteException
*/
+ @UnsupportedAppUsage
Configuration getConfiguration();
/**
* Updates global configuration and applies changes to the entire system.
@@ -171,12 +184,16 @@
* @throws RemoteException
* @return Returns true if the configuration was updated.
*/
+ @UnsupportedAppUsage
boolean updateConfiguration(in Configuration values);
boolean stopServiceToken(in ComponentName className, in IBinder token, int startId);
ComponentName getActivityClassForToken(in IBinder token);
String getPackageForToken(in IBinder token);
+ @UnsupportedAppUsage
void setProcessLimit(int max);
+ @UnsupportedAppUsage
int getProcessLimit();
+ @UnsupportedAppUsage
int checkPermission(in String permission, int pid, int uid);
int checkUriPermission(in Uri uri, int pid, int uid, int mode, int userId,
in IBinder callerToken);
@@ -184,6 +201,7 @@
int mode, int userId);
void revokeUriPermission(in IApplicationThread caller, in String targetPkg, in Uri uri,
int mode, int userId);
+ @UnsupportedAppUsage
void setActivityController(in IActivityController watcher, boolean imAMonkey);
void showWaitingForDebugger(in IApplicationThread who, boolean waiting);
/*
@@ -192,6 +210,7 @@
*/
void signalPersistentProcesses(int signal);
+ @UnsupportedAppUsage
ParceledListSlice getRecentTasks(int maxNum, int flags, int userId);
oneway void serviceDoneExecuting(in IBinder token, int type, int startId, int res);
oneway void activityDestroyed(in IBinder token);
@@ -219,20 +238,27 @@
List<ActivityManager.ProcessErrorStateInfo> getProcessesInErrorState();
boolean clearApplicationUserData(in String packageName, boolean keepState,
in IPackageDataObserver observer, int userId);
+ @UnsupportedAppUsage
void forceStopPackage(in String packageName, int userId);
boolean killPids(in int[] pids, in String reason, boolean secure);
+ @UnsupportedAppUsage
List<ActivityManager.RunningServiceInfo> getServices(int maxNum, int flags);
ActivityManager.TaskDescription getTaskDescription(int taskId);
// Retrieve running application processes in the system
+ @UnsupportedAppUsage
List<ActivityManager.RunningAppProcessInfo> getRunningAppProcesses();
// Get device configuration
ConfigurationInfo getDeviceConfigurationInfo();
IBinder peekService(in Intent service, in String resolvedType, in String callingPackage);
// Turn on/off profiling in a particular process.
+ @UnsupportedAppUsage
boolean profileControl(in String process, int userId, boolean start,
in ProfilerInfo profilerInfo, int profileType);
+ @UnsupportedAppUsage
boolean shutdown(int timeout);
+ @UnsupportedAppUsage
void stopAppSwitches();
+ @UnsupportedAppUsage
void resumeAppSwitches();
boolean bindBackupAgent(in String packageName, int backupRestoreMode, int userId);
void backupAgentCreated(in String packageName, in IBinder agent);
@@ -242,6 +268,7 @@
boolean requireFull, in String name, in String callerPackage);
void addPackageDependency(in String packageName);
void killApplication(in String pkg, int appId, int userId, in String reason);
+ @UnsupportedAppUsage
void closeSystemDialogs(in String reason);
Debug.MemoryInfo[] getProcessMemoryInfo(in int[] pids);
void killApplicationProcess(in String processName, int uid);
@@ -254,6 +281,7 @@
// Special low-level communication with activity manager.
boolean handleApplicationWtf(in IBinder app, in String tag, boolean system,
in ApplicationErrorReport.ParcelableCrashInfo crashInfo);
+ @UnsupportedAppUsage
void killBackgroundProcesses(in String packageName, int userId);
boolean isUserAMonkey();
WaitResult startActivityAndWait(in IApplicationThread caller, in String callingPackage,
@@ -268,6 +296,7 @@
// Retrieve info of applications installed on external media that are currently
// running.
List<ApplicationInfo> getRunningExternalApplications();
+ @UnsupportedAppUsage
void finishHeavyWeightApp();
// A StrictMode violation to be handled. The violationMask is a
// subset of the original StrictMode policy bitmask, with only the
@@ -279,6 +308,7 @@
void setImmersive(in IBinder token, boolean immersive);
boolean isTopActivityImmersive();
void crashApplication(int uid, int initialPid, in String packageName, int userId, in String message);
+ @UnsupportedAppUsage
String getProviderMimeType(in Uri uri, int userId);
IBinder newUriPermissionOwner(in String name);
void grantUriPermissionFromOwner(in IBinder owner, int fromUid, in String targetPkg,
@@ -292,23 +322,31 @@
int startActivities(in IApplicationThread caller, in String callingPackage,
in Intent[] intents, in String[] resolvedTypes, in IBinder resultTo,
in Bundle options, int userId);
+ @UnsupportedAppUsage
boolean isUserRunning(int userid, int flags);
oneway void activitySlept(in IBinder token);
int getFrontActivityScreenCompatMode();
void setFrontActivityScreenCompatMode(int mode);
int getPackageScreenCompatMode(in String packageName);
+ @UnsupportedAppUsage
void setPackageScreenCompatMode(in String packageName, int mode);
boolean getPackageAskScreenCompat(in String packageName);
void setPackageAskScreenCompat(in String packageName, boolean ask);
+ @UnsupportedAppUsage
boolean switchUser(int userid);
void setFocusedTask(int taskId);
+ @UnsupportedAppUsage
boolean removeTask(int taskId);
+ @UnsupportedAppUsage
void registerProcessObserver(in IProcessObserver observer);
+ @UnsupportedAppUsage
void unregisterProcessObserver(in IProcessObserver observer);
boolean isIntentSenderTargetedToPackage(in IIntentSender sender);
+ @UnsupportedAppUsage
void updatePersistentConfiguration(in Configuration values);
long[] getProcessPss(in int[] pids);
void showBootMessage(in CharSequence msg, boolean always);
+ @UnsupportedAppUsage
void killAllBackgroundProcesses();
ContentProviderHolder getContentProviderExternal(in String name, int userId,
in IBinder token);
@@ -316,6 +354,7 @@
// Get memory information about the calling process.
void getMyMemoryState(out ActivityManager.RunningAppProcessInfo outInfo);
boolean killProcessesBelowForeground(in String reason);
+ @UnsupportedAppUsage
UserInfo getCurrentUser();
boolean shouldUpRecreateTask(in IBinder token, in String destAffinity);
boolean navigateUpTo(in IBinder token, in Intent target, int resultCode,
@@ -336,13 +375,16 @@
// manage your activity to make sure it is always the uid you expect.
int getLaunchedFromUid(in IBinder activityToken);
void unstableProviderDied(in IBinder connection);
+ @UnsupportedAppUsage
boolean isIntentSenderAnActivity(in IIntentSender sender);
boolean isIntentSenderAForegroundService(in IIntentSender sender);
int startActivityAsUser(in IApplicationThread caller, in String callingPackage,
in Intent intent, in String resolvedType, in IBinder resultTo, in String resultWho,
int requestCode, int flags, in ProfilerInfo profilerInfo,
in Bundle options, int userId);
+ @UnsupportedAppUsage
int stopUser(int userid, boolean force, in IStopUserCallback callback);
+ @UnsupportedAppUsage
void registerUserSwitchObserver(in IUserSwitchObserver observer, in String name);
void unregisterUserSwitchObserver(in IUserSwitchObserver observer);
int[] getRunningUserIds();
@@ -350,6 +392,7 @@
// Deprecated - This method is only used by a few internal components and it will soon be
// replaced by a proper bug report API (which will be restricted to a few, pre-defined apps).
// No new code should be calling it.
+ @UnsupportedAppUsage
void requestBugReport(int bugreportType);
/**
@@ -380,6 +423,7 @@
long inputDispatchingTimedOut(int pid, boolean aboveSystem, in String reason);
void clearPendingBackup();
+ @UnsupportedAppUsage
Intent getIntentForIntentSender(in IIntentSender sender);
Bundle getAssistContextExtras(int requestType);
void reportAssistContextExtras(in IBinder token, in Bundle extras,
@@ -399,6 +443,7 @@
* @param toTop If the task should be moved to the top once the windowing mode changes.
*/
void setTaskWindowingMode(int taskId, int windowingMode, boolean toTop);
+ @UnsupportedAppUsage
void moveTaskToStack(int taskId, int stackId, boolean toTop);
/**
* Resizes the input stack id to the given bounds.
@@ -414,8 +459,10 @@
* default animation duration should be used.
* @throws RemoteException
*/
+ @UnsupportedAppUsage
void resizeStack(int stackId, in Rect bounds, boolean allowResizeInDockedMode,
boolean preserveWindows, boolean animate, int animationDuration);
+ @UnsupportedAppUsage
List<ActivityManager.StackInfo> getAllStackInfos();
void setFocusedStack(int stackId);
ActivityManager.StackInfo getFocusedStackInfo();
@@ -424,22 +471,27 @@
boolean convertToTranslucent(in IBinder token, in Bundle options);
void notifyActivityDrawn(in IBinder token);
void reportActivityFullyDrawn(in IBinder token, boolean restoredFromBundle);
+ @UnsupportedAppUsage
void restart();
void performIdleMaintenance();
void takePersistableUriPermission(in Uri uri, int modeFlags, String toPackage, int userId);
void releasePersistableUriPermission(in Uri uri, int modeFlags, String toPackage, int userId);
ParceledListSlice getPersistedUriPermissions(in String packageName, boolean incoming);
void appNotRespondingViaProvider(in IBinder connection);
+ @UnsupportedAppUsage
Rect getTaskBounds(int taskId);
int getActivityDisplayId(in IBinder activityToken);
+ @UnsupportedAppUsage
boolean setProcessMemoryTrimLevel(in String process, int uid, int level);
// Start of L transactions
String getTagForIntentSender(in IIntentSender sender, in String prefix);
+ @UnsupportedAppUsage
boolean startUserInBackground(int userid);
void startLockTaskModeByToken(in IBinder token);
void stopLockTaskModeByToken(in IBinder token);
+ @UnsupportedAppUsage
boolean isInLockTaskMode();
void setTaskDescription(in IBinder token, in ActivityManager.TaskDescription values);
int startVoiceActivity(in String callingPackage, int callingPid, int callingUid,
@@ -448,12 +500,16 @@
in Bundle options, int userId);
int startAssistantActivity(in String callingPackage, int callingPid, int callingUid,
in Intent intent, in String resolvedType, in Bundle options, int userId);
+ @UnsupportedAppUsage
void startRecentsActivity(in Intent intent, in IAssistDataReceiver assistDataReceiver,
in IRecentsAnimationRunner recentsAnimationRunner);
+ @UnsupportedAppUsage
void cancelRecentsAnimation(boolean restoreHomeStackPosition);
+ @UnsupportedAppUsage
int startActivityFromRecents(int taskId, in Bundle options);
Bundle getActivityOptions(in IBinder token);
List<IBinder> getAppTasks(in String callingPackage);
+ @UnsupportedAppUsage
void startSystemLockTaskMode(int taskId);
void stopSystemLockTaskMode();
void finishVoiceTask(in IVoiceInteractionSession session);
@@ -476,17 +532,22 @@
void startInPlaceAnimationOnFrontMostApplication(in Bundle opts);
int checkPermissionWithToken(in String permission, int pid, int uid,
in IBinder callerToken);
+ @UnsupportedAppUsage
void registerTaskStackListener(in ITaskStackListener listener);
void unregisterTaskStackListener(in ITaskStackListener listener);
void notifyCleartextNetwork(int uid, in byte[] firstPacket);
int createStackOnDisplay(int displayId);
+ @UnsupportedAppUsage
void setTaskResizeable(int taskId, int resizeableMode);
boolean requestAssistContextExtras(int requestType, in IAssistDataReceiver receiver,
in Bundle receiverExtras, in IBinder activityToken,
boolean focused, boolean newSessionId);
+ @UnsupportedAppUsage
void resizeTask(int taskId, in Rect bounds, int resizeMode);
+ @UnsupportedAppUsage
int getLockTaskModeState();
+ @UnsupportedAppUsage
void setDumpHeapDebugLimit(in String processName, int uid, long maxMemSize,
in String reportPackage);
void dumpHeapFinished(in String path);
@@ -494,6 +555,7 @@
void updateLockTaskPackages(int userId, in String[] packages);
void noteAlarmStart(in IIntentSender sender, in WorkSource workSource, int sourceUid, in String tag);
void noteAlarmFinish(in IIntentSender sender, in WorkSource workSource, int sourceUid, in String tag);
+ @UnsupportedAppUsage
int getPackageProcessState(in String packageName, in String callingPackage);
oneway void showLockTaskEscapeMessage(in IBinder token);
void updateDeviceOwner(in String packageName);
@@ -512,6 +574,7 @@
// Start of N transactions
// Start Binder transaction tracking for all applications.
+ @UnsupportedAppUsage
boolean startBinderTracking();
// Stop Binder transaction tracking for all applications and dump trace data to the given file
// descriptor.
@@ -521,6 +584,7 @@
* current user and stacks state. The task will be moved to target stack if it's currently in
* different stack.
*/
+ @UnsupportedAppUsage
void positionTaskInStack(int taskId, int stackId, int position);
void exitFreeformMode(in IBinder token);
void reportSizeConfigurations(in IBinder token, in int[] horizontalSizeConfiguration,
@@ -539,10 +603,13 @@
* default animation duration should be used.
*/
void dismissPip(boolean animate, int animationDuration);
+ @UnsupportedAppUsage
void suppressResizeConfigChanges(boolean suppress);
void moveTasksToFullscreenStack(int fromStackId, boolean onTop);
+ @UnsupportedAppUsage
boolean moveTopActivityToPinnedStack(int stackId, in Rect bounds);
boolean isAppStartModeDisabled(int uid, in String packageName);
+ @UnsupportedAppUsage
boolean unlockUser(int userid, in byte[] token, in byte[] secret,
in IProgressListener listener);
boolean isInMultiWindowMode(in IBinder token);
@@ -572,6 +639,7 @@
* stacks.
* @throws RemoteException
*/
+ @UnsupportedAppUsage
void resizeDockedStack(in Rect dockedBounds, in Rect tempDockedTaskBounds,
in Rect tempDockedTaskInsetBounds,
in Rect tempOtherTaskBounds, in Rect tempOtherTaskInsetBounds);
@@ -593,6 +661,7 @@
boolean supportsLocalVoiceInteraction();
void notifyPinnedStackAnimationStarted();
void notifyPinnedStackAnimationEnded();
+ @UnsupportedAppUsage
void removeStack(int stackId);
/**
* Removes stacks in the input windowing modes from the system if they are of activity type
@@ -616,6 +685,7 @@
boolean isVrModePackageEnabled(in ComponentName packageName);
void notifyLockedProfile(int userId);
void startConfirmDeviceCredentialIntent(in Intent intent, in Bundle options);
+ @UnsupportedAppUsage
void sendIdleJobTrigger();
int sendIntentSender(in IIntentSender target, in IBinder whitelistToken, int code,
in Intent intent, in String resolvedType, in IIntentReceiver finishedReceiver,
@@ -653,6 +723,7 @@
int restartUserInBackground(int userId);
/** Cancels the window transitions for the given task. */
+ @UnsupportedAppUsage
void cancelTaskWindowTransition(int taskId);
/**
diff --git a/core/java/android/app/IAlarmManager.aidl b/core/java/android/app/IAlarmManager.aidl
index ded4c49..3a858bb 100644
--- a/core/java/android/app/IAlarmManager.aidl
+++ b/core/java/android/app/IAlarmManager.aidl
@@ -32,6 +32,7 @@
void set(String callingPackage, int type, long triggerAtTime, long windowLength,
long interval, int flags, in PendingIntent operation, in IAlarmListener listener,
String listenerTag, in WorkSource workSource, in AlarmManager.AlarmClockInfo alarmClock);
+ @UnsupportedAppUsage
boolean setTime(long millis);
void setTimeZone(String zone);
void remove(in PendingIntent operation, in IAlarmListener listener);
diff --git a/core/java/android/app/IApplicationThread.aidl b/core/java/android/app/IApplicationThread.aidl
index cbd85f5..d478cd6 100644
--- a/core/java/android/app/IApplicationThread.aidl
+++ b/core/java/android/app/IApplicationThread.aidl
@@ -102,6 +102,7 @@
void updateHttpProxy();
void setCoreSettings(in Bundle coreSettings);
void updatePackageCompatibilityInfo(in String pkg, in CompatibilityInfo info);
+ @UnsupportedAppUsage
void scheduleTrimMemory(int level);
void dumpMemInfo(in ParcelFileDescriptor fd, in Debug.MemoryInfo mem, boolean checkin,
boolean dumpInfo, boolean dumpDalvik, boolean dumpSummaryOnly, boolean dumpUnreachable,
diff --git a/core/java/android/app/IAssistDataReceiver.aidl b/core/java/android/app/IAssistDataReceiver.aidl
index 2d5daf9..0d69838 100644
--- a/core/java/android/app/IAssistDataReceiver.aidl
+++ b/core/java/android/app/IAssistDataReceiver.aidl
@@ -21,6 +21,8 @@
/** @hide */
oneway interface IAssistDataReceiver {
+ @UnsupportedAppUsage
void onHandleAssistData(in Bundle resultData);
+ @UnsupportedAppUsage
void onHandleAssistScreenshot(in Bitmap screenshot);
}
diff --git a/core/java/android/app/IInputForwarder.aidl b/core/java/android/app/IInputForwarder.aidl
index d6be63e..702b61e 100644
--- a/core/java/android/app/IInputForwarder.aidl
+++ b/core/java/android/app/IInputForwarder.aidl
@@ -25,5 +25,6 @@
* @hide
*/
interface IInputForwarder {
+ @UnsupportedAppUsage
boolean forwardEvent(in InputEvent event);
}
\ No newline at end of file
diff --git a/core/java/android/app/IInstrumentationWatcher.aidl b/core/java/android/app/IInstrumentationWatcher.aidl
index 6c8c4d6..df42dec 100644
--- a/core/java/android/app/IInstrumentationWatcher.aidl
+++ b/core/java/android/app/IInstrumentationWatcher.aidl
@@ -23,6 +23,7 @@
/** @hide */
interface IInstrumentationWatcher
{
+ @UnsupportedAppUsage
void instrumentationStatus(in ComponentName name, int resultCode,
in Bundle results);
void instrumentationFinished(in ComponentName name, int resultCode,
diff --git a/core/java/android/app/INotificationManager.aidl b/core/java/android/app/INotificationManager.aidl
index cd12710..d4297cc 100644
--- a/core/java/android/app/INotificationManager.aidl
+++ b/core/java/android/app/INotificationManager.aidl
@@ -40,15 +40,19 @@
/** {@hide} */
interface INotificationManager
{
+ @UnsupportedAppUsage
void cancelAllNotifications(String pkg, int userId);
void clearData(String pkg, int uid, boolean fromApp);
+ @UnsupportedAppUsage
void enqueueToast(String pkg, ITransientNotification callback, int duration);
+ @UnsupportedAppUsage
void cancelToast(String pkg, ITransientNotification callback);
void finishToken(String pkg, ITransientNotification callback);
void enqueueNotificationWithTag(String pkg, String opPkg, String tag, int id,
in Notification notification, int userId);
+ @UnsupportedAppUsage
void cancelNotificationWithTag(String pkg, String tag, int id, int userId);
void setShowBadge(String pkg, int uid, boolean showBadge);
@@ -61,6 +65,7 @@
*/
void setNotificationsEnabledWithImportanceLockForPackage(String pkg, int uid, boolean enabled);
+ @UnsupportedAppUsage
boolean areNotificationsEnabledForPackage(String pkg, int uid);
boolean areNotificationsEnabled(String pkg);
int getPackageImportance(String pkg);
@@ -143,7 +148,9 @@
List<String> getEnabledNotificationListenerPackages();
List<ComponentName> getEnabledNotificationListeners(int userId);
+ @UnsupportedAppUsage
int getZenMode();
+ @UnsupportedAppUsage
ZenModeConfig getZenModeConfig();
oneway void setZenMode(int mode, in Uri conditionId, String reason);
oneway void notifyConditions(String pkg, in IConditionProvider provider, in Condition[] conditions);
diff --git a/core/java/android/app/ISearchManager.aidl b/core/java/android/app/ISearchManager.aidl
index 0d09e4a..53f1a46 100644
--- a/core/java/android/app/ISearchManager.aidl
+++ b/core/java/android/app/ISearchManager.aidl
@@ -28,6 +28,7 @@
SearchableInfo getSearchableInfo(in ComponentName launchActivity);
List<SearchableInfo> getSearchablesInGlobalSearch();
List<ResolveInfo> getGlobalSearchActivities();
+ @UnsupportedAppUsage
ComponentName getGlobalSearchActivity();
ComponentName getWebSearchActivity();
void launchAssist(in Bundle args);
diff --git a/core/java/android/app/IStopUserCallback.aidl b/core/java/android/app/IStopUserCallback.aidl
index 19ac1d5..d3c2ff7 100644
--- a/core/java/android/app/IStopUserCallback.aidl
+++ b/core/java/android/app/IStopUserCallback.aidl
@@ -22,6 +22,7 @@
*/
interface IStopUserCallback
{
+ @UnsupportedAppUsage
void userStopped(int userId);
void userStopAborted(int userId);
}
diff --git a/core/java/android/app/IWallpaperManager.aidl b/core/java/android/app/IWallpaperManager.aidl
index 5ef4be1..cfa62d7 100644
--- a/core/java/android/app/IWallpaperManager.aidl
+++ b/core/java/android/app/IWallpaperManager.aidl
@@ -55,11 +55,13 @@
/**
* Set the live wallpaper. This only affects the system wallpaper.
*/
+ @UnsupportedAppUsage
void setWallpaperComponent(in ComponentName name);
/**
* Get the wallpaper for a given user.
*/
+ @UnsupportedAppUsage
ParcelFileDescriptor getWallpaper(String callingPkg, IWallpaperManagerCallback cb, int which,
out Bundle outParams, int userId);
@@ -73,6 +75,7 @@
* information about that wallpaper. Otherwise, if it is a static image,
* simply return null.
*/
+ @UnsupportedAppUsage
WallpaperInfo getWallpaperInfo(int userId);
/**
@@ -83,6 +86,7 @@
/**
* Return whether the current system wallpaper has the given name.
*/
+ @UnsupportedAppUsage
boolean hasNamedWallpaper(String name);
/**
@@ -94,11 +98,13 @@
/**
* Returns the desired minimum width for the wallpaper.
*/
+ @UnsupportedAppUsage
int getWidthHint();
/**
* Returns the desired minimum height for the wallpaper.
*/
+ @UnsupportedAppUsage
int getHeightHint();
/**
diff --git a/core/java/android/app/admin/IDevicePolicyManager.aidl b/core/java/android/app/admin/IDevicePolicyManager.aidl
index 0046302..0e95e639 100644
--- a/core/java/android/app/admin/IDevicePolicyManager.aidl
+++ b/core/java/android/app/admin/IDevicePolicyManager.aidl
@@ -122,6 +122,7 @@
void setActiveAdmin(in ComponentName policyReceiver, boolean refreshing, int userHandle);
boolean isAdminActive(in ComponentName policyReceiver, int userHandle);
List<ComponentName> getActiveAdmins(int userHandle);
+ @UnsupportedAppUsage
boolean packageHasActiveAdmins(String packageName, int userHandle);
void getRemoveWarning(in ComponentName policyReceiver, in RemoteCallback result, int userHandle);
void removeActiveAdmin(in ComponentName policyReceiver, int userHandle);
diff --git a/core/java/android/app/backup/IBackupManager.aidl b/core/java/android/app/backup/IBackupManager.aidl
index f3ca746..34191f1 100644
--- a/core/java/android/app/backup/IBackupManager.aidl
+++ b/core/java/android/app/backup/IBackupManager.aidl
@@ -44,6 +44,7 @@
* only callers who hold the android.permission.BACKUP permission
* may invoke it for arbitrary packages.
*/
+ @UnsupportedAppUsage
void dataChanged(String packageName);
/**
@@ -54,6 +55,7 @@
* only callers who hold the android.permission.BACKUP permission
* may invoke it for arbitrary packages.
*/
+ @UnsupportedAppUsage
void clearBackupData(String transportName, String packageName);
/**
@@ -92,6 +94,7 @@
*
* <p>Callers must hold the android.permission.BACKUP permission to use this method.
*/
+ @UnsupportedAppUsage
void setBackupEnabled(boolean isEnabled);
/**
@@ -107,6 +110,7 @@
* @param doAutoRestore When true, enables the automatic app-data restore facility. When
* false, this facility will be disabled.
*/
+ @UnsupportedAppUsage
void setAutoRestore(boolean doAutoRestore);
/**
@@ -121,6 +125,7 @@
*
* <p>Callers must hold the android.permission.BACKUP permission to use this method.
*/
+ @UnsupportedAppUsage
boolean isBackupEnabled();
/**
@@ -217,6 +222,7 @@
*
* <p>Callers must hold the android.permission.BACKUP permission to use this method.
*/
+ @UnsupportedAppUsage
void acknowledgeFullBackupOrRestore(int token, boolean allow,
in String curPassword, in String encryptionPassword,
IFullBackupRestoreObserver observer);
@@ -255,12 +261,14 @@
* Identify the currently selected transport. Callers must hold the
* android.permission.BACKUP permission to use this method.
*/
+ @UnsupportedAppUsage
String getCurrentTransport();
/**
* Request a list of all available backup transports' names. Callers must
* hold the android.permission.BACKUP permission to use this method.
*/
+ @UnsupportedAppUsage
String[] listAllTransports();
ComponentName[] listAllTransportComponents();
@@ -283,6 +291,7 @@
* name is not one of the currently available transports, no change is made to
* the current transport setting and the method returns null.
*/
+ @UnsupportedAppUsage
String selectBackupTransport(String transport);
/**
@@ -385,6 +394,7 @@
* @param whichUser User handle of the defined user whose backup active state
* is being queried.
*/
+ @UnsupportedAppUsage
boolean isBackupServiceActive(int whichUser);
/**
diff --git a/core/java/android/app/job/IJobCallback.aidl b/core/java/android/app/job/IJobCallback.aidl
index e7695e2..d281da0 100644
--- a/core/java/android/app/job/IJobCallback.aidl
+++ b/core/java/android/app/job/IJobCallback.aidl
@@ -36,6 +36,7 @@
* @param ongoing True to indicate that the client is processing the job. False if the job is
* complete
*/
+ @UnsupportedAppUsage
void acknowledgeStartMessage(int jobId, boolean ongoing);
/**
* Immediate callback to the system after sending a stop signal, used to quickly detect ANR.
@@ -43,14 +44,17 @@
* @param jobId Unique integer used to identify this job.
* @param reschedule Whether or not to reschedule this job.
*/
+ @UnsupportedAppUsage
void acknowledgeStopMessage(int jobId, boolean reschedule);
/*
* Called to deqeue next work item for the job.
*/
+ @UnsupportedAppUsage
JobWorkItem dequeueWork(int jobId);
/*
* Called to report that job has completed processing a work item.
*/
+ @UnsupportedAppUsage
boolean completeWork(int jobId, int workId);
/*
* Tell the job manager that the client is done with its execution, so that it can go on to
@@ -59,5 +63,6 @@
* @param jobId Unique integer used to identify this job.
* @param reschedule Whether or not to reschedule this job.
*/
+ @UnsupportedAppUsage
void jobFinished(int jobId, boolean reschedule);
}
diff --git a/core/java/android/app/job/IJobService.aidl b/core/java/android/app/job/IJobService.aidl
index 7f55d29..22ad252 100644
--- a/core/java/android/app/job/IJobService.aidl
+++ b/core/java/android/app/job/IJobService.aidl
@@ -26,7 +26,9 @@
*/
oneway interface IJobService {
/** Begin execution of application's job. */
+ @UnsupportedAppUsage
void startJob(in JobParameters jobParams);
/** Stop execution of application's job. */
+ @UnsupportedAppUsage
void stopJob(in JobParameters jobParams);
}
diff --git a/core/java/android/app/usage/IUsageStatsManager.aidl b/core/java/android/app/usage/IUsageStatsManager.aidl
index 9713527..763af9e 100644
--- a/core/java/android/app/usage/IUsageStatsManager.aidl
+++ b/core/java/android/app/usage/IUsageStatsManager.aidl
@@ -28,8 +28,10 @@
* {@hide}
*/
interface IUsageStatsManager {
+ @UnsupportedAppUsage
ParceledListSlice queryUsageStats(int bucketType, long beginTime, long endTime,
String callingPackage);
+ @UnsupportedAppUsage
ParceledListSlice queryConfigurationStats(int bucketType, long beginTime, long endTime,
String callingPackage);
ParceledListSlice queryEventStats(int bucketType, long beginTime, long endTime,
@@ -38,7 +40,9 @@
UsageEvents queryEventsForPackage(long beginTime, long endTime, String callingPackage);
UsageEvents queryEventsForUser(long beginTime, long endTime, int userId, String callingPackage);
UsageEvents queryEventsForPackageForUser(long beginTime, long endTime, int userId, String pkg, String callingPackage);
+ @UnsupportedAppUsage
void setAppInactive(String packageName, boolean inactive, int userId);
+ @UnsupportedAppUsage
boolean isAppInactive(String packageName, int userId);
void whitelistAppTemporarily(String packageName, long duration, int userId);
void onCarrierPrivilegedAppsChanged();
diff --git a/core/java/android/bluetooth/BluetoothCodecStatus.java b/core/java/android/bluetooth/BluetoothCodecStatus.java
index 78560d2..32bb681 100644
--- a/core/java/android/bluetooth/BluetoothCodecStatus.java
+++ b/core/java/android/bluetooth/BluetoothCodecStatus.java
@@ -74,8 +74,8 @@
* @param c2 the second array of capabilities to compare
* @return true if both arrays contain same capabilities
*/
- private static boolean sameCapabilities(BluetoothCodecConfig[] c1,
- BluetoothCodecConfig[] c2) {
+ public static boolean sameCapabilities(BluetoothCodecConfig[] c1,
+ BluetoothCodecConfig[] c2) {
if (c1 == null) {
return (c2 == null);
}
diff --git a/core/java/android/bluetooth/BluetoothHearingAid.java b/core/java/android/bluetooth/BluetoothHearingAid.java
index 23a8159..c5a0bbd 100644
--- a/core/java/android/bluetooth/BluetoothHearingAid.java
+++ b/core/java/android/bluetooth/BluetoothHearingAid.java
@@ -17,6 +17,7 @@
package android.bluetooth;
import android.Manifest;
+import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.RequiresPermission;
import android.annotation.SdkConstant;
@@ -302,7 +303,7 @@
* {@inheritDoc}
*/
@Override
- public List<BluetoothDevice> getConnectedDevices() {
+ public @NonNull List<BluetoothDevice> getConnectedDevices() {
if (VDBG) log("getConnectedDevices()");
try {
mServiceLock.readLock().lock();
@@ -322,8 +323,8 @@
/**
* {@inheritDoc}
*/
- @Override
- public List<BluetoothDevice> getDevicesMatchingConnectionStates(int[] states) {
+ @Override public @NonNull List<BluetoothDevice> getDevicesMatchingConnectionStates(
+ @NonNull int[] states) {
if (VDBG) log("getDevicesMatchingStates()");
try {
mServiceLock.readLock().lock();
@@ -344,7 +345,7 @@
* {@inheritDoc}
*/
@Override
- public int getConnectionState(BluetoothDevice device) {
+ public int getConnectionState(@NonNull BluetoothDevice device) {
if (VDBG) log("getState(" + device + ")");
try {
mServiceLock.readLock().lock();
diff --git a/core/java/android/content/ContentProviderNative.java b/core/java/android/content/ContentProviderNative.java
index 6bede13..fccb5eb 100644
--- a/core/java/android/content/ContentProviderNative.java
+++ b/core/java/android/content/ContentProviderNative.java
@@ -795,5 +795,6 @@
}
}
+ @UnsupportedAppUsage
private IBinder mRemote;
}
diff --git a/core/java/android/content/IContentService.aidl b/core/java/android/content/IContentService.aidl
index dc17666..44bfd3c 100644
--- a/core/java/android/content/IContentService.aidl
+++ b/core/java/android/content/IContentService.aidl
@@ -61,6 +61,7 @@
*/
void sync(in SyncRequest request);
void syncAsUser(in SyncRequest request, int userId);
+ @UnsupportedAppUsage
void cancelSync(in Account account, String authority, in ComponentName cname);
void cancelSyncAsUser(in Account account, String authority, in ComponentName cname, int userId);
@@ -118,6 +119,7 @@
* Check if this account/provider is syncable.
* @return >0 if it is syncable, 0 if not, and <0 if the state isn't known yet.
*/
+ @UnsupportedAppUsage
int getIsSyncable(in Account account, String providerName);
int getIsSyncableAsUser(in Account account, String providerName, int userId);
@@ -127,9 +129,11 @@
*/
void setIsSyncable(in Account account, String providerName, int syncable);
+ @UnsupportedAppUsage
void setMasterSyncAutomatically(boolean flag);
void setMasterSyncAutomaticallyAsUser(boolean flag, int userId);
+ @UnsupportedAppUsage
boolean getMasterSyncAutomatically();
boolean getMasterSyncAutomaticallyAsUser(int userId);
@@ -140,6 +144,7 @@
* Returns the types of the SyncAdapters that are registered with the system.
* @return Returns the types of the SyncAdapters that are registered with the system.
*/
+ @UnsupportedAppUsage
SyncAdapterType[] getSyncAdapterTypes();
SyncAdapterType[] getSyncAdapterTypesAsUser(int userId);
@@ -153,6 +158,7 @@
* @param cname component to identify sync service, must be null if account/providerName are
* non-null.
*/
+ @UnsupportedAppUsage
boolean isSyncActive(in Account account, String authority, in ComponentName cname);
/**
diff --git a/core/java/android/content/IIntentReceiver.aidl b/core/java/android/content/IIntentReceiver.aidl
index 3d92723..2b45021 100644
--- a/core/java/android/content/IIntentReceiver.aidl
+++ b/core/java/android/content/IIntentReceiver.aidl
@@ -27,6 +27,7 @@
* {@hide}
*/
oneway interface IIntentReceiver {
+ @UnsupportedAppUsage
void performReceive(in Intent intent, int resultCode, String data,
in Bundle extras, boolean ordered, boolean sticky, int sendingUser);
}
diff --git a/core/java/android/content/ISyncAdapter.aidl b/core/java/android/content/ISyncAdapter.aidl
index 0eb581e..9242d02 100644
--- a/core/java/android/content/ISyncAdapter.aidl
+++ b/core/java/android/content/ISyncAdapter.aidl
@@ -32,6 +32,7 @@
*
* @param cb If called back with {@code false} accounts are not synced.
*/
+ @UnsupportedAppUsage
void onUnsyncableAccount(ISyncAdapterUnsyncableAccountCallback cb);
/**
@@ -44,6 +45,7 @@
* @param account the account that should be synced
* @param extras SyncAdapter-specific parameters
*/
+ @UnsupportedAppUsage
void startSync(ISyncContext syncContext, String authority,
in Account account, in Bundle extras);
@@ -52,5 +54,6 @@
* after the ISyncContext.onFinished() for that sync was called.
* @param syncContext the ISyncContext that was passed to {@link #startSync}
*/
+ @UnsupportedAppUsage
void cancelSync(ISyncContext syncContext);
}
diff --git a/core/java/android/content/ISyncServiceAdapter.aidl b/core/java/android/content/ISyncServiceAdapter.aidl
index d419307..29f3a40 100644
--- a/core/java/android/content/ISyncServiceAdapter.aidl
+++ b/core/java/android/content/ISyncServiceAdapter.aidl
@@ -35,11 +35,13 @@
* @param extras SyncAdapter-specific parameters.
*
*/
+ @UnsupportedAppUsage
void startSync(ISyncContext syncContext, in Bundle extras);
/**
* Cancel the currently ongoing sync.
*/
+ @UnsupportedAppUsage
void cancelSync(ISyncContext syncContext);
}
diff --git a/core/java/android/content/ISyncStatusObserver.aidl b/core/java/android/content/ISyncStatusObserver.aidl
index eb26845..64bf3bd 100644
--- a/core/java/android/content/ISyncStatusObserver.aidl
+++ b/core/java/android/content/ISyncStatusObserver.aidl
@@ -20,5 +20,6 @@
* @hide
*/
oneway interface ISyncStatusObserver {
+ @UnsupportedAppUsage
void onStatusChanged(int which);
}
diff --git a/core/java/android/content/om/IOverlayManager.aidl b/core/java/android/content/om/IOverlayManager.aidl
index 5b3c9dd..722c128 100644
--- a/core/java/android/content/om/IOverlayManager.aidl
+++ b/core/java/android/content/om/IOverlayManager.aidl
@@ -37,6 +37,7 @@
* mapped to lists of overlays; if no overlays exist for the
* requested user, an empty map is returned.
*/
+ @UnsupportedAppUsage
Map getAllOverlays(in int userId);
/**
@@ -60,6 +61,7 @@
* @return The OverlayInfo for the overlay package; or null if no such
* overlay package exists.
*/
+ @UnsupportedAppUsage
OverlayInfo getOverlayInfo(in String packageName, in int userId);
/**
diff --git a/core/java/android/content/pm/IPackageDataObserver.aidl b/core/java/android/content/pm/IPackageDataObserver.aidl
index d010ee4..926ecda 100644
--- a/core/java/android/content/pm/IPackageDataObserver.aidl
+++ b/core/java/android/content/pm/IPackageDataObserver.aidl
@@ -24,5 +24,6 @@
* {@hide}
*/
oneway interface IPackageDataObserver {
+ @UnsupportedAppUsage
void onRemoveCompleted(in String packageName, boolean succeeded);
}
diff --git a/core/java/android/content/pm/IPackageDeleteObserver.aidl b/core/java/android/content/pm/IPackageDeleteObserver.aidl
index 2e2d16e..faae81e 100644
--- a/core/java/android/content/pm/IPackageDeleteObserver.aidl
+++ b/core/java/android/content/pm/IPackageDeleteObserver.aidl
@@ -23,6 +23,7 @@
* {@hide}
*/
oneway interface IPackageDeleteObserver {
+ @UnsupportedAppUsage
void packageDeleted(in String packageName, in int returnCode);
}
diff --git a/core/java/android/content/pm/IPackageDeleteObserver2.aidl b/core/java/android/content/pm/IPackageDeleteObserver2.aidl
index bff3baa..ea80967 100644
--- a/core/java/android/content/pm/IPackageDeleteObserver2.aidl
+++ b/core/java/android/content/pm/IPackageDeleteObserver2.aidl
@@ -21,5 +21,6 @@
/** {@hide} */
oneway interface IPackageDeleteObserver2 {
void onUserActionRequired(in Intent intent);
+ @UnsupportedAppUsage
void onPackageDeleted(String packageName, int returnCode, String msg);
}
diff --git a/core/java/android/content/pm/IPackageInstallObserver2.aidl b/core/java/android/content/pm/IPackageInstallObserver2.aidl
index bb5f22a..ed2eb7d 100644
--- a/core/java/android/content/pm/IPackageInstallObserver2.aidl
+++ b/core/java/android/content/pm/IPackageInstallObserver2.aidl
@@ -25,6 +25,7 @@
* @hide
*/
oneway interface IPackageInstallObserver2 {
+ @UnsupportedAppUsage
void onUserActionRequired(in Intent intent);
/**
@@ -42,5 +43,6 @@
* </tr>
* </table>
*/
+ @UnsupportedAppUsage
void onPackageInstalled(String basePackageName, int returnCode, String msg, in Bundle extras);
}
diff --git a/core/java/android/content/pm/IPackageInstaller.aidl b/core/java/android/content/pm/IPackageInstaller.aidl
index ecc8cd6..fa23933 100644
--- a/core/java/android/content/pm/IPackageInstaller.aidl
+++ b/core/java/android/content/pm/IPackageInstaller.aidl
@@ -45,6 +45,7 @@
void registerCallback(IPackageInstallerCallback callback, int userId);
void unregisterCallback(IPackageInstallerCallback callback);
+ @UnsupportedAppUsage
void uninstall(in VersionedPackage versionedPackage, String callerPackageName, int flags,
in IntentSender statusReceiver, int userId);
diff --git a/core/java/android/content/pm/IPackageInstallerCallback.aidl b/core/java/android/content/pm/IPackageInstallerCallback.aidl
index 974eb1e..ee26500 100644
--- a/core/java/android/content/pm/IPackageInstallerCallback.aidl
+++ b/core/java/android/content/pm/IPackageInstallerCallback.aidl
@@ -18,9 +18,14 @@
/** {@hide} */
oneway interface IPackageInstallerCallback {
+ @UnsupportedAppUsage
void onSessionCreated(int sessionId);
+ @UnsupportedAppUsage
void onSessionBadgingChanged(int sessionId);
+ @UnsupportedAppUsage
void onSessionActiveChanged(int sessionId, boolean active);
+ @UnsupportedAppUsage
void onSessionProgressChanged(int sessionId, float progress);
+ @UnsupportedAppUsage
void onSessionFinished(int sessionId, boolean success);
}
diff --git a/core/java/android/content/pm/IPackageManager.aidl b/core/java/android/content/pm/IPackageManager.aidl
index da7d664..48165dc 100644
--- a/core/java/android/content/pm/IPackageManager.aidl
+++ b/core/java/android/content/pm/IPackageManager.aidl
@@ -62,45 +62,60 @@
*/
interface IPackageManager {
void checkPackageStartable(String packageName, int userId);
+ @UnsupportedAppUsage
boolean isPackageAvailable(String packageName, int userId);
+ @UnsupportedAppUsage
PackageInfo getPackageInfo(String packageName, int flags, int userId);
PackageInfo getPackageInfoVersioned(in VersionedPackage versionedPackage,
int flags, int userId);
+ @UnsupportedAppUsage
int getPackageUid(String packageName, int flags, int userId);
int[] getPackageGids(String packageName, int flags, int userId);
+ @UnsupportedAppUsage
String[] currentToCanonicalPackageNames(in String[] names);
+ @UnsupportedAppUsage
String[] canonicalToCurrentPackageNames(in String[] names);
PermissionInfo getPermissionInfo(String name, String packageName, int flags);
ParceledListSlice queryPermissionsByGroup(String group, int flags);
+ @UnsupportedAppUsage
PermissionGroupInfo getPermissionGroupInfo(String name, int flags);
ParceledListSlice getAllPermissionGroups(int flags);
+ @UnsupportedAppUsage
ApplicationInfo getApplicationInfo(String packageName, int flags ,int userId);
+ @UnsupportedAppUsage
ActivityInfo getActivityInfo(in ComponentName className, int flags, int userId);
boolean activitySupportsIntent(in ComponentName className, in Intent intent,
String resolvedType);
+ @UnsupportedAppUsage
ActivityInfo getReceiverInfo(in ComponentName className, int flags, int userId);
+ @UnsupportedAppUsage
ServiceInfo getServiceInfo(in ComponentName className, int flags, int userId);
+ @UnsupportedAppUsage
ProviderInfo getProviderInfo(in ComponentName className, int flags, int userId);
+ @UnsupportedAppUsage
int checkPermission(String permName, String pkgName, int userId);
int checkUidPermission(String permName, int uid);
+ @UnsupportedAppUsage
boolean addPermission(in PermissionInfo info);
+ @UnsupportedAppUsage
void removePermission(String name);
+ @UnsupportedAppUsage
void grantRuntimePermission(String packageName, String permissionName, int userId);
void revokeRuntimePermission(String packageName, String permissionName, int userId);
@@ -119,33 +134,43 @@
boolean isProtectedBroadcast(String actionName);
+ @UnsupportedAppUsage
int checkSignatures(String pkg1, String pkg2);
+ @UnsupportedAppUsage
int checkUidSignatures(int uid1, int uid2);
List<String> getAllPackages();
+ @UnsupportedAppUsage
String[] getPackagesForUid(int uid);
+ @UnsupportedAppUsage
String getNameForUid(int uid);
String[] getNamesForUids(in int[] uids);
+ @UnsupportedAppUsage
int getUidForSharedUser(String sharedUserName);
+ @UnsupportedAppUsage
int getFlagsForUid(int uid);
int getPrivateFlagsForUid(int uid);
+ @UnsupportedAppUsage
boolean isUidPrivileged(int uid);
+ @UnsupportedAppUsage
String[] getAppOpPermissionPackages(String permissionName);
+ @UnsupportedAppUsage
ResolveInfo resolveIntent(in Intent intent, String resolvedType, int flags, int userId);
ResolveInfo findPersistentPreferredActivity(in Intent intent, int userId);
boolean canForwardTo(in Intent intent, String resolvedType, int sourceUserId, int targetUserId);
+ @UnsupportedAppUsage
ParceledListSlice queryIntentActivities(in Intent intent,
String resolvedType, int flags, int userId);
@@ -172,6 +197,7 @@
* limit that kicks in when flags are included that bloat up the data
* returned.
*/
+ @UnsupportedAppUsage
ParceledListSlice getInstalledPackages(int flags, in int userId);
/**
@@ -189,6 +215,7 @@
* limit that kicks in when flags are included that bloat up the data
* returned.
*/
+ @UnsupportedAppUsage
ParceledListSlice getInstalledApplications(int flags, int userId);
/**
@@ -209,20 +236,24 @@
* @param outInfo Filled in with a list of the ProviderInfo for each
* name in 'outNames'.
*/
+ @UnsupportedAppUsage
void querySyncProviders(inout List<String> outNames,
inout List<ProviderInfo> outInfo);
ParceledListSlice queryContentProviders(
String processName, int uid, int flags, String metaDataKey);
+ @UnsupportedAppUsage
InstrumentationInfo getInstrumentationInfo(
in ComponentName className, int flags);
+ @UnsupportedAppUsage
ParceledListSlice queryInstrumentation(
String targetPackage, int flags);
void finishPackageInstall(int token, boolean didLaunch);
+ @UnsupportedAppUsage
void setInstallerPackageName(in String targetPackage, in String installerPackageName);
void setApplicationCategoryHint(String packageName, int categoryHint, String callerPackageName);
@@ -242,24 +273,30 @@
void deletePackageVersioned(in VersionedPackage versionedPackage,
IPackageDeleteObserver2 observer, int userId, int flags);
+ @UnsupportedAppUsage
String getInstallerPackageName(in String packageName);
void resetApplicationPreferences(int userId);
+ @UnsupportedAppUsage
ResolveInfo getLastChosenActivity(in Intent intent,
String resolvedType, int flags);
+ @UnsupportedAppUsage
void setLastChosenActivity(in Intent intent, String resolvedType, int flags,
in IntentFilter filter, int match, in ComponentName activity);
void addPreferredActivity(in IntentFilter filter, int match,
in ComponentName[] set, in ComponentName activity, int userId);
+ @UnsupportedAppUsage
void replacePreferredActivity(in IntentFilter filter, int match,
in ComponentName[] set, in ComponentName activity, int userId);
+ @UnsupportedAppUsage
void clearPackagePreferredActivities(String packageName);
+ @UnsupportedAppUsage
int getPreferredActivities(out List<IntentFilter> outFilters,
out List<ComponentName> outActivities, String packageName);
@@ -296,6 +333,7 @@
* Report the set of 'Home' activity candidates, plus (if any) which of them
* is the current "always use this one" setting.
*/
+ @UnsupportedAppUsage
ComponentName getHomeActivities(out List<ResolveInfo> outHomeCandidates);
void setHomeActivity(in ComponentName className, int userId);
@@ -303,23 +341,27 @@
/**
* As per {@link android.content.pm.PackageManager#setComponentEnabledSetting}.
*/
+ @UnsupportedAppUsage
void setComponentEnabledSetting(in ComponentName componentName,
in int newState, in int flags, int userId);
/**
* As per {@link android.content.pm.PackageManager#getComponentEnabledSetting}.
*/
+ @UnsupportedAppUsage
int getComponentEnabledSetting(in ComponentName componentName, int userId);
/**
* As per {@link android.content.pm.PackageManager#setApplicationEnabledSetting}.
*/
+ @UnsupportedAppUsage
void setApplicationEnabledSetting(in String packageName, in int newState, int flags,
int userId, String callingPackage);
/**
* As per {@link android.content.pm.PackageManager#getApplicationEnabledSetting}.
*/
+ @UnsupportedAppUsage
int getApplicationEnabledSetting(in String packageName, int userId);
/**
@@ -337,6 +379,7 @@
* Set whether the given package should be considered stopped, making
* it not visible to implicit intents that filter out stopped packages.
*/
+ @UnsupportedAppUsage
void setPackageStoppedState(String packageName, boolean stopped, int userId);
/**
@@ -392,6 +435,7 @@
* files need to be deleted
* @param observer a callback used to notify when the deletion is finished.
*/
+ @UnsupportedAppUsage
void deleteApplicationCacheFiles(in String packageName, IPackageDataObserver observer);
/**
@@ -432,6 +476,7 @@
* Get a list of shared libraries that are available on the
* system.
*/
+ @UnsupportedAppUsage
String[] getSystemSharedLibraryNames();
/**
@@ -443,8 +488,10 @@
boolean hasSystemFeature(String name, int version);
void enterSafeMode();
+ @UnsupportedAppUsage
boolean isSafeMode();
void systemReady();
+ @UnsupportedAppUsage
boolean hasSystemUidErrors();
/**
@@ -563,9 +610,11 @@
int movePackage(in String packageName, in String volumeUuid);
int movePrimaryStorage(in String volumeUuid);
+ @UnsupportedAppUsage
boolean addPermissionAsync(in PermissionInfo info);
boolean setInstallLocation(int loc);
+ @UnsupportedAppUsage
int getInstallLocation();
int installExistingPackageAsUser(String packageName, int userId, int installFlags,
@@ -593,17 +642,21 @@
boolean isPermissionEnforced(String permission);
/** Reflects current DeviceStorageMonitorService state */
+ @UnsupportedAppUsage
boolean isStorageLow();
+ @UnsupportedAppUsage
boolean setApplicationHiddenSettingAsUser(String packageName, boolean hidden, int userId);
boolean getApplicationHiddenSettingAsUser(String packageName, int userId);
void setSystemAppHiddenUntilInstalled(String packageName, boolean hidden);
boolean setSystemAppInstallState(String packageName, boolean installed, int userId);
+ @UnsupportedAppUsage
IPackageInstaller getPackageInstaller();
boolean setBlockUninstallForUser(String packageName, boolean blockUninstall, int userId);
+ @UnsupportedAppUsage
boolean getBlockUninstallForUser(String packageName, int userId);
KeySet getKeySetByAlias(String packageName, String alias);
@@ -624,6 +677,7 @@
boolean isPermissionRevokedByPolicy(String permission, String packageName, int userId);
+ @UnsupportedAppUsage
String getPermissionControllerPackageName();
ParceledListSlice getInstantApps(int userId);
@@ -640,7 +694,9 @@
*/
void setUpdateAvailable(String packageName, boolean updateAvaialble);
+ @UnsupportedAppUsage
String getServicesSystemSharedLibraryPackageName();
+ @UnsupportedAppUsage
String getSharedSystemSharedLibraryPackageName();
ChangedPackages getChangedPackages(int sequenceNumber, int userId);
diff --git a/core/java/android/content/pm/IPackageStatsObserver.aidl b/core/java/android/content/pm/IPackageStatsObserver.aidl
index ede4d1d..559a035 100644
--- a/core/java/android/content/pm/IPackageStatsObserver.aidl
+++ b/core/java/android/content/pm/IPackageStatsObserver.aidl
@@ -26,5 +26,6 @@
*/
oneway interface IPackageStatsObserver {
+ @UnsupportedAppUsage
void onGetStatsCompleted(in PackageStats pStats, boolean succeeded);
}
diff --git a/core/java/android/database/BulkCursorNative.java b/core/java/android/database/BulkCursorNative.java
index d3c11e7..77a13cf 100644
--- a/core/java/android/database/BulkCursorNative.java
+++ b/core/java/android/database/BulkCursorNative.java
@@ -16,6 +16,7 @@
package android.database;
+import android.annotation.UnsupportedAppUsage;
import android.os.Binder;
import android.os.Bundle;
import android.os.IBinder;
@@ -138,6 +139,7 @@
final class BulkCursorProxy implements IBulkCursor {
+ @UnsupportedAppUsage
private IBinder mRemote;
private Bundle mExtras;
diff --git a/core/java/android/hardware/Camera.java b/core/java/android/hardware/Camera.java
index ac863b2..81abdea0 100644
--- a/core/java/android/hardware/Camera.java
+++ b/core/java/android/hardware/Camera.java
@@ -1174,6 +1174,7 @@
{
private final Camera mCamera;
+ @UnsupportedAppUsage
public EventHandler(Camera c, Looper looper) {
super(looper);
mCamera = c;
diff --git a/core/java/android/hardware/display/IDisplayManager.aidl b/core/java/android/hardware/display/IDisplayManager.aidl
index b575997..37d93e7 100644
--- a/core/java/android/hardware/display/IDisplayManager.aidl
+++ b/core/java/android/hardware/display/IDisplayManager.aidl
@@ -30,6 +30,7 @@
/** @hide */
interface IDisplayManager {
+ @UnsupportedAppUsage
DisplayInfo getDisplayInfo(int displayId);
int[] getDisplayIds();
diff --git a/core/java/android/hardware/input/IInputManager.aidl b/core/java/android/hardware/input/IInputManager.aidl
index 97868fa..cd17a3e 100644
--- a/core/java/android/hardware/input/IInputManager.aidl
+++ b/core/java/android/hardware/input/IInputManager.aidl
@@ -46,6 +46,7 @@
// Injects an input event into the system. To inject into windows owned by other
// applications, the caller must have the INJECT_EVENTS permission.
+ @UnsupportedAppUsage
boolean injectInputEvent(in InputEvent ev, int mode);
// Calibrate input device position
diff --git a/core/java/android/hardware/location/IActivityRecognitionHardwareClient.aidl b/core/java/android/hardware/location/IActivityRecognitionHardwareClient.aidl
index 3fe645c..2dfaf60 100644
--- a/core/java/android/hardware/location/IActivityRecognitionHardwareClient.aidl
+++ b/core/java/android/hardware/location/IActivityRecognitionHardwareClient.aidl
@@ -32,5 +32,6 @@
* @param isSupported whether the platform has hardware support for the feature
* @param instance the available instance to provide access to the feature
*/
+ @UnsupportedAppUsage
void onAvailabilityChanged(in boolean isSupported, in IActivityRecognitionHardware instance);
}
diff --git a/core/java/android/net/ConnectivityManager.java b/core/java/android/net/ConnectivityManager.java
index 24a907b..524077b 100644
--- a/core/java/android/net/ConnectivityManager.java
+++ b/core/java/android/net/ConnectivityManager.java
@@ -2681,12 +2681,39 @@
}
}
+ /** @hide */
+ @Retention(RetentionPolicy.SOURCE)
+ @IntDef(value = {
+ TETHER_ERROR_NO_ERROR,
+ TETHER_ERROR_PROVISION_FAILED,
+ TETHER_ERROR_ENTITLEMENT_UNKONWN,
+ })
+ public @interface EntitlementResultCode {
+ }
+
/**
- * Callback for use with {@link #getLatestTetheringEntitlementValue} to find out whether
+ * Callback for use with {@link #getLatestTetheringEntitlementResult} to find out whether
* entitlement succeeded.
* @hide
*/
@SystemApi
+ public interface OnTetheringEntitlementResultListener {
+ /**
+ * Called to notify entitlement result.
+ *
+ * @param resultCode an int value of entitlement result. It may be one of
+ * {@link #TETHER_ERROR_NO_ERROR},
+ * {@link #TETHER_ERROR_PROVISION_FAILED}, or
+ * {@link #TETHER_ERROR_ENTITLEMENT_UNKONWN}.
+ */
+ void onEntitlementResult(@EntitlementResultCode int resultCode);
+ }
+
+ /**
+ * @removed
+ * @deprecated This API would be removed when all of caller has been updated.
+ * */
+ @Deprecated
public abstract static class TetheringEntitlementValueListener {
/**
* Called to notify entitlement result.
@@ -2712,14 +2739,43 @@
* {@link #TETHERING_USB}, or
* {@link #TETHERING_BLUETOOTH}.
* @param showEntitlementUi a boolean indicating whether to run UI-based entitlement check.
- * @param listener an {@link TetheringEntitlementValueListener} which will be called to notify
- * the caller of the result of entitlement check. The listener may be called zero or
- * one time.
- * @param handler {@link Handler} to specify the thread upon which the listener will be invoked.
+ * @param executor the executor on which callback will be invoked.
+ * @param listener an {@link OnTetheringEntitlementResultListener} which will be called to
+ * notify the caller of the result of entitlement check. The listener may be called zero
+ * or one time.
* {@hide}
*/
@SystemApi
@RequiresPermission(android.Manifest.permission.TETHER_PRIVILEGED)
+ public void getLatestTetheringEntitlementResult(int type, boolean showEntitlementUi,
+ @NonNull @CallbackExecutor Executor executor,
+ @NonNull final OnTetheringEntitlementResultListener listener) {
+ Preconditions.checkNotNull(listener, "TetheringEntitlementResultListener cannot be null.");
+ ResultReceiver wrappedListener = new ResultReceiver(null) {
+ @Override
+ protected void onReceiveResult(int resultCode, Bundle resultData) {
+ Binder.withCleanCallingIdentity(() ->
+ executor.execute(() -> {
+ listener.onEntitlementResult(resultCode);
+ }));
+ }
+ };
+
+ try {
+ String pkgName = mContext.getOpPackageName();
+ Log.i(TAG, "getLatestTetheringEntitlementResult:" + pkgName);
+ mService.getLatestTetheringEntitlementResult(type, wrappedListener,
+ showEntitlementUi, pkgName);
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * @removed
+ * @deprecated This API would be removed when all of caller has been updated.
+ * */
+ @Deprecated
public void getLatestTetheringEntitlementValue(int type, boolean showEntitlementUi,
@NonNull final TetheringEntitlementValueListener listener, @Nullable Handler handler) {
Preconditions.checkNotNull(listener, "TetheringEntitlementValueListener cannot be null.");
@@ -2733,7 +2789,7 @@
try {
String pkgName = mContext.getOpPackageName();
Log.i(TAG, "getLatestTetheringEntitlementValue:" + pkgName);
- mService.getLatestTetheringEntitlementValue(type, wrappedListener,
+ mService.getLatestTetheringEntitlementResult(type, wrappedListener,
showEntitlementUi, pkgName);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
@@ -4277,6 +4333,8 @@
* @return {@code uid} if the connection is found and the app has permission to observe it
* (e.g., if it is associated with the calling VPN app's tunnel) or
* {@link android.os.Process#INVALID_UID} if the connection is not found.
+ * Throws {@link SecurityException} if the caller is not the active VPN for the current user.
+ * Throws {@link IllegalArgumentException} if an unsupported protocol is requested.
*/
public int getConnectionOwnerUid(int protocol, @NonNull InetSocketAddress local,
@NonNull InetSocketAddress remote) {
diff --git a/core/java/android/net/DnsPacket.java b/core/java/android/net/DnsPacket.java
index 458fb34..0ac02b1 100644
--- a/core/java/android/net/DnsPacket.java
+++ b/core/java/android/net/DnsPacket.java
@@ -28,7 +28,6 @@
import java.text.FieldPosition;
import java.util.ArrayList;
import java.util.List;
-import java.util.StringJoiner;
/**
* Defines basic data for DNS protocol based on RFC 1035.
@@ -42,7 +41,7 @@
public final int id;
public final int flags;
public final int rcode;
- private final int[] mSectionCount;
+ private final int[] mRecordCount;
/**
* Create a new DnsHeader from a positioned ByteBuffer.
@@ -52,27 +51,32 @@
* When this constructor returns, the reading position of the ByteBuffer has been
* advanced to the end of the DNS header record.
* This is meant to chain with other methods reading a DNS response in sequence.
- *
*/
DnsHeader(@NonNull ByteBuffer buf) throws BufferUnderflowException {
id = BitUtils.uint16(buf.getShort());
flags = BitUtils.uint16(buf.getShort());
rcode = flags & 0xF;
- mSectionCount = new int[NUM_SECTIONS];
+ mRecordCount = new int[NUM_SECTIONS];
for (int i = 0; i < NUM_SECTIONS; ++i) {
- mSectionCount[i] = BitUtils.uint16(buf.getShort());
+ mRecordCount[i] = BitUtils.uint16(buf.getShort());
}
}
/**
- * Get section count by section type.
+ * Get record count by type.
*/
- public int getSectionCount(int sectionType) {
- return mSectionCount[sectionType];
+ public int getRecordCount(int type) {
+ return mRecordCount[type];
}
}
- public class DnsSection {
+ /**
+ * It's used both for DNS questions and DNS resource records.
+ *
+ * DNS questions (No TTL/RDATA)
+ * DNS resource records (With TTL/RDATA)
+ */
+ public class DnsRecord {
private static final int MAXNAMESIZE = 255;
private static final int MAXLABELSIZE = 63;
private static final int MAXLABELCOUNT = 128;
@@ -81,57 +85,57 @@
private final DecimalFormat byteFormat = new DecimalFormat();
private final FieldPosition pos = new FieldPosition(0);
- private static final String TAG = "DnsSection";
+ private static final String TAG = "DnsRecord";
public final String dName;
public final int nsType;
public final int nsClass;
public final long ttl;
- private final byte[] mRR;
+ private final byte[] mRdata;
/**
- * Create a new DnsSection from a positioned ByteBuffer.
+ * Create a new DnsRecord from a positioned ByteBuffer.
*
- * The ByteBuffer must be in network byte order (which is the default).
- * Reads the passed ByteBuffer from its current position and decodes a DNS section.
+ * @param ByteBuffer input of record, must be in network byte order
+ * (which is the default).
+ * Reads the passed ByteBuffer from its current position and decodes a DNS record.
* When this constructor returns, the reading position of the ByteBuffer has been
* advanced to the end of the DNS header record.
* This is meant to chain with other methods reading a DNS response in sequence.
- *
*/
- DnsSection(int sectionType, @NonNull ByteBuffer buf)
+ DnsRecord(int recordType, @NonNull ByteBuffer buf)
throws BufferUnderflowException, ParseException {
dName = parseName(buf, 0 /* Parse depth */);
if (dName.length() > MAXNAMESIZE) {
- throw new ParseException("Parse name fail, name size is too long");
+ throw new ParseException(
+ "Parse name fail, name size is too long: " + dName.length());
}
nsType = BitUtils.uint16(buf.getShort());
nsClass = BitUtils.uint16(buf.getShort());
- if (sectionType != QDSECTION) {
+ if (recordType != QDSECTION) {
ttl = BitUtils.uint32(buf.getInt());
final int length = BitUtils.uint16(buf.getShort());
- mRR = new byte[length];
- buf.get(mRR);
+ mRdata = new byte[length];
+ buf.get(mRdata);
} else {
ttl = 0;
- mRR = null;
+ mRdata = null;
}
}
/**
- * Get a copy of rr.
+ * Get a copy of rdata.
*/
- @Nullable public byte[] getRR() {
- return (mRR == null) ? null : mRR.clone();
+ @Nullable
+ public byte[] getRR() {
+ return (mRdata == null) ? null : mRdata.clone();
}
/**
* Convert label from {@code byte[]} to {@code String}
*
- * It follows the same converting rule as native layer.
- * (See ns_name.c in libc)
- *
+ * Follows the same conversion rules of the native code (ns_name.c in libc)
*/
private String labelToString(@NonNull byte[] label) {
final StringBuffer sb = new StringBuffer();
@@ -139,13 +143,16 @@
int b = BitUtils.uint8(label[i]);
// Control characters and non-ASCII characters.
if (b <= 0x20 || b >= 0x7f) {
+ // Append the byte as an escaped decimal number, e.g., "\19" for 0x13.
sb.append('\\');
byteFormat.format(b, sb, pos);
} else if (b == '"' || b == '.' || b == ';' || b == '\\'
|| b == '(' || b == ')' || b == '@' || b == '$') {
+ // Append the byte as an escaped character, e.g., "\:" for 0x3a.
sb.append('\\');
sb.append((char) b);
} else {
+ // Append the byte as a character, e.g., "a" for 0x61.
sb.append((char) b);
}
}
@@ -154,7 +161,9 @@
private String parseName(@NonNull ByteBuffer buf, int depth) throws
BufferUnderflowException, ParseException {
- if (depth > MAXLABELCOUNT) throw new ParseException("Parse name fails, too many labels");
+ if (depth > MAXLABELCOUNT) {
+ throw new ParseException("Failed to parse name, too many labels");
+ }
final int len = BitUtils.uint8(buf.get());
final int mask = len & NAME_COMPRESSION;
if (0 == len) {
@@ -194,7 +203,7 @@
private static final String TAG = DnsPacket.class.getSimpleName();
protected final DnsHeader mHeader;
- protected final List<DnsSection>[] mSections;
+ protected final List<DnsRecord>[] mRecords;
public static class ParseException extends Exception {
public ParseException(String msg) {
@@ -216,18 +225,18 @@
throw new ParseException("Parse Header fail, bad input data", e);
}
- mSections = new ArrayList[NUM_SECTIONS];
+ mRecords = new ArrayList[NUM_SECTIONS];
for (int i = 0; i < NUM_SECTIONS; ++i) {
- final int count = mHeader.getSectionCount(i);
+ final int count = mHeader.getRecordCount(i);
if (count > 0) {
- mSections[i] = new ArrayList(count);
+ mRecords[i] = new ArrayList(count);
}
for (int j = 0; j < count; ++j) {
try {
- mSections[i].add(new DnsSection(i, buffer));
+ mRecords[i].add(new DnsRecord(i, buffer));
} catch (BufferUnderflowException e) {
- throw new ParseException("Parse section fail", e);
+ throw new ParseException("Parse record fail", e);
}
}
}
diff --git a/core/java/android/net/DnsResolver.java b/core/java/android/net/DnsResolver.java
index 6d54264..d3bc3e6 100644
--- a/core/java/android/net/DnsResolver.java
+++ b/core/java/android/net/DnsResolver.java
@@ -43,6 +43,9 @@
/**
* Dns resolver class for asynchronous dns querying
*
+ * Note that if a client sends a query with more than 1 record in the question section but
+ * the remote dns server does not support this, it may not respond at all, leading to a timeout.
+ *
*/
public final class DnsResolver {
private static final String TAG = "DnsResolver";
@@ -226,19 +229,19 @@
if (mHeader.rcode != 0) {
throw new ParseException("Response error, rcode:" + mHeader.rcode);
}
- if (mHeader.getSectionCount(ANSECTION) == 0) {
+ if (mHeader.getRecordCount(ANSECTION) == 0) {
throw new ParseException("No available answer");
}
- if (mHeader.getSectionCount(QDSECTION) == 0) {
+ if (mHeader.getRecordCount(QDSECTION) == 0) {
throw new ParseException("No question found");
}
- // Assume only one question per answer packet. (RFC1035)
- mQueryType = mSections[QDSECTION].get(0).nsType;
+ // Expect only one question in question section.
+ mQueryType = mRecords[QDSECTION].get(0).nsType;
}
public @NonNull List<InetAddress> getAddresses() {
final List<InetAddress> results = new ArrayList<InetAddress>();
- for (final DnsSection ansSec : mSections[ANSECTION]) {
+ for (final DnsRecord ansSec : mRecords[ANSECTION]) {
// Only support A and AAAA, also ignore answers if query type != answer type.
int nsType = ansSec.nsType;
if (nsType != mQueryType || (nsType != TYPE_A && nsType != TYPE_AAAA)) {
diff --git a/core/java/android/net/IConnectivityManager.aidl b/core/java/android/net/IConnectivityManager.aidl
index 83bb3a0..ad903d9 100644
--- a/core/java/android/net/IConnectivityManager.aidl
+++ b/core/java/android/net/IConnectivityManager.aidl
@@ -47,10 +47,12 @@
{
Network getActiveNetwork();
Network getActiveNetworkForUid(int uid, boolean ignoreBlocked);
+ @UnsupportedAppUsage
NetworkInfo getActiveNetworkInfo();
NetworkInfo getActiveNetworkInfoForUid(int uid, boolean ignoreBlocked);
NetworkInfo getNetworkInfo(int networkType);
NetworkInfo getNetworkInfoForUid(in Network network, int uid, boolean ignoreBlocked);
+ @UnsupportedAppUsage
NetworkInfo[] getAllNetworkInfo();
Network getNetworkForType(int networkType);
Network[] getAllNetworks();
@@ -58,12 +60,14 @@
boolean isNetworkSupported(int networkType);
+ @UnsupportedAppUsage
LinkProperties getActiveLinkProperties();
LinkProperties getLinkPropertiesForType(int networkType);
LinkProperties getLinkProperties(in Network network);
NetworkCapabilities getNetworkCapabilities(in Network network);
+ @UnsupportedAppUsage
NetworkState[] getAllNetworkState();
NetworkQuotaInfo getActiveNetworkQuotaInfo();
@@ -75,6 +79,7 @@
int untether(String iface, String callerPkg);
+ @UnsupportedAppUsage
int getLastTetherError(String iface);
boolean isTetheringSupported(String callerPkg);
@@ -84,16 +89,21 @@
void stopTethering(int type, String callerPkg);
+ @UnsupportedAppUsage
String[] getTetherableIfaces();
+ @UnsupportedAppUsage
String[] getTetheredIfaces();
+ @UnsupportedAppUsage
String[] getTetheringErroredIfaces();
String[] getTetheredDhcpRanges();
+ @UnsupportedAppUsage
String[] getTetherableUsbRegexs();
+ @UnsupportedAppUsage
String[] getTetherableWifiRegexs();
String[] getTetherableBluetoothRegexs();
@@ -118,12 +128,11 @@
VpnConfig getVpnConfig(int userId);
+ @UnsupportedAppUsage
void startLegacyVpn(in VpnProfile profile);
LegacyVpnInfo getLegacyVpnInfo(int userId);
- VpnInfo[] getAllVpnInfo();
-
boolean updateLockdownVpn();
boolean isAlwaysOnVpnPackageSupported(int userId, String packageName);
boolean setAlwaysOnVpnPackage(int userId, String packageName, boolean lockdown,
@@ -203,6 +212,6 @@
boolean isCallerCurrentAlwaysOnVpnApp();
boolean isCallerCurrentAlwaysOnVpnLockdownApp();
- void getLatestTetheringEntitlementValue(int type, in ResultReceiver receiver,
+ void getLatestTetheringEntitlementResult(int type, in ResultReceiver receiver,
boolean showEntitlementUi, String callerPkg);
}
diff --git a/core/java/android/net/INetworkPolicyManager.aidl b/core/java/android/net/INetworkPolicyManager.aidl
index e92302a..385cb1d 100644
--- a/core/java/android/net/INetworkPolicyManager.aidl
+++ b/core/java/android/net/INetworkPolicyManager.aidl
@@ -31,9 +31,11 @@
interface INetworkPolicyManager {
/** Control UID policies. */
+ @UnsupportedAppUsage
void setUidPolicy(int uid, int policy);
void addUidPolicy(int uid, int policy);
void removeUidPolicy(int uid, int policy);
+ @UnsupportedAppUsage
int getUidPolicy(int uid);
int[] getUidsWithPolicy(int policy);
@@ -41,14 +43,18 @@
void unregisterListener(INetworkPolicyListener listener);
/** Control network policies atomically. */
+ @UnsupportedAppUsage
void setNetworkPolicies(in NetworkPolicy[] policies);
NetworkPolicy[] getNetworkPolicies(String callingPackage);
/** Snooze limit on policy matching given template. */
+ @UnsupportedAppUsage
void snoozeLimit(in NetworkTemplate template);
/** Control if background data is restricted system-wide. */
+ @UnsupportedAppUsage
void setRestrictBackground(boolean restrictBackground);
+ @UnsupportedAppUsage
boolean getRestrictBackground();
/** Callback used to change internal state on tethering */
@@ -64,6 +70,7 @@
void setDeviceIdleMode(boolean enabled);
void setWifiMeteredOverride(String networkId, int meteredOverride);
+ @UnsupportedAppUsage
NetworkQuotaInfo getNetworkQuotaInfo(in NetworkState state);
SubscriptionPlan[] getSubscriptionPlans(int subId, String callingPackage);
diff --git a/core/java/android/net/INetworkStatsService.aidl b/core/java/android/net/INetworkStatsService.aidl
index 8e6f272..41efc50 100644
--- a/core/java/android/net/INetworkStatsService.aidl
+++ b/core/java/android/net/INetworkStatsService.aidl
@@ -19,16 +19,19 @@
import android.net.DataUsageRequest;
import android.net.INetworkStatsSession;
import android.net.Network;
+import android.net.NetworkState;
import android.net.NetworkStats;
import android.net.NetworkStatsHistory;
import android.net.NetworkTemplate;
import android.os.IBinder;
import android.os.Messenger;
+import com.android.internal.net.VpnInfo;
/** {@hide} */
interface INetworkStatsService {
/** Start a statistics query session. */
+ @UnsupportedAppUsage
INetworkStatsSession openSession();
/** Start a statistics query session. If calling package is profile or device owner then it is
@@ -37,9 +40,11 @@
* PACKAGE_USAGE_STATS permission is always checked. If PACKAGE_USAGE_STATS is not granted
* READ_NETWORK_USAGE_STATS is checked for.
*/
+ @UnsupportedAppUsage
INetworkStatsSession openSessionForUsageStats(int flags, String callingPackage);
/** Return data layer snapshot of UID network usage. */
+ @UnsupportedAppUsage
NetworkStats getDataLayerSnapshotForUid(int uid);
/** Get a detailed snapshot of stats since boot for all UIDs.
@@ -52,14 +57,20 @@
NetworkStats getDetailedUidStats(in String[] requiredIfaces);
/** Return set of any ifaces associated with mobile networks since boot. */
+ @UnsupportedAppUsage
String[] getMobileIfaces();
/** Increment data layer count of operations performed for UID and tag. */
void incrementOperationCount(int uid, int tag, int operationCount);
/** Force update of ifaces. */
- void forceUpdateIfaces(in Network[] defaultNetworks);
+ void forceUpdateIfaces(
+ in Network[] defaultNetworks,
+ in VpnInfo[] vpnArray,
+ in NetworkState[] networkStates,
+ in String activeIface);
/** Force update of statistics. */
+ @UnsupportedAppUsage
void forceUpdate();
/** Registers a callback on data usage. */
diff --git a/core/java/android/net/INetworkStatsSession.aidl b/core/java/android/net/INetworkStatsSession.aidl
index 5229a3b..f13f2cb 100644
--- a/core/java/android/net/INetworkStatsSession.aidl
+++ b/core/java/android/net/INetworkStatsSession.aidl
@@ -27,13 +27,17 @@
NetworkStats getDeviceSummaryForNetwork(in NetworkTemplate template, long start, long end);
/** Return network layer usage summary for traffic that matches template. */
+ @UnsupportedAppUsage
NetworkStats getSummaryForNetwork(in NetworkTemplate template, long start, long end);
/** Return historical network layer stats for traffic that matches template. */
+ @UnsupportedAppUsage
NetworkStatsHistory getHistoryForNetwork(in NetworkTemplate template, int fields);
/** Return network layer usage summary per UID for traffic that matches template. */
+ @UnsupportedAppUsage
NetworkStats getSummaryForAllUid(in NetworkTemplate template, long start, long end, boolean includeTags);
/** Return historical network layer stats for specific UID traffic that matches template. */
+ @UnsupportedAppUsage
NetworkStatsHistory getHistoryForUid(in NetworkTemplate template, int uid, int set, int tag, int fields);
/** Return historical network layer stats for specific UID traffic that matches template. */
NetworkStatsHistory getHistoryIntervalForUid(in NetworkTemplate template, int uid, int set, int tag, int fields, long start, long end);
@@ -41,6 +45,7 @@
/** Return array of uids that have stats and are accessible to the calling user */
int[] getRelevantUids();
+ @UnsupportedAppUsage
void close();
}
diff --git a/core/java/android/net/ITestNetworkManager.aidl b/core/java/android/net/ITestNetworkManager.aidl
new file mode 100644
index 0000000..119a30c
--- /dev/null
+++ b/core/java/android/net/ITestNetworkManager.aidl
@@ -0,0 +1,36 @@
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.net;
+
+import android.net.LinkAddress;
+import android.net.TestNetworkInterface;
+import android.os.IBinder;
+import android.os.ParcelFileDescriptor;
+
+/**
+ * Interface that allows for creation and management of test-only networks.
+ *
+ * @hide
+ */
+interface ITestNetworkManager
+{
+ TestNetworkInterface createTunInterface(in LinkAddress[] linkAddrs);
+
+ void setupTestNetwork(in String iface, in IBinder binder);
+
+ void teardownTestNetwork(int netId);
+}
diff --git a/core/java/android/net/InetAddresses.java b/core/java/android/net/InetAddresses.java
index 8e6c69a..01b795e 100644
--- a/core/java/android/net/InetAddresses.java
+++ b/core/java/android/net/InetAddresses.java
@@ -16,6 +16,8 @@
package android.net;
+import android.annotation.NonNull;
+
import libcore.net.InetAddressUtils;
import java.net.InetAddress;
@@ -40,7 +42,7 @@
* @param address the address to parse.
* @return true if the supplied address is numeric, false otherwise.
*/
- public static boolean isNumericAddress(String address) {
+ public static boolean isNumericAddress(@NonNull String address) {
return InetAddressUtils.isNumericAddress(address);
}
@@ -57,7 +59,7 @@
* @return an {@link InetAddress} instance corresponding to the address.
* @throws IllegalArgumentException if {@code address} is not a numeric address.
*/
- public static InetAddress parseNumericAddress(String address) {
+ public static @NonNull InetAddress parseNumericAddress(@NonNull String address) {
return InetAddressUtils.parseNumericAddress(address);
}
}
diff --git a/core/java/android/net/LinkAddress.java b/core/java/android/net/LinkAddress.java
index 8d779aa..8b01960 100644
--- a/core/java/android/net/LinkAddress.java
+++ b/core/java/android/net/LinkAddress.java
@@ -25,6 +25,7 @@
import static android.system.OsConstants.RT_SCOPE_SITE;
import static android.system.OsConstants.RT_SCOPE_UNIVERSE;
+import android.annotation.NonNull;
import android.annotation.SystemApi;
import android.annotation.TestApi;
import android.annotation.UnsupportedAppUsage;
@@ -177,7 +178,7 @@
*/
@SystemApi
@TestApi
- public LinkAddress(InetAddress address, int prefixLength) {
+ public LinkAddress(@NonNull InetAddress address, int prefixLength) {
this(address, prefixLength, 0, 0);
this.scope = scopeForUnicastAddress(address);
}
@@ -196,12 +197,12 @@
/**
* Constructs a new {@code LinkAddress} from a string such as "192.0.2.5/24" or
* "2001:db8::1/64". The flags are set to zero and the scope is determined from the address.
- * @param string The string to parse.
+ * @param address The string to parse.
* @hide
*/
@SystemApi
@TestApi
- public LinkAddress(String address) {
+ public LinkAddress(@NonNull String address) {
this(address, 0, 0);
this.scope = scopeForUnicastAddress(this.address);
}
@@ -209,7 +210,7 @@
/**
* Constructs a new {@code LinkAddress} from a string such as "192.0.2.5/24" or
* "2001:db8::1/64", with the specified flags and scope.
- * @param string The string to parse.
+ * @param address The string to parse.
* @param flags The address flags.
* @param scope The address scope.
* @hide
diff --git a/core/java/android/net/NetworkCapabilities.java b/core/java/android/net/NetworkCapabilities.java
index 1d2d81d..0a63e75 100644
--- a/core/java/android/net/NetworkCapabilities.java
+++ b/core/java/android/net/NetworkCapabilities.java
@@ -143,6 +143,7 @@
NET_CAPABILITY_NOT_CONGESTED,
NET_CAPABILITY_NOT_SUSPENDED,
NET_CAPABILITY_OEM_PAID,
+ NET_CAPABILITY_MCX
})
public @interface NetCapability { }
@@ -297,8 +298,14 @@
@SystemApi
public static final int NET_CAPABILITY_OEM_PAID = 22;
+ /**
+ * Indicates this is a network that has the ability to reach a carrier's Mission Critical
+ * servers.
+ */
+ public static final int NET_CAPABILITY_MCX = 23;
+
private static final int MIN_NET_CAPABILITY = NET_CAPABILITY_MMS;
- private static final int MAX_NET_CAPABILITY = NET_CAPABILITY_OEM_PAID;
+ private static final int MAX_NET_CAPABILITY = NET_CAPABILITY_MCX;
/**
* Network capabilities that are expected to be mutable, i.e., can change while a particular
@@ -346,7 +353,8 @@
(1 << NET_CAPABILITY_IA) |
(1 << NET_CAPABILITY_IMS) |
(1 << NET_CAPABILITY_RCS) |
- (1 << NET_CAPABILITY_XCAP);
+ (1 << NET_CAPABILITY_XCAP) |
+ (1 << NET_CAPABILITY_MCX);
/**
* Capabilities that force network to be restricted.
@@ -1614,6 +1622,7 @@
case NET_CAPABILITY_NOT_CONGESTED: return "NOT_CONGESTED";
case NET_CAPABILITY_NOT_SUSPENDED: return "NOT_SUSPENDED";
case NET_CAPABILITY_OEM_PAID: return "OEM_PAID";
+ case NET_CAPABILITY_MCX: return "MCX";
default: return Integer.toString(capability);
}
}
diff --git a/core/java/android/net/OWNERS b/core/java/android/net/OWNERS
index 15f4913..a1c7fce 100644
--- a/core/java/android/net/OWNERS
+++ b/core/java/android/net/OWNERS
@@ -1,12 +1,11 @@
set noparent
codewiz@google.com
-ek@google.com
-jsharkey@android.com
jchalard@google.com
+jsharkey@android.com
+junyulai@google.com
lorenzo@google.com
reminv@google.com
satk@google.com
-silberst@google.com
per-file SSL*, Uri*, Url* = flooey@google.com, narayan@google.com, tobiast@google.com
diff --git a/core/java/android/net/TestNetworkInterface.aidl b/core/java/android/net/TestNetworkInterface.aidl
new file mode 100644
index 0000000..e1f4f9f
--- /dev/null
+++ b/core/java/android/net/TestNetworkInterface.aidl
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.net;
+
+/** @hide */
+parcelable TestNetworkInterface;
diff --git a/core/java/android/net/TestNetworkInterface.java b/core/java/android/net/TestNetworkInterface.java
new file mode 100644
index 0000000..30e68f5
--- /dev/null
+++ b/core/java/android/net/TestNetworkInterface.java
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package android.net;
+
+import android.annotation.TestApi;
+import android.os.Parcel;
+import android.os.ParcelFileDescriptor;
+import android.os.Parcelable;
+
+/**
+ * This class is used to return the interface name and fd of the test interface
+ *
+ * @hide
+ */
+@TestApi
+public final class TestNetworkInterface implements Parcelable {
+ private static final String TAG = "TestNetworkInterface";
+
+ private final ParcelFileDescriptor mFileDescriptor;
+ private final String mInterfaceName;
+
+ @Override
+ public int describeContents() {
+ return (mFileDescriptor != null) ? Parcelable.CONTENTS_FILE_DESCRIPTOR : 0;
+ }
+
+ @Override
+ public void writeToParcel(Parcel out, int flags) {
+ out.writeParcelable(mFileDescriptor, PARCELABLE_WRITE_RETURN_VALUE);
+ out.writeString(mInterfaceName);
+ }
+
+ public TestNetworkInterface(ParcelFileDescriptor pfd, String intf) {
+ mFileDescriptor = pfd;
+ mInterfaceName = intf;
+ }
+
+ private TestNetworkInterface(Parcel in) {
+ mFileDescriptor = in.readParcelable(ParcelFileDescriptor.class.getClassLoader());
+ mInterfaceName = in.readString();
+ }
+
+ public ParcelFileDescriptor getFileDescriptor() {
+ return mFileDescriptor;
+ }
+
+ public String getInterfaceName() {
+ return mInterfaceName;
+ }
+
+ public static final Parcelable.Creator<TestNetworkInterface> CREATOR =
+ new Parcelable.Creator<TestNetworkInterface>() {
+ public TestNetworkInterface createFromParcel(Parcel in) {
+ return new TestNetworkInterface(in);
+ }
+
+ public TestNetworkInterface[] newArray(int size) {
+ return new TestNetworkInterface[size];
+ }
+ };
+}
diff --git a/core/java/android/net/TestNetworkManager.java b/core/java/android/net/TestNetworkManager.java
new file mode 100644
index 0000000..cd58e66
--- /dev/null
+++ b/core/java/android/net/TestNetworkManager.java
@@ -0,0 +1,91 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package android.net;
+
+import android.annotation.NonNull;
+import android.annotation.TestApi;
+import android.content.Context;
+import android.os.IBinder;
+import android.os.RemoteException;
+
+import com.android.internal.util.Preconditions;
+
+/**
+ * Class that allows creation and management of per-app, test-only networks
+ *
+ * @hide
+ */
+@TestApi
+public class TestNetworkManager {
+ @NonNull private static final String TAG = TestNetworkManager.class.getSimpleName();
+
+ @NonNull private final ITestNetworkManager mService;
+ @NonNull private final Context mContext;
+
+ /** @hide */
+ public TestNetworkManager(@NonNull Context context, @NonNull ITestNetworkManager service) {
+ mContext = Preconditions.checkNotNull(context, "missing Context");
+ mService = Preconditions.checkNotNull(service, "missing ITestNetworkManager");
+ }
+
+ /**
+ * Teardown the capability-limited, testing-only network for a given interface
+ *
+ * @param network The test network that should be torn down
+ * @hide
+ */
+ @TestApi
+ public void teardownTestNetwork(@NonNull Network network) {
+ try {
+ mService.teardownTestNetwork(network.netId);
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * Sets up a capability-limited, testing-only network for a given interface
+ *
+ * @param iface the name of the interface to be used for the Network LinkProperties.
+ * @param binder A binder object guarding the lifecycle of this test network.
+ * @hide
+ */
+ @TestApi
+ public void setupTestNetwork(@NonNull String iface, @NonNull IBinder binder) {
+ try {
+ mService.setupTestNetwork(iface, binder);
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * Create a tun interface for testing purposes
+ *
+ * @param linkAddrs an array of LinkAddresses to assign to the TUN interface
+ * @return A ParcelFileDescriptor of the underlying TUN interface. Close this to tear down the
+ * TUN interface.
+ * @hide
+ */
+ @TestApi
+ public TestNetworkInterface createTunInterface(@NonNull LinkAddress[] linkAddrs) {
+ try {
+ return mService.createTunInterface(linkAddrs);
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+}
diff --git a/core/java/android/net/Uri.java b/core/java/android/net/Uri.java
index af3ee09..28b2707 100644
--- a/core/java/android/net/Uri.java
+++ b/core/java/android/net/Uri.java
@@ -402,7 +402,7 @@
}
return builder.toString();
} else if (scheme.equalsIgnoreCase("http") || scheme.equalsIgnoreCase("https")
- || scheme.equalsIgnoreCase("ftp")) {
+ || scheme.equalsIgnoreCase("ftp") || scheme.equalsIgnoreCase("rtsp")) {
ssp = "//" + ((getHost() != null) ? getHost() : "")
+ ((getPort() != -1) ? (":" + getPort()) : "")
+ "/...";
diff --git a/core/java/android/net/VpnService.java b/core/java/android/net/VpnService.java
index ebb1ae4..870d8b1 100644
--- a/core/java/android/net/VpnService.java
+++ b/core/java/android/net/VpnService.java
@@ -20,6 +20,7 @@
import static android.system.OsConstants.AF_INET6;
import android.annotation.NonNull;
+import android.annotation.Nullable;
import android.annotation.RequiresPermission;
import android.annotation.SystemApi;
import android.annotation.UnsupportedAppUsage;
@@ -479,7 +480,8 @@
* system-managed dialogs and notifications. This is recommended
* not required.
*/
- public Builder setSession(String session) {
+ @NonNull
+ public Builder setSession(@NonNull String session) {
mConfig.session = session;
return this;
}
@@ -489,7 +491,8 @@
* configure the VPN connection. If it is not set, the button
* to configure will not be shown in system-managed dialogs.
*/
- public Builder setConfigureIntent(PendingIntent intent) {
+ @NonNull
+ public Builder setConfigureIntent(@NonNull PendingIntent intent) {
mConfig.configureIntent = intent;
return this;
}
@@ -501,6 +504,7 @@
*
* @throws IllegalArgumentException if the value is not positive.
*/
+ @NonNull
public Builder setMtu(int mtu) {
if (mtu <= 0) {
throw new IllegalArgumentException("Bad mtu");
@@ -513,6 +517,7 @@
* Sets an HTTP proxy for the VPN network. This proxy is only a recommendation
* and it is possible that some apps will ignore it.
*/
+ @NonNull
public Builder setHttpProxy(@NonNull ProxyInfo proxyInfo) {
mConfig.proxyInfo = proxyInfo;
return this;
@@ -528,7 +533,8 @@
*
* @throws IllegalArgumentException if the address is invalid.
*/
- public Builder addAddress(InetAddress address, int prefixLength) {
+ @NonNull
+ public Builder addAddress(@NonNull InetAddress address, int prefixLength) {
check(address, prefixLength);
if (address.isAnyLocalAddress()) {
@@ -550,7 +556,8 @@
* @throws IllegalArgumentException if the address is invalid.
* @see #addAddress(InetAddress, int)
*/
- public Builder addAddress(String address, int prefixLength) {
+ @NonNull
+ public Builder addAddress(@NonNull String address, int prefixLength) {
return addAddress(InetAddress.parseNumericAddress(address), prefixLength);
}
@@ -563,7 +570,8 @@
*
* @throws IllegalArgumentException if the route is invalid.
*/
- public Builder addRoute(InetAddress address, int prefixLength) {
+ @NonNull
+ public Builder addRoute(@NonNull InetAddress address, int prefixLength) {
check(address, prefixLength);
int offset = prefixLength / 8;
@@ -591,7 +599,8 @@
* @throws IllegalArgumentException if the route is invalid.
* @see #addRoute(InetAddress, int)
*/
- public Builder addRoute(String address, int prefixLength) {
+ @NonNull
+ public Builder addRoute(@NonNull String address, int prefixLength) {
return addRoute(InetAddress.parseNumericAddress(address), prefixLength);
}
@@ -605,7 +614,8 @@
*
* @throws IllegalArgumentException if the address is invalid.
*/
- public Builder addDnsServer(InetAddress address) {
+ @NonNull
+ public Builder addDnsServer(@NonNull InetAddress address) {
if (address.isLoopbackAddress() || address.isAnyLocalAddress()) {
throw new IllegalArgumentException("Bad address");
}
@@ -627,14 +637,16 @@
* @throws IllegalArgumentException if the address is invalid.
* @see #addDnsServer(InetAddress)
*/
- public Builder addDnsServer(String address) {
+ @NonNull
+ public Builder addDnsServer(@NonNull String address) {
return addDnsServer(InetAddress.parseNumericAddress(address));
}
/**
* Add a search domain to the DNS resolver.
*/
- public Builder addSearchDomain(String domain) {
+ @NonNull
+ public Builder addSearchDomain(@NonNull String domain) {
if (mConfig.searchDomains == null) {
mConfig.searchDomains = new ArrayList<String>();
}
@@ -660,6 +672,7 @@
*
* @return this {@link Builder} object to facilitate chaining of method calls.
*/
+ @NonNull
public Builder allowFamily(int family) {
if (family == AF_INET) {
mConfig.allowIPv4 = true;
@@ -703,7 +716,8 @@
*
* @return this {@link Builder} object to facilitate chaining method calls.
*/
- public Builder addAllowedApplication(String packageName)
+ @NonNull
+ public Builder addAllowedApplication(@NonNull String packageName)
throws PackageManager.NameNotFoundException {
if (mConfig.disallowedApplications != null) {
throw new UnsupportedOperationException("addDisallowedApplication already called");
@@ -735,7 +749,8 @@
*
* @return this {@link Builder} object to facilitate chaining method calls.
*/
- public Builder addDisallowedApplication(String packageName)
+ @NonNull
+ public Builder addDisallowedApplication(@NonNull String packageName)
throws PackageManager.NameNotFoundException {
if (mConfig.allowedApplications != null) {
throw new UnsupportedOperationException("addAllowedApplication already called");
@@ -758,6 +773,7 @@
*
* @return this {@link Builder} object to facilitate chaining of method calls.
*/
+ @NonNull
public Builder allowBypass() {
mConfig.allowBypass = true;
return this;
@@ -772,6 +788,7 @@
*
* @return this {@link Builder} object to facilitate chaining method calls.
*/
+ @NonNull
public Builder setBlocking(boolean blocking) {
mConfig.blocking = blocking;
return this;
@@ -786,7 +803,8 @@
*
* @return this {@link Builder} object to facilitate chaining method calls.
*/
- public Builder setUnderlyingNetworks(Network[] networks) {
+ @NonNull
+ public Builder setUnderlyingNetworks(@Nullable Network[] networks) {
mConfig.underlyingNetworks = networks != null ? networks.clone() : null;
return this;
}
@@ -807,6 +825,7 @@
* @see #setUnderlyingNetworks(Networks[])
* @see ConnectivityManager#isActiveNetworkMetered()
*/
+ @NonNull
public Builder setMetered(boolean isMetered) {
mConfig.isMetered = isMetered;
return this;
@@ -855,6 +874,7 @@
* in {@code AndroidManifest.xml}.
* @see VpnService
*/
+ @Nullable
public ParcelFileDescriptor establish() {
mConfig.addresses = mAddresses;
mConfig.routes = mRoutes;
diff --git a/core/java/android/net/http/SslCertificate.java b/core/java/android/net/http/SslCertificate.java
index 6fcd6eb..01dd08f 100644
--- a/core/java/android/net/http/SslCertificate.java
+++ b/core/java/android/net/http/SslCertificate.java
@@ -16,6 +16,7 @@
package android.net.http;
+import android.annotation.Nullable;
import android.annotation.UnsupportedAppUsage;
import android.content.Context;
import android.os.Bundle;
@@ -252,7 +253,7 @@
* @return The {@code X509Certificate} used to create this {@code SslCertificate} or
* {@code null} if no certificate was provided.
*/
- public X509Certificate getX509Certificate() {
+ public @Nullable X509Certificate getX509Certificate() {
return mX509Certificate;
}
diff --git a/core/java/android/net/util/SocketUtils.java b/core/java/android/net/util/SocketUtils.java
index fbb15ed..5827f9e 100644
--- a/core/java/android/net/util/SocketUtils.java
+++ b/core/java/android/net/util/SocketUtils.java
@@ -19,6 +19,8 @@
import static android.system.OsConstants.SOL_SOCKET;
import static android.system.OsConstants.SO_BINDTODEVICE;
+import android.annotation.NonNull;
+import android.annotation.Nullable;
import android.annotation.SystemApi;
import android.annotation.TestApi;
import android.net.MacAddress;
@@ -49,7 +51,7 @@
*
* <p>Data sent through the socket will go directly to the underlying network, ignoring VPNs.
*/
- public static void bindSocketToInterface(FileDescriptor socket, String iface)
+ public static void bindSocketToInterface(@NonNull FileDescriptor socket, @NonNull String iface)
throws ErrnoException {
// SO_BINDTODEVICE actually takes a string. This works because the first member
// of struct ifreq is a NULL-terminated interface name.
@@ -75,7 +77,7 @@
/**
* Make a socket address that packet socket can send packets to.
*/
- public static SocketAddress makePacketSocketAddress(int ifIndex, byte[] hwAddr) {
+ public static SocketAddress makePacketSocketAddress(int ifIndex, @NonNull byte[] hwAddr) {
return new PacketSocketAddress(ifIndex, hwAddr);
}
@@ -83,45 +85,21 @@
* Set an option on a socket that takes a time value argument.
*/
public static void setSocketTimeValueOption(
- FileDescriptor fd, int level, int option, long millis) throws ErrnoException {
+ @NonNull FileDescriptor fd, int level, int option, long millis) throws ErrnoException {
Os.setsockoptTimeval(fd, level, option, StructTimeval.fromMillis(millis));
}
/**
- * Bind a socket to the specified address.
- */
- public static void bindSocket(FileDescriptor fd, SocketAddress addr)
- throws ErrnoException, SocketException {
- Os.bind(fd, addr);
- }
-
- /**
- * Connect a socket to the specified address.
- */
- public static void connectSocket(FileDescriptor fd, SocketAddress addr)
- throws ErrnoException, SocketException {
- Os.connect(fd, addr);
- }
-
- /**
- * Send a message on a socket, using the specified SocketAddress.
- */
- public static void sendTo(FileDescriptor fd, byte[] bytes, int byteOffset, int byteCount,
- int flags, SocketAddress addr) throws ErrnoException, SocketException {
- Os.sendto(fd, bytes, byteOffset, byteCount, flags, addr);
- }
-
- /**
* @see IoBridge#closeAndSignalBlockedThreads(FileDescriptor)
*/
- public static void closeSocket(FileDescriptor fd) throws IOException {
+ public static void closeSocket(@Nullable FileDescriptor fd) throws IOException {
IoBridge.closeAndSignalBlockedThreads(fd);
}
/**
* Attaches a socket filter that accepts DHCP packets to the given socket.
*/
- public static void attachDhcpFilter(FileDescriptor fd) throws SocketException {
+ public static void attachDhcpFilter(@NonNull FileDescriptor fd) throws SocketException {
NetworkUtils.attachDhcpFilter(fd);
}
@@ -130,7 +108,8 @@
* @param fd the socket's {@link FileDescriptor}.
* @param packetType the hardware address type, one of ARPHRD_*.
*/
- public static void attachRaFilter(FileDescriptor fd, int packetType) throws SocketException {
+ public static void attachRaFilter(@NonNull FileDescriptor fd, int packetType)
+ throws SocketException {
NetworkUtils.attachRaFilter(fd, packetType);
}
@@ -142,7 +121,7 @@
* @param fd the socket's {@link FileDescriptor}.
* @param packetType the hardware address type, one of ARPHRD_*.
*/
- public static void attachControlPacketFilter(FileDescriptor fd, int packetType)
+ public static void attachControlPacketFilter(@NonNull FileDescriptor fd, int packetType)
throws SocketException {
NetworkUtils.attachControlPacketFilter(fd, packetType);
}
@@ -150,8 +129,8 @@
/**
* Add an entry into the ARP cache.
*/
- public static void addArpEntry(Inet4Address ipv4Addr, MacAddress ethAddr, String ifname,
- FileDescriptor fd) throws IOException {
+ public static void addArpEntry(@NonNull Inet4Address ipv4Addr, @NonNull MacAddress ethAddr,
+ @NonNull String ifname, @NonNull FileDescriptor fd) throws IOException {
NetworkUtils.addArpEntry(ipv4Addr, ethAddr, ifname, fd);
}
diff --git a/core/java/android/nfc/INfcAdapterExtras.aidl b/core/java/android/nfc/INfcAdapterExtras.aidl
index 41ebf63..dd260bc 100644
--- a/core/java/android/nfc/INfcAdapterExtras.aidl
+++ b/core/java/android/nfc/INfcAdapterExtras.aidl
@@ -23,11 +23,18 @@
* {@hide}
*/
interface INfcAdapterExtras {
+ @UnsupportedAppUsage
Bundle open(in String pkg, IBinder b);
+ @UnsupportedAppUsage
Bundle close(in String pkg, IBinder b);
+ @UnsupportedAppUsage
Bundle transceive(in String pkg, in byte[] data_in);
+ @UnsupportedAppUsage
int getCardEmulationRoute(in String pkg);
+ @UnsupportedAppUsage
void setCardEmulationRoute(in String pkg, int route);
+ @UnsupportedAppUsage
void authenticate(in String pkg, in byte[] token);
+ @UnsupportedAppUsage
String getDriverName(in String pkg);
}
diff --git a/core/java/android/nfc/cardemulation/CardEmulation.java b/core/java/android/nfc/cardemulation/CardEmulation.java
index 01932ab..f23dc2d 100644
--- a/core/java/android/nfc/cardemulation/CardEmulation.java
+++ b/core/java/android/nfc/cardemulation/CardEmulation.java
@@ -16,6 +16,7 @@
package android.nfc.cardemulation;
+import android.annotation.NonNull;
import android.annotation.SdkConstant;
import android.annotation.SdkConstant.SdkConstantType;
import android.app.Activity;
@@ -359,7 +360,7 @@
* @param service The component name of the service
* @return whether the registration was successful.
*/
- public boolean unsetOffHostForService(ComponentName service) {
+ public boolean unsetOffHostForService(@NonNull ComponentName service) {
NfcAdapter adapter = NfcAdapter.getDefaultAdapter(mContext);
if (adapter == null) {
return false;
@@ -405,7 +406,8 @@
* @param offHostSecureElement Secure Element to register the AID to
* @return whether the registration was successful.
*/
- public boolean setOffHostForService(ComponentName service, String offHostSecureElement) {
+ public boolean setOffHostForService(@NonNull ComponentName service,
+ @NonNull String offHostSecureElement) {
boolean validSecureElement = false;
NfcAdapter adapter = NfcAdapter.getDefaultAdapter(mContext);
diff --git a/core/java/android/os/HwBlob.java b/core/java/android/os/HwBlob.java
index 0ec63b5..2c453bf 100644
--- a/core/java/android/os/HwBlob.java
+++ b/core/java/android/os/HwBlob.java
@@ -17,6 +17,7 @@
package android.os;
import android.annotation.NonNull;
+import android.annotation.Nullable;
import android.annotation.SystemApi;
import android.annotation.TestApi;
@@ -241,7 +242,7 @@
* @param x a {@link NativeHandle} instance to write
* @throws IndexOutOfBoundsException when [offset, offset + sizeof(jobject)] is out of range
*/
- public native final void putNativeHandle(long offset, NativeHandle x);
+ public native final void putNativeHandle(long offset, @Nullable NativeHandle x);
/**
* Put a boolean array contiguously at an offset in the blob.
diff --git a/core/java/android/os/HwParcel.java b/core/java/android/os/HwParcel.java
index 7919a00..dc640c9 100644
--- a/core/java/android/os/HwParcel.java
+++ b/core/java/android/os/HwParcel.java
@@ -17,6 +17,8 @@
package android.os;
import android.annotation.IntDef;
+import android.annotation.NonNull;
+import android.annotation.Nullable;
import android.annotation.SystemApi;
import android.annotation.TestApi;
@@ -123,7 +125,7 @@
*
* @param val to write
*/
- public native final void writeNativeHandle(NativeHandle val);
+ public native final void writeNativeHandle(@Nullable NativeHandle val);
/**
* Writes an array of boolean values to the end of the parcel.
@@ -170,6 +172,9 @@
private native final void writeStringVector(String[] val);
/**
* Writes an array of native handles to the end of the parcel.
+ *
+ * Individual elements may be null but not the whole array.
+ *
* @param val array of {@link NativeHandle} objects to write
*/
private native final void writeNativeHandleVector(NativeHandle[] val);
@@ -284,7 +289,7 @@
* Helper method to write a list of native handles to the end of the parcel.
* @param val list of {@link NativeHandle} objects to write
*/
- public final void writeNativeHandleVector(ArrayList<NativeHandle> val) {
+ public final void writeNativeHandleVector(@NonNull ArrayList<NativeHandle> val) {
writeNativeHandleVector(val.toArray(new NativeHandle[val.size()]));
}
@@ -359,7 +364,7 @@
* @return a {@link NativeHandle} instance parsed from the parcel
* @throws IllegalArgumentException if the parcel has no more data
*/
- public native final NativeHandle readNativeHandle();
+ public native final @Nullable NativeHandle readNativeHandle();
/**
* Reads an embedded native handle (without duplicating the underlying
* file descriptors) from the parcel. These file descriptors will only
@@ -372,7 +377,7 @@
* @return a {@link NativeHandle} instance parsed from the parcel
* @throws IllegalArgumentException if the parcel has no more data
*/
- public native final NativeHandle readEmbeddedNativeHandle(
+ public native final @Nullable NativeHandle readEmbeddedNativeHandle(
long parentHandle, long offset);
/**
@@ -521,7 +526,7 @@
* @return array of {@link NativeHandle} objects.
* @throws IllegalArgumentException if the parcel has no more data
*/
- public final ArrayList<NativeHandle> readNativeHandleVector() {
+ public final @NonNull ArrayList<NativeHandle> readNativeHandleVector() {
return new ArrayList<NativeHandle>(Arrays.asList(readNativeHandleAsArray()));
}
diff --git a/core/java/android/os/NativeHandle.java b/core/java/android/os/NativeHandle.java
index f13bf5f..8d341b6 100644
--- a/core/java/android/os/NativeHandle.java
+++ b/core/java/android/os/NativeHandle.java
@@ -99,6 +99,8 @@
* @return a boolean value
*/
public boolean hasSingleFileDescriptor() {
+ checkOpen();
+
return mFds.length == 1 && mInts.length == 0;
}
@@ -108,7 +110,7 @@
* If this method is called, this must also be explicitly closed with
* {@link #close()}.
*/
- public NativeHandle dup() throws java.io.IOException {
+ public @NonNull NativeHandle dup() throws java.io.IOException {
FileDescriptor[] fds = new FileDescriptor[mFds.length];
try {
for (int i = 0; i < mFds.length; i++) {
@@ -123,6 +125,12 @@
return new NativeHandle(fds, mInts, true /*own*/);
}
+ private void checkOpen() {
+ if (mFds == null) {
+ throw new IllegalStateException("NativeHandle is invalidated after close.");
+ }
+ }
+
/**
* Closes the file descriptors if they are owned by this object.
*
@@ -130,19 +138,20 @@
*/
@Override
public void close() throws java.io.IOException {
- if (!mOwn) {
- return;
- }
+ checkOpen();
- try {
- for (FileDescriptor fd : mFds) {
- Os.close(fd);
+ if (mOwn) {
+ try {
+ for (FileDescriptor fd : mFds) {
+ Os.close(fd);
+ }
+ } catch (ErrnoException e) {
+ e.rethrowAsIOException();
}
- } catch (ErrnoException e) {
- e.rethrowAsIOException();
+
+ mOwn = false;
}
- mOwn = false;
mFds = null;
mInts = null;
}
@@ -154,7 +163,9 @@
* @throws IllegalStateException if this object contains either zero or
* more than one file descriptor, or a non-empty data stream.
*/
- public FileDescriptor getFileDescriptor() {
+ public @NonNull FileDescriptor getFileDescriptor() {
+ checkOpen();
+
if (!hasSingleFileDescriptor()) {
throw new IllegalStateException(
"NativeHandle is not single file descriptor. Contents must"
@@ -171,6 +182,8 @@
* @hide
*/
private int[] getFdsAsIntArray() {
+ checkOpen();
+
int numFds = mFds.length;
int[] fds = new int[numFds];
@@ -182,11 +195,13 @@
}
/**
- * Fetch file descriptors.
+ * Fetch file descriptors
*
* @return the fds.
*/
- public FileDescriptor[] getFileDescriptors() {
+ public @NonNull FileDescriptor[] getFileDescriptors() {
+ checkOpen();
+
return mFds;
}
@@ -195,7 +210,9 @@
*
* @return the opaque data stream.
*/
- public int[] getInts() {
+ public @NonNull int[] getInts() {
+ checkOpen();
+
return mInts;
}
}
diff --git a/core/java/android/preference/DialogPreference.java b/core/java/android/preference/DialogPreference.java
index 4b5a7b4..a615f2d 100644
--- a/core/java/android/preference/DialogPreference.java
+++ b/core/java/android/preference/DialogPreference.java
@@ -342,16 +342,31 @@
dialog.show();
}
+ /**
+ * Get the DecorView.
+ * @return the DecorView for the current dialog window, if it exists.
+ * If the window does not exist, null is returned.
+ */
+ private View getDecorView() {
+ if (mDialog != null && mDialog.getWindow() != null) {
+ return mDialog.getWindow().getDecorView();
+ }
+ return null;
+ }
+
void postDismiss() {
removeDismissCallbacks();
- View decorView = mDialog.getWindow().getDecorView();
- decorView.post(mDismissRunnable);
+ View decorView = getDecorView();
+ if (decorView != null) {
+ // If decorView is null, dialog was already dismissed
+ decorView.post(mDismissRunnable);
+ }
}
private void removeDismissCallbacks() {
- if (mDialog != null && mDialog.getWindow() != null
- && mDialog.getWindow().getDecorView() != null) {
- mDialog.getWindow().getDecorView().removeCallbacks(mDismissRunnable);
+ View decorView = getDecorView();
+ if (decorView != null) {
+ decorView.removeCallbacks(mDismissRunnable);
}
}
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index e945c5f..946d386 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -10475,8 +10475,9 @@
/**
* The threshold value for the number of consecutive dns timeout events received to be a
- * signal of data stall. Set the value to 0 or less than 0 to disable. Note that the value
- * should be larger than 0 if the DNS data stall detection is enabled.
+ * signal of data stall. The number of consecutive timeouts needs to be {@code >=} this
+ * threshold to be considered a data stall. Set the value to {@code <= 0} to disable. Note
+ * that the value should be {@code > 0} if the DNS data stall detection is enabled.
*
* @hide
*/
@@ -10507,9 +10508,12 @@
"data_stall_valid_dns_time_threshold";
/**
- * Which data stall detection signal to use. Possible values are a union of the powers of 2
- * of DATA_STALL_EVALUATION_TYPE_*.
+ * Which data stall detection signal to use. This is a bitmask constructed by bitwise-or-ing
+ * (i.e. {@code |}) the DATA_STALL_EVALUATION_TYPE_* values.
*
+ * Type: int
+ * Valid values:
+ * {@link #DATA_STALL_EVALUATION_TYPE_DNS} : Use dns as a signal.
* @hide
*/
@SystemApi
@@ -10517,6 +10521,15 @@
public static final String DATA_STALL_EVALUATION_TYPE = "data_stall_evaluation_type";
/**
+ * Use dns timeout counts to detect data stall.
+ *
+ * @hide
+ */
+ @SystemApi
+ @TestApi
+ public static final int DATA_STALL_EVALUATION_TYPE_DNS = 1;
+
+ /**
* Whether to try cellular data recovery when a bad network is reported.
*
* @hide
diff --git a/core/java/android/security/keystore/recovery/RecoveryController.java b/core/java/android/security/keystore/recovery/RecoveryController.java
index 70054fc..000b8f3 100644
--- a/core/java/android/security/keystore/recovery/RecoveryController.java
+++ b/core/java/android/security/keystore/recovery/RecoveryController.java
@@ -29,6 +29,7 @@
import android.os.ServiceSpecificException;
import android.security.KeyStore;
import android.security.keystore.AndroidKeyStoreProvider;
+import android.security.keystore.KeyPermanentlyInvalidatedException;
import com.android.internal.widget.ILockSettings;
@@ -635,7 +636,7 @@
return getKeyFromGrant(grantAlias);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
- } catch (UnrecoverableKeyException e) {
+ } catch (KeyPermanentlyInvalidatedException | UnrecoverableKeyException e) {
throw new InternalRecoveryServiceException("Failed to get key from keystore", e);
} catch (ServiceSpecificException e) {
if (e.errorCode == ERROR_INSECURE_USER) {
@@ -666,7 +667,7 @@
return getKeyFromGrant(grantAlias);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
- } catch (UnrecoverableKeyException e) {
+ } catch (KeyPermanentlyInvalidatedException | UnrecoverableKeyException e) {
throw new InternalRecoveryServiceException("Failed to get key from keystore", e);
} catch (ServiceSpecificException e) {
if (e.errorCode == ERROR_INSECURE_USER) {
@@ -696,6 +697,8 @@
return getKeyFromGrant(grantAlias);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
+ } catch (KeyPermanentlyInvalidatedException | UnrecoverableKeyException e) {
+ throw new UnrecoverableKeyException("Failed to get key from keystore");
} catch (ServiceSpecificException e) {
throw wrapUnexpectedServiceSpecificException(e);
}
@@ -704,7 +707,8 @@
/**
* Returns the key with the given {@code grantAlias}.
*/
- @NonNull Key getKeyFromGrant(@NonNull String grantAlias) throws UnrecoverableKeyException {
+ @NonNull Key getKeyFromGrant(@NonNull String grantAlias)
+ throws UnrecoverableKeyException, KeyPermanentlyInvalidatedException {
return AndroidKeyStoreProvider.loadAndroidKeyStoreKeyFromKeystore(
mKeyStore,
grantAlias,
diff --git a/core/java/android/security/keystore/recovery/RecoverySession.java b/core/java/android/security/keystore/recovery/RecoverySession.java
index 3bb6421..6622712 100644
--- a/core/java/android/security/keystore/recovery/RecoverySession.java
+++ b/core/java/android/security/keystore/recovery/RecoverySession.java
@@ -22,6 +22,7 @@
import android.annotation.SystemApi;
import android.os.RemoteException;
import android.os.ServiceSpecificException;
+import android.security.keystore.KeyPermanentlyInvalidatedException;
import android.util.ArrayMap;
import android.util.Log;
@@ -218,7 +219,7 @@
Key key;
try {
key = mRecoveryController.getKeyFromGrant(grantAlias);
- } catch (UnrecoverableKeyException e) {
+ } catch (KeyPermanentlyInvalidatedException | UnrecoverableKeyException e) {
throw new InternalRecoveryServiceException(
String.format(
Locale.US,
diff --git a/core/java/android/service/carrier/ApnService.java b/core/java/android/service/carrier/ApnService.java
index d53eb37..57e4b1b 100644
--- a/core/java/android/service/carrier/ApnService.java
+++ b/core/java/android/service/carrier/ApnService.java
@@ -16,6 +16,8 @@
package android.service.carrier;
+import android.annotation.NonNull;
+import android.annotation.Nullable;
import android.annotation.SystemApi;
import android.annotation.WorkerThread;
import android.app.Service;
@@ -60,7 +62,8 @@
};
@Override
- public IBinder onBind(Intent intent) {
+ @NonNull
+ public IBinder onBind(@Nullable Intent intent) {
return mBinder;
}
@@ -73,5 +76,6 @@
* subId.
*/
@WorkerThread
+ @NonNull
public abstract List<ContentValues> onRestoreApns(int subId);
}
diff --git a/core/java/android/service/carrier/CarrierIdentifier.java b/core/java/android/service/carrier/CarrierIdentifier.java
index 568ca0f..8c73a87 100644
--- a/core/java/android/service/carrier/CarrierIdentifier.java
+++ b/core/java/android/service/carrier/CarrierIdentifier.java
@@ -16,6 +16,7 @@
package android.service.carrier;
+import android.annotation.NonNull;
import android.annotation.Nullable;
import android.os.Parcel;
import android.os.Parcelable;
@@ -74,7 +75,7 @@
* @param preciseCarrierId precise carrier identifier
* {@link TelephonyManager#getSimPreciseCarrierId()}
*/
- public CarrierIdentifier(String mcc, String mnc, @Nullable String spn,
+ public CarrierIdentifier(@NonNull String mcc, @NonNull String mnc, @Nullable String spn,
@Nullable String imsi, @Nullable String gid1, @Nullable String gid2,
int carrierid, int preciseCarrierId) {
mMcc = mcc;
diff --git a/core/java/android/service/dreams/IDreamManager.aidl b/core/java/android/service/dreams/IDreamManager.aidl
index be3f3b3..33f3eff 100644
--- a/core/java/android/service/dreams/IDreamManager.aidl
+++ b/core/java/android/service/dreams/IDreamManager.aidl
@@ -23,12 +23,17 @@
/** @hide */
interface IDreamManager {
+ @UnsupportedAppUsage
void dream();
+ @UnsupportedAppUsage
void awaken();
+ @UnsupportedAppUsage
void setDreamComponents(in ComponentName[] componentNames);
+ @UnsupportedAppUsage
ComponentName[] getDreamComponents();
ComponentName getDefaultDreamComponent();
void testDream(in ComponentName componentName);
+ @UnsupportedAppUsage
boolean isDreaming();
void finishSelf(in IBinder token, boolean immediate);
void startDozing(in IBinder token, int screenState, int screenBrightness);
diff --git a/core/java/android/service/euicc/EuiccService.java b/core/java/android/service/euicc/EuiccService.java
index 53cc25b..4f321dc 100644
--- a/core/java/android/service/euicc/EuiccService.java
+++ b/core/java/android/service/euicc/EuiccService.java
@@ -101,10 +101,23 @@
*/
public static final String ACTION_MANAGE_EMBEDDED_SUBSCRIPTIONS =
"android.service.euicc.action.MANAGE_EMBEDDED_SUBSCRIPTIONS";
+
/** @see android.telephony.euicc.EuiccManager#ACTION_PROVISION_EMBEDDED_SUBSCRIPTION */
public static final String ACTION_PROVISION_EMBEDDED_SUBSCRIPTION =
"android.service.euicc.action.PROVISION_EMBEDDED_SUBSCRIPTION";
+ /** @see android.telephony.euicc.EuiccManager#ACTION_TOGGLE_SUBSCRIPTION_PRIVILEGED */
+ public static final String ACTION_TOGGLE_SUBSCRIPTION_PRIVILEGED =
+ "android.service.euicc.action.TOGGLE_SUBSCRIPTION_PRIVILEGED";
+
+ /** @see android.telephony.euicc.EuiccManager#ACTION_DELETE_SUBSCRIPTION_PRIVILEGED */
+ public static final String ACTION_DELETE_SUBSCRIPTION_PRIVILEGED =
+ "android.service.euicc.action.DELETE_SUBSCRIPTION_PRIVILEGED";
+
+ /** @see android.telephony.euicc.EuiccManager#ACTION_RENAME_SUBSCRIPTION_PRIVILEGED */
+ public static final String ACTION_RENAME_SUBSCRIPTION_PRIVILEGED =
+ "android.service.euicc.action.RENAME_SUBSCRIPTION_PRIVILEGED";
+
// LUI resolution actions. These are called by the platform to resolve errors in situations that
// require user interaction.
// TODO(b/33075886): Define extras for any input parameters to these dialogs once they are
diff --git a/core/java/android/service/euicc/IDeleteSubscriptionCallback.aidl b/core/java/android/service/euicc/IDeleteSubscriptionCallback.aidl
index 4667066..aff8f1b 100644
--- a/core/java/android/service/euicc/IDeleteSubscriptionCallback.aidl
+++ b/core/java/android/service/euicc/IDeleteSubscriptionCallback.aidl
@@ -18,5 +18,6 @@
/** @hide */
oneway interface IDeleteSubscriptionCallback {
+ @UnsupportedAppUsage
void onComplete(int result);
}
\ No newline at end of file
diff --git a/core/java/android/service/euicc/IEraseSubscriptionsCallback.aidl b/core/java/android/service/euicc/IEraseSubscriptionsCallback.aidl
index c975f18..34b53cc 100644
--- a/core/java/android/service/euicc/IEraseSubscriptionsCallback.aidl
+++ b/core/java/android/service/euicc/IEraseSubscriptionsCallback.aidl
@@ -18,5 +18,6 @@
/** @hide */
oneway interface IEraseSubscriptionsCallback {
+ @UnsupportedAppUsage
void onComplete(int result);
}
\ No newline at end of file
diff --git a/core/java/android/service/euicc/IGetDefaultDownloadableSubscriptionListCallback.aidl b/core/java/android/service/euicc/IGetDefaultDownloadableSubscriptionListCallback.aidl
index 0c5a0c6..ad69ef1 100644
--- a/core/java/android/service/euicc/IGetDefaultDownloadableSubscriptionListCallback.aidl
+++ b/core/java/android/service/euicc/IGetDefaultDownloadableSubscriptionListCallback.aidl
@@ -20,5 +20,6 @@
/** @hide */
oneway interface IGetDefaultDownloadableSubscriptionListCallback {
+ @UnsupportedAppUsage
void onComplete(in GetDefaultDownloadableSubscriptionListResult result);
}
\ No newline at end of file
diff --git a/core/java/android/service/euicc/IGetDownloadableSubscriptionMetadataCallback.aidl b/core/java/android/service/euicc/IGetDownloadableSubscriptionMetadataCallback.aidl
index 3353061..01f187e 100644
--- a/core/java/android/service/euicc/IGetDownloadableSubscriptionMetadataCallback.aidl
+++ b/core/java/android/service/euicc/IGetDownloadableSubscriptionMetadataCallback.aidl
@@ -20,5 +20,6 @@
/** @hide */
oneway interface IGetDownloadableSubscriptionMetadataCallback {
+ @UnsupportedAppUsage
void onComplete(in GetDownloadableSubscriptionMetadataResult result);
}
\ No newline at end of file
diff --git a/core/java/android/service/euicc/IGetEidCallback.aidl b/core/java/android/service/euicc/IGetEidCallback.aidl
index 35ee9c2..e405a98 100644
--- a/core/java/android/service/euicc/IGetEidCallback.aidl
+++ b/core/java/android/service/euicc/IGetEidCallback.aidl
@@ -18,5 +18,6 @@
/** @hide */
oneway interface IGetEidCallback {
+ @UnsupportedAppUsage
void onSuccess(String eid);
}
\ No newline at end of file
diff --git a/core/java/android/service/euicc/IGetEuiccInfoCallback.aidl b/core/java/android/service/euicc/IGetEuiccInfoCallback.aidl
index 6d28148..c061182 100644
--- a/core/java/android/service/euicc/IGetEuiccInfoCallback.aidl
+++ b/core/java/android/service/euicc/IGetEuiccInfoCallback.aidl
@@ -20,5 +20,6 @@
/** @hide */
oneway interface IGetEuiccInfoCallback {
+ @UnsupportedAppUsage
void onSuccess(in EuiccInfo euiccInfo);
}
\ No newline at end of file
diff --git a/core/java/android/service/euicc/IGetEuiccProfileInfoListCallback.aidl b/core/java/android/service/euicc/IGetEuiccProfileInfoListCallback.aidl
index 761ec1f..0485f7b 100644
--- a/core/java/android/service/euicc/IGetEuiccProfileInfoListCallback.aidl
+++ b/core/java/android/service/euicc/IGetEuiccProfileInfoListCallback.aidl
@@ -20,5 +20,6 @@
/** @hide */
oneway interface IGetEuiccProfileInfoListCallback {
+ @UnsupportedAppUsage
void onComplete(in GetEuiccProfileInfoListResult result);
}
\ No newline at end of file
diff --git a/core/java/android/service/euicc/IRetainSubscriptionsForFactoryResetCallback.aidl b/core/java/android/service/euicc/IRetainSubscriptionsForFactoryResetCallback.aidl
index 1276830..340401f 100644
--- a/core/java/android/service/euicc/IRetainSubscriptionsForFactoryResetCallback.aidl
+++ b/core/java/android/service/euicc/IRetainSubscriptionsForFactoryResetCallback.aidl
@@ -18,5 +18,6 @@
/** @hide */
oneway interface IRetainSubscriptionsForFactoryResetCallback {
+ @UnsupportedAppUsage
void onComplete(int result);
}
\ No newline at end of file
diff --git a/core/java/android/service/euicc/ISwitchToSubscriptionCallback.aidl b/core/java/android/service/euicc/ISwitchToSubscriptionCallback.aidl
index 0f91a6b..b8f984d 100644
--- a/core/java/android/service/euicc/ISwitchToSubscriptionCallback.aidl
+++ b/core/java/android/service/euicc/ISwitchToSubscriptionCallback.aidl
@@ -18,5 +18,6 @@
/** @hide */
oneway interface ISwitchToSubscriptionCallback {
+ @UnsupportedAppUsage
void onComplete(int result);
}
\ No newline at end of file
diff --git a/core/java/android/service/euicc/IUpdateSubscriptionNicknameCallback.aidl b/core/java/android/service/euicc/IUpdateSubscriptionNicknameCallback.aidl
index 6666933..0aa6697 100644
--- a/core/java/android/service/euicc/IUpdateSubscriptionNicknameCallback.aidl
+++ b/core/java/android/service/euicc/IUpdateSubscriptionNicknameCallback.aidl
@@ -18,5 +18,6 @@
/** @hide */
oneway interface IUpdateSubscriptionNicknameCallback {
+ @UnsupportedAppUsage
void onComplete(int result);
}
\ No newline at end of file
diff --git a/core/java/android/service/vr/IVrManager.aidl b/core/java/android/service/vr/IVrManager.aidl
index f7acfc5..ee0c13b 100644
--- a/core/java/android/service/vr/IVrManager.aidl
+++ b/core/java/android/service/vr/IVrManager.aidl
@@ -57,6 +57,7 @@
*
* @return {@code true} if VR mode is enabled.
*/
+ @UnsupportedAppUsage
boolean getVrModeState();
/**
@@ -93,6 +94,7 @@
* @return {@link android.view.Display.INVALID_DISPLAY} if there is no virtual display
* currently, else return the display id of the virtual display
*/
+ @UnsupportedAppUsage
int getVr2dDisplayId();
/**
diff --git a/core/java/android/service/wallpaper/IWallpaperEngine.aidl b/core/java/android/service/wallpaper/IWallpaperEngine.aidl
index dccce40..ffc5454 100644
--- a/core/java/android/service/wallpaper/IWallpaperEngine.aidl
+++ b/core/java/android/service/wallpaper/IWallpaperEngine.aidl
@@ -26,11 +26,15 @@
oneway interface IWallpaperEngine {
void setDesiredSize(int width, int height);
void setDisplayPadding(in Rect padding);
+ @UnsupportedAppUsage
void setVisibility(boolean visible);
void setInAmbientMode(boolean inAmbientDisplay, boolean animated);
+ @UnsupportedAppUsage
void dispatchPointer(in MotionEvent event);
+ @UnsupportedAppUsage
void dispatchWallpaperCommand(String action, int x, int y,
int z, in Bundle extras);
void requestWallpaperColors();
+ @UnsupportedAppUsage
void destroy();
}
diff --git a/core/java/android/speech/IRecognitionListener.aidl b/core/java/android/speech/IRecognitionListener.aidl
index 3d3c44b..e77851b 100644
--- a/core/java/android/speech/IRecognitionListener.aidl
+++ b/core/java/android/speech/IRecognitionListener.aidl
@@ -83,5 +83,6 @@
* @param eventType the type of the occurred event
* @param params a Bundle containing the passed parameters
*/
+ @UnsupportedAppUsage
void onEvent(in int eventType, in Bundle params);
}
diff --git a/core/java/android/util/LocalLog.java b/core/java/android/util/LocalLog.java
index adfa4fc..8b5659b 100644
--- a/core/java/android/util/LocalLog.java
+++ b/core/java/android/util/LocalLog.java
@@ -17,6 +17,7 @@
package android.util;
import android.annotation.UnsupportedAppUsage;
+
import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.time.LocalDateTime;
@@ -55,6 +56,10 @@
@UnsupportedAppUsage
public synchronized void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
+ dump(pw);
+ }
+
+ public synchronized void dump(PrintWriter pw) {
Iterator<String> itr = mLog.iterator();
while (itr.hasNext()) {
pw.println(itr.next());
@@ -62,6 +67,10 @@
}
public synchronized void reverseDump(FileDescriptor fd, PrintWriter pw, String[] args) {
+ reverseDump(pw);
+ }
+
+ public synchronized void reverseDump(PrintWriter pw) {
Iterator<String> itr = mLog.descendingIterator();
while (itr.hasNext()) {
pw.println(itr.next());
@@ -75,10 +84,16 @@
}
@UnsupportedAppUsage
public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
- mLog.dump(fd, pw, args);
+ mLog.dump(pw);
+ }
+ public void dump(PrintWriter pw) {
+ mLog.dump(pw);
}
public void reverseDump(FileDescriptor fd, PrintWriter pw, String[] args) {
- mLog.reverseDump(fd, pw, args);
+ mLog.reverseDump(pw);
+ }
+ public void reverseDump(PrintWriter pw) {
+ mLog.reverseDump(pw);
}
}
diff --git a/core/java/android/util/apk/ApkSignatureVerifier.java b/core/java/android/util/apk/ApkSignatureVerifier.java
index de9f55b..544cc1c 100644
--- a/core/java/android/util/apk/ApkSignatureVerifier.java
+++ b/core/java/android/util/apk/ApkSignatureVerifier.java
@@ -397,15 +397,18 @@
/**
* @return the verity root hash in the Signing Block.
*/
- public static byte[] getVerityRootHash(String apkPath)
- throws IOException, SignatureNotFoundException, SecurityException {
+ public static byte[] getVerityRootHash(String apkPath) throws IOException, SecurityException {
// first try v3
try {
return ApkSignatureSchemeV3Verifier.getVerityRootHash(apkPath);
} catch (SignatureNotFoundException e) {
// try older version
}
- return ApkSignatureSchemeV2Verifier.getVerityRootHash(apkPath);
+ try {
+ return ApkSignatureSchemeV2Verifier.getVerityRootHash(apkPath);
+ } catch (SignatureNotFoundException e) {
+ return null;
+ }
}
/**
diff --git a/core/java/android/view/IRecentsAnimationController.aidl b/core/java/android/view/IRecentsAnimationController.aidl
index 94b9bc0..aa27878 100644
--- a/core/java/android/view/IRecentsAnimationController.aidl
+++ b/core/java/android/view/IRecentsAnimationController.aidl
@@ -41,6 +41,7 @@
* the home activity should be moved to the top. Otherwise, the home activity is hidden and the
* user is returned to the app.
*/
+ @UnsupportedAppUsage
void finish(boolean moveHomeToTop);
/**
@@ -50,6 +51,7 @@
* may register the recents animation input consumer prior to starting the recents animation
* and then enable it mid-animation to start receiving touch events.
*/
+ @UnsupportedAppUsage
void setInputConsumerEnabled(boolean enabled);
/**
@@ -58,6 +60,7 @@
* they can control the SystemUI flags, otherwise the SystemUI flags from home activity will be
* taken.
*/
+ @UnsupportedAppUsage
void setAnimationTargetsBehindSystemBars(boolean behindSystemBars);
/**
diff --git a/core/java/android/view/IRecentsAnimationRunner.aidl b/core/java/android/view/IRecentsAnimationRunner.aidl
index 4cdf664..6e382f4 100644
--- a/core/java/android/view/IRecentsAnimationRunner.aidl
+++ b/core/java/android/view/IRecentsAnimationRunner.aidl
@@ -33,6 +33,7 @@
* wallpaper not drawing in time, or the handler not finishing the animation within a predefined
* amount of time.
*/
+ @UnsupportedAppUsage
void onAnimationCanceled() = 1;
/**
@@ -42,6 +43,7 @@
* @param minimizedHomeBounds Specifies the bounds of the minimized home app, will be
* {@code null} if the device is not currently in split screen
*/
+ @UnsupportedAppUsage
void onAnimationStart(in IRecentsAnimationController controller,
in RemoteAnimationTarget[] apps, in Rect homeContentInsets,
in Rect minimizedHomeBounds) = 2;
diff --git a/core/java/android/view/IRemoteAnimationFinishedCallback.aidl b/core/java/android/view/IRemoteAnimationFinishedCallback.aidl
index ae58b22..a99162b 100644
--- a/core/java/android/view/IRemoteAnimationFinishedCallback.aidl
+++ b/core/java/android/view/IRemoteAnimationFinishedCallback.aidl
@@ -23,5 +23,6 @@
* {@hide}
*/
interface IRemoteAnimationFinishedCallback {
+ @UnsupportedAppUsage
void onAnimationFinished();
}
diff --git a/core/java/android/view/IRemoteAnimationRunner.aidl b/core/java/android/view/IRemoteAnimationRunner.aidl
index 1350ebf..73b023c 100644
--- a/core/java/android/view/IRemoteAnimationRunner.aidl
+++ b/core/java/android/view/IRemoteAnimationRunner.aidl
@@ -33,6 +33,7 @@
* @param apps The list of apps to animate.
* @param finishedCallback The callback to invoke when the animation is finished.
*/
+ @UnsupportedAppUsage
void onAnimationStart(in RemoteAnimationTarget[] apps,
in IRemoteAnimationFinishedCallback finishedCallback);
@@ -40,5 +41,6 @@
* Called when the animation was cancelled. From this point on, any updates onto the leashes
* won't have any effect anymore.
*/
+ @UnsupportedAppUsage
void onAnimationCancelled();
}
diff --git a/core/java/android/view/IWindowManager.aidl b/core/java/android/view/IWindowManager.aidl
index 131fe13..f4b003e 100644
--- a/core/java/android/view/IWindowManager.aidl
+++ b/core/java/android/view/IWindowManager.aidl
@@ -75,10 +75,13 @@
in IInputContext inputContext);
boolean inputMethodClientHasFocus(IInputMethodClient client);
+ @UnsupportedAppUsage
void getInitialDisplaySize(int displayId, out Point size);
+ @UnsupportedAppUsage
void getBaseDisplaySize(int displayId, out Point size);
void setForcedDisplaySize(int displayId, int width, int height);
void clearForcedDisplaySize(int displayId);
+ @UnsupportedAppUsage
int getInitialDisplayDensity(int displayId);
int getBaseDisplayDensity(int displayId);
void setForcedDisplayDensityForUser(int displayId, int density, int userId);
@@ -93,6 +96,7 @@
void removeWindowToken(IBinder token, int displayId);
void setFocusedApp(IBinder token, boolean moveFocusNow);
void prepareAppTransition(int transit, boolean alwaysKeepCurrent);
+ @UnsupportedAppUsage
int getPendingAppTransition();
void overridePendingAppTransition(String packageName, int enterAnim, int exitAnim,
IRemoteCallback startedCallback);
@@ -122,16 +126,20 @@
* used for recents, where generating the thumbnails of the specs takes a non-trivial amount of
* time, so we want to move that off the critical path for starting the new activity.
*/
+ @UnsupportedAppUsage
void overridePendingAppTransitionMultiThumbFuture(
IAppTransitionAnimationSpecsFuture specsFuture, IRemoteCallback startedCallback,
boolean scaleUp);
+ @UnsupportedAppUsage
void overridePendingAppTransitionRemote(in RemoteAnimationAdapter remoteAnimationAdapter);
+ @UnsupportedAppUsage
void executeAppTransition();
/**
* Used by system ui to report that recents has shown itself.
* @deprecated to be removed once prebuilts are updated
*/
+ @UnsupportedAppUsage
void endProlongedAnimations();
// Re-evaluate the current orientation from the caller's state.
@@ -150,7 +158,9 @@
void disableKeyguard(IBinder token, String tag);
void reenableKeyguard(IBinder token);
void exitKeyguardSecurely(IOnKeyguardExitResult callback);
+ @UnsupportedAppUsage
boolean isKeyguardLocked();
+ @UnsupportedAppUsage
boolean isKeyguardSecure();
void dismissKeyguard(IKeyguardDismissCallback callback, CharSequence message);
@@ -160,9 +170,12 @@
void closeSystemDialogs(String reason);
// These can only be called with the SET_ANIMATON_SCALE permission.
+ @UnsupportedAppUsage
float getAnimationScale(int which);
float[] getAnimationScales();
+ @UnsupportedAppUsage
void setAnimationScale(int which, float scale);
+ @UnsupportedAppUsage
void setAnimationScales(in float[] scales);
float getCurrentAnimatorScale();
@@ -181,6 +194,7 @@
// should be enabled. The 'enabled' value is null or blank for
// the system default (differs per build variant) or any valid
// boolean string as parsed by SystemProperties.getBoolean().
+ @UnsupportedAppUsage
void setStrictModeVisualIndicatorPreference(String enabled);
/**
@@ -219,6 +233,7 @@
* Remove a rotation watcher set using watchRotation.
* @hide
*/
+ @UnsupportedAppUsage
void removeRotationWatcher(IRotationWatcher watcher);
/**
@@ -234,12 +249,14 @@
* thawRotation() is called.
* @hide
*/
+ @UnsupportedAppUsage
void freezeRotation(int rotation);
/**
* Release the orientation lock imposed by freezeRotation().
* @hide
*/
+ @UnsupportedAppUsage
void thawRotation();
/**
@@ -290,16 +307,19 @@
/**
* Called by System UI to notify of changes to the visibility and height of the shelf.
*/
+ @UnsupportedAppUsage
void setShelfHeight(boolean visible, int shelfHeight);
/**
* Called by System UI to enable or disable haptic feedback on the navigation bar buttons.
*/
+ @UnsupportedAppUsage
void setNavBarVirtualKeyHapticFeedbackEnabled(boolean enabled);
/**
* Device has a software navigation bar (separate from the status bar).
*/
+ @UnsupportedAppUsage
boolean hasNavigationBar();
/**
@@ -310,11 +330,13 @@
/**
* Lock the device immediately with the specified options (can be null).
*/
+ @UnsupportedAppUsage
void lockNow(in Bundle options);
/**
* Device is in safe mode.
*/
+ @UnsupportedAppUsage
boolean isSafeModeEnabled();
/**
@@ -342,6 +364,7 @@
* @return the dock side the current docked stack is at; must be one of the
* WindowManagerGlobal.DOCKED_* values
*/
+ @UnsupportedAppUsage
int getDockedStackSide();
/**
@@ -354,6 +377,7 @@
* Registers a listener that will be called when the dock divider changes its visibility or when
* the docked stack gets added/removed.
*/
+ @UnsupportedAppUsage
void registerDockedStackListener(IDockedStackListener listener);
/**
@@ -380,6 +404,7 @@
/**
* Retrieves the current stable insets from the primary display.
*/
+ @UnsupportedAppUsage
void getStableInsets(int displayId, out Rect outInsets);
/**
@@ -398,6 +423,7 @@
* Destroy an input consumer by name. This method will also dispose the input channels
* associated with that InputConsumer.
*/
+ @UnsupportedAppUsage
boolean destroyInputConsumer(String name);
/**
diff --git a/core/java/android/view/IWindowSession.aidl b/core/java/android/view/IWindowSession.aidl
index f868a00..d6d5d81 100644
--- a/core/java/android/view/IWindowSession.aidl
+++ b/core/java/android/view/IWindowSession.aidl
@@ -49,6 +49,7 @@
int addToDisplayWithoutInputChannel(IWindow window, int seq, in WindowManager.LayoutParams attrs,
in int viewVisibility, in int layerStackId, out Rect outContentInsets,
out Rect outStableInsets);
+ @UnsupportedAppUsage
void remove(IWindow window);
/**
@@ -123,6 +124,7 @@
* completely transparent, allowing it to work with the surface flinger
* to optimize compositing of this part of the window.
*/
+ @UnsupportedAppUsage
void setTransparentRegion(IWindow window, in Region region);
/**
@@ -144,11 +146,15 @@
*/
void getDisplayFrame(IWindow window, out Rect outDisplayFrame);
+ @UnsupportedAppUsage
void finishDrawing(IWindow window);
+ @UnsupportedAppUsage
void setInTouchMode(boolean showFocus);
+ @UnsupportedAppUsage
boolean getInTouchMode();
+ @UnsupportedAppUsage
boolean performHapticFeedback(IWindow window, int effectId, boolean always);
/**
@@ -167,6 +173,7 @@
* @param data Data transferred by drag and drop
* @return Token of drag operation which will be passed to cancelDragAndDrop.
*/
+ @UnsupportedAppUsage
IBinder performDrag(IWindow window, int flags, in SurfaceControl surface, int touchSource,
float touchX, float touchY, float thumbCenterX, float thumbCenterY, in ClipData data);
diff --git a/core/java/android/view/RenderNodeAnimator.java b/core/java/android/view/RenderNodeAnimator.java
index e48bcfd..a52dec2 100644
--- a/core/java/android/view/RenderNodeAnimator.java
+++ b/core/java/android/view/RenderNodeAnimator.java
@@ -322,6 +322,7 @@
return mUnscaledStartDelay;
}
+ @UnsupportedAppUsage
@Override
public RenderNodeAnimator setDuration(long duration) {
checkMutable();
diff --git a/core/java/android/webkit/IWebViewUpdateService.aidl b/core/java/android/webkit/IWebViewUpdateService.aidl
index dbca7ff..9a549e4 100644
--- a/core/java/android/webkit/IWebViewUpdateService.aidl
+++ b/core/java/android/webkit/IWebViewUpdateService.aidl
@@ -61,6 +61,7 @@
/**
* Used by DevelopmentSetting to get the name of the WebView provider currently in use.
*/
+ @UnsupportedAppUsage
String getCurrentWebViewPackageName();
/**
@@ -72,6 +73,7 @@
* Used by Settings to determine whether a certain package can be enabled/disabled by the user -
* the package should not be modifiable in this way if it is a fallback package.
*/
+ @UnsupportedAppUsage
boolean isFallbackPackage(String packageName);
/**
diff --git a/core/java/android/widget/AbsListView.java b/core/java/android/widget/AbsListView.java
index 0f56aba..a18c385 100644
--- a/core/java/android/widget/AbsListView.java
+++ b/core/java/android/widget/AbsListView.java
@@ -7700,6 +7700,11 @@
mLastSeenPos = firstPos;
final int childCount = getChildCount();
+
+ if (childCount <= 0) {
+ return;
+ }
+
final int position = mTargetPos;
final int lastPos = firstPos + childCount - 1;
diff --git a/core/java/com/android/internal/app/IAppOpsService.aidl b/core/java/com/android/internal/app/IAppOpsService.aidl
index 768dddd..4e0e290 100644
--- a/core/java/com/android/internal/app/IAppOpsService.aidl
+++ b/core/java/com/android/internal/app/IAppOpsService.aidl
@@ -28,6 +28,7 @@
int noteOperation(int code, int uid, String packageName);
int startOperation(IBinder token, int code, int uid, String packageName,
boolean startIfModeDefault);
+ @UnsupportedAppUsage
void finishOperation(IBinder token, int code, int uid, String packageName);
void startWatchingMode(int op, String packageName, IAppOpsCallback callback);
void stopWatchingMode(IAppOpsCallback callback);
@@ -38,11 +39,15 @@
// Remaining methods are only used in Java.
int checkPackage(int uid, String packageName);
+ @UnsupportedAppUsage
List<AppOpsManager.PackageOps> getPackagesForOps(in int[] ops);
+ @UnsupportedAppUsage
List<AppOpsManager.PackageOps> getOpsForPackage(int uid, String packageName, in int[] ops);
List<AppOpsManager.PackageOps> getUidOps(int uid, in int[] ops);
void setUidMode(int code, int uid, int mode);
+ @UnsupportedAppUsage
void setMode(int code, int uid, String packageName, int mode);
+ @UnsupportedAppUsage
void resetAllModes(int reqUserId, String reqPackageName);
int checkAudioOperation(int code, int usage, int uid, String packageName);
void setAudioRestriction(int code, int usage, int uid, int mode, in String[] exceptionPackages);
diff --git a/core/java/com/android/internal/app/IBatteryStats.aidl b/core/java/com/android/internal/app/IBatteryStats.aidl
index 514ff76..9267155 100644
--- a/core/java/com/android/internal/app/IBatteryStats.aidl
+++ b/core/java/com/android/internal/app/IBatteryStats.aidl
@@ -49,11 +49,13 @@
void noteResetFlashlight();
// Remaining methods are only used in Java.
+ @UnsupportedAppUsage
byte[] getStatistics();
ParcelFileDescriptor getStatisticsStream();
// Return true if we see the battery as currently charging.
+ @UnsupportedAppUsage
boolean isCharging();
// Return the computed amount of time remaining on battery, in milliseconds.
@@ -62,6 +64,7 @@
// Return the computed amount of time remaining to fully charge, in milliseconds.
// Returns -1 if nothing could be computed.
+ @UnsupportedAppUsage
long computeChargeTimeRemaining();
void noteEvent(int code, String name, int uid);
@@ -131,6 +134,7 @@
void noteDeviceIdleMode(int mode, String activeReason, int activeUid);
void setBatteryState(int status, int health, int plugType, int level, int temp, int volt,
int chargeUAh, int chargeFullUAh);
+ @UnsupportedAppUsage
long getAwakeTimeBattery();
long getAwakeTimePlugged();
diff --git a/core/java/com/android/internal/app/IVoiceInteractionManagerService.aidl b/core/java/com/android/internal/app/IVoiceInteractionManagerService.aidl
index ff75a8b..95971c0 100644
--- a/core/java/com/android/internal/app/IVoiceInteractionManagerService.aidl
+++ b/core/java/com/android/internal/app/IVoiceInteractionManagerService.aidl
@@ -50,6 +50,7 @@
* @param keyphraseId The unique identifier for the keyphrase.
* @param bcp47Locale The BCP47 language tag for the keyphrase's locale.
*/
+ @UnsupportedAppUsage
SoundTrigger.KeyphraseSoundModel getKeyphraseSoundModel(int keyphraseId, in String bcp47Locale);
/**
* Add/Update the given keyphrase sound model.
diff --git a/core/java/com/android/internal/appwidget/IAppWidgetService.aidl b/core/java/com/android/internal/appwidget/IAppWidgetService.aidl
index f9bf373..6d1d1ab 100644
--- a/core/java/com/android/internal/appwidget/IAppWidgetService.aidl
+++ b/core/java/com/android/internal/appwidget/IAppWidgetService.aidl
@@ -42,6 +42,7 @@
void deleteAppWidgetId(String callingPackage, int appWidgetId);
void deleteHost(String packageName, int hostId);
void deleteAllHosts();
+ @UnsupportedAppUsage
RemoteViews getAppWidgetViews(String callingPackage, int appWidgetId);
int[] getAppWidgetIdsForHost(String callingPackage, int hostId);
IntentSender createAppWidgetConfigIntentSender(String callingPackage, int appWidgetId,
@@ -63,11 +64,14 @@
AppWidgetProviderInfo getAppWidgetInfo(String callingPackage, int appWidgetId);
boolean hasBindAppWidgetPermission(in String packageName, int userId);
void setBindAppWidgetPermission(in String packageName, int userId, in boolean permission);
+ @UnsupportedAppUsage
boolean bindAppWidgetId(in String callingPackage, int appWidgetId,
int providerProfileId, in ComponentName providerComponent, in Bundle options);
+ @UnsupportedAppUsage
boolean bindRemoteViewsService(String callingPackage, int appWidgetId, in Intent intent,
IApplicationThread caller, IBinder token, IServiceConnection connection, int flags);
+ @UnsupportedAppUsage
int[] getAppWidgetIds(in ComponentName providerComponent);
boolean isBoundWidgetPackage(String packageName, int userId);
boolean requestPinAppWidget(String packageName, in ComponentName providerComponent,
diff --git a/core/java/com/android/internal/net/VpnProfile.java b/core/java/com/android/internal/net/VpnProfile.java
index ec02432..940cc36 100644
--- a/core/java/com/android/internal/net/VpnProfile.java
+++ b/core/java/com/android/internal/net/VpnProfile.java
@@ -18,6 +18,8 @@
import android.annotation.UnsupportedAppUsage;
import android.os.Build;
+import android.net.ProxyInfo;
+import android.net.Uri;
import android.os.Parcel;
import android.os.Parcelable;
import android.text.TextUtils;
@@ -46,6 +48,10 @@
public static final int TYPE_IPSEC_HYBRID_RSA = 5;
public static final int TYPE_MAX = 5;
+ // Match these constants with R.array.vpn_proxy_settings.
+ public static final int PROXY_NONE = 0;
+ public static final int PROXY_MANUAL = 1;
+
// Entity fields.
@UnsupportedAppUsage
public final String key; // -1
@@ -68,6 +74,7 @@
public String ipsecUserCert = ""; // 12
public String ipsecCaCert = ""; // 13
public String ipsecServerCert = "";// 14
+ public ProxyInfo proxy = null; // 15~18
// Helper fields.
@UnsupportedAppUsage
@@ -96,6 +103,7 @@
ipsecCaCert = in.readString();
ipsecServerCert = in.readString();
saveLogin = in.readInt() != 0;
+ proxy = in.readParcelable(null);
}
@Override
@@ -117,6 +125,7 @@
out.writeString(ipsecCaCert);
out.writeString(ipsecServerCert);
out.writeInt(saveLogin ? 1 : 0);
+ out.writeParcelable(proxy, flags);
}
@UnsupportedAppUsage
@@ -127,8 +136,8 @@
}
String[] values = new String(value, StandardCharsets.UTF_8).split("\0", -1);
- // There can be 14 or 15 values in ICS MR1.
- if (values.length < 14 || values.length > 15) {
+ // There can be 14 - 19 Bytes in values.length.
+ if (values.length < 14 || values.length > 19) {
return null;
}
@@ -151,7 +160,18 @@
profile.ipsecUserCert = values[12];
profile.ipsecCaCert = values[13];
profile.ipsecServerCert = (values.length > 14) ? values[14] : "";
-
+ if (values.length > 15) {
+ String host = (values.length > 15) ? values[15] : "";
+ String port = (values.length > 16) ? values[16] : "";
+ String exclList = (values.length > 17) ? values[17] : "";
+ String pacFileUrl = (values.length > 18) ? values[18] : "";
+ if (pacFileUrl.isEmpty()) {
+ profile.proxy = new ProxyInfo(host, port.isEmpty() ?
+ 0 : Integer.parseInt(port), exclList);
+ } else {
+ profile.proxy = new ProxyInfo(pacFileUrl);
+ }
+ } // else profle.proxy = null
profile.saveLogin = !profile.username.isEmpty() || !profile.password.isEmpty();
return profile;
} catch (Exception e) {
@@ -176,6 +196,13 @@
builder.append('\0').append(ipsecUserCert);
builder.append('\0').append(ipsecCaCert);
builder.append('\0').append(ipsecServerCert);
+ if (proxy != null) {
+ builder.append('\0').append(proxy.getHost() != null ? proxy.getHost() : "");
+ builder.append('\0').append(proxy.getPort());
+ builder.append('\0').append(proxy.getExclusionListAsString() != null ?
+ proxy.getExclusionListAsString() : "");
+ builder.append('\0').append(proxy.getPacFileUrl().toString());
+ }
return builder.toString().getBytes(StandardCharsets.UTF_8);
}
diff --git a/core/java/com/android/internal/os/IDropBoxManagerService.aidl b/core/java/com/android/internal/os/IDropBoxManagerService.aidl
index d16579c..aaa548e 100644
--- a/core/java/com/android/internal/os/IDropBoxManagerService.aidl
+++ b/core/java/com/android/internal/os/IDropBoxManagerService.aidl
@@ -37,5 +37,6 @@
boolean isTagEnabled(String tag);
/** @see DropBoxManager#getNextEntry */
+ @UnsupportedAppUsage
DropBoxManager.Entry getNextEntry(String tag, long millis);
}
diff --git a/core/java/com/android/internal/policy/IKeyguardService.aidl b/core/java/com/android/internal/policy/IKeyguardService.aidl
index e5d5685..54f31f9 100644
--- a/core/java/com/android/internal/policy/IKeyguardService.aidl
+++ b/core/java/com/android/internal/policy/IKeyguardService.aidl
@@ -88,8 +88,10 @@
*/
void onScreenTurnedOff();
+ @UnsupportedAppUsage
void setKeyguardEnabled(boolean enabled);
void onSystemReady();
+ @UnsupportedAppUsage
void doKeyguardTimeout(in Bundle options);
void setSwitchingUser(boolean switching);
void setCurrentUser(int userId);
diff --git a/core/java/com/android/internal/statusbar/IStatusBarService.aidl b/core/java/com/android/internal/statusbar/IStatusBarService.aidl
index 159d49b..4ad81cb 100644
--- a/core/java/com/android/internal/statusbar/IStatusBarService.aidl
+++ b/core/java/com/android/internal/statusbar/IStatusBarService.aidl
@@ -30,15 +30,20 @@
/** @hide */
interface IStatusBarService
{
+ @UnsupportedAppUsage
void expandNotificationsPanel();
+ @UnsupportedAppUsage
void collapsePanels();
void togglePanel();
+ @UnsupportedAppUsage
void disable(int what, IBinder token, String pkg);
void disableForUser(int what, IBinder token, String pkg, int userId);
void disable2(int what, IBinder token, String pkg);
void disable2ForUser(int what, IBinder token, String pkg, int userId);
void setIcon(String slot, String iconPackage, int iconId, int iconLevel, String contentDescription);
+ @UnsupportedAppUsage
void setIconVisibility(String slot, boolean visible);
+ @UnsupportedAppUsage
void removeIcon(String slot);
void setImeWindowStatus(in IBinder token, int vis, int backDisposition,
boolean showImeSwitcher);
@@ -82,6 +87,7 @@
void addTile(in ComponentName tile);
void remTile(in ComponentName tile);
void clickTile(in ComponentName tile);
+ @UnsupportedAppUsage
void handleSystemKey(in int key);
/**
diff --git a/core/java/com/android/internal/widget/ILockSettings.aidl b/core/java/com/android/internal/widget/ILockSettings.aidl
index 591f15f..62b8c27 100644
--- a/core/java/com/android/internal/widget/ILockSettings.aidl
+++ b/core/java/com/android/internal/widget/ILockSettings.aidl
@@ -30,11 +30,17 @@
/** {@hide} */
interface ILockSettings {
+ @UnsupportedAppUsage
void setBoolean(in String key, in boolean value, in int userId);
+ @UnsupportedAppUsage
void setLong(in String key, in long value, in int userId);
+ @UnsupportedAppUsage
void setString(in String key, in String value, in int userId);
+ @UnsupportedAppUsage
boolean getBoolean(in String key, in boolean defaultValue, in int userId);
+ @UnsupportedAppUsage
long getLong(in String key, in long defaultValue, in int userId);
+ @UnsupportedAppUsage
String getString(in String key, in String defaultValue, in int userId);
void setLockCredential(in String credential, int type, in String savedCredential, int requestedQuality, int userId);
void resetKeyStore(int userId);
@@ -43,7 +49,9 @@
VerifyCredentialResponse verifyCredential(in String credential, int type, long challenge, int userId);
VerifyCredentialResponse verifyTiedProfileChallenge(String credential, int type, long challenge, int userId);
boolean checkVoldPassword(int userId);
+ @UnsupportedAppUsage
boolean havePattern(int userId);
+ @UnsupportedAppUsage
boolean havePassword(int userId);
byte[] getHashFactor(String currentCredential, int userId);
void setSeparateProfileChallengeEnabled(int userId, boolean enabled, String managedUserPassword);
diff --git a/core/java/com/android/internal/widget/IRemoteViewsFactory.aidl b/core/java/com/android/internal/widget/IRemoteViewsFactory.aidl
index 7317ecf..d6efca5 100644
--- a/core/java/com/android/internal/widget/IRemoteViewsFactory.aidl
+++ b/core/java/com/android/internal/widget/IRemoteViewsFactory.aidl
@@ -21,15 +21,23 @@
/** {@hide} */
interface IRemoteViewsFactory {
+ @UnsupportedAppUsage
void onDataSetChanged();
oneway void onDataSetChangedAsync();
oneway void onDestroy(in Intent intent);
+ @UnsupportedAppUsage
int getCount();
+ @UnsupportedAppUsage
RemoteViews getViewAt(int position);
+ @UnsupportedAppUsage
RemoteViews getLoadingView();
+ @UnsupportedAppUsage
int getViewTypeCount();
+ @UnsupportedAppUsage
long getItemId(int position);
+ @UnsupportedAppUsage
boolean hasStableIds();
+ @UnsupportedAppUsage
boolean isCreated();
}
diff --git a/core/java/com/android/server/net/OWNERS b/core/java/com/android/server/net/OWNERS
index 7311eee..d3836d4 100644
--- a/core/java/com/android/server/net/OWNERS
+++ b/core/java/com/android/server/net/OWNERS
@@ -1,8 +1,8 @@
set noparent
codewiz@google.com
-ek@google.com
jchalard@google.com
+junyulai@google.com
lorenzo@google.com
reminv@google.com
satk@google.com
diff --git a/core/jni/android_view_Surface.cpp b/core/jni/android_view_Surface.cpp
index f70cf07..6302aa7 100644
--- a/core/jni/android_view_Surface.cpp
+++ b/core/jni/android_view_Surface.cpp
@@ -127,113 +127,17 @@
}
int android_view_Surface_mapPublicFormatToHalFormat(PublicFormat f) {
-
- switch(f) {
- case PublicFormat::JPEG:
- case PublicFormat::DEPTH_POINT_CLOUD:
- return HAL_PIXEL_FORMAT_BLOB;
- case PublicFormat::DEPTH16:
- return HAL_PIXEL_FORMAT_Y16;
- case PublicFormat::RAW_SENSOR:
- case PublicFormat::RAW_DEPTH:
- return HAL_PIXEL_FORMAT_RAW16;
- default:
- // Most formats map 1:1
- return static_cast<int>(f);
- }
+ return mapPublicFormatToHalFormat(f);
}
android_dataspace android_view_Surface_mapPublicFormatToHalDataspace(
PublicFormat f) {
- switch(f) {
- case PublicFormat::JPEG:
- return HAL_DATASPACE_V0_JFIF;
- case PublicFormat::DEPTH_POINT_CLOUD:
- case PublicFormat::DEPTH16:
- case PublicFormat::RAW_DEPTH:
- return HAL_DATASPACE_DEPTH;
- case PublicFormat::RAW_SENSOR:
- case PublicFormat::RAW_PRIVATE:
- case PublicFormat::RAW10:
- case PublicFormat::RAW12:
- return HAL_DATASPACE_ARBITRARY;
- case PublicFormat::YUV_420_888:
- case PublicFormat::NV21:
- case PublicFormat::YV12:
- return HAL_DATASPACE_V0_JFIF;
- default:
- // Most formats map to UNKNOWN
- return HAL_DATASPACE_UNKNOWN;
- }
+ return mapPublicFormatToHalDataspace(f);
}
PublicFormat android_view_Surface_mapHalFormatDataspaceToPublicFormat(
int format, android_dataspace dataSpace) {
- switch(format) {
- case HAL_PIXEL_FORMAT_RGBA_8888:
- case HAL_PIXEL_FORMAT_RGBX_8888:
- case HAL_PIXEL_FORMAT_RGBA_FP16:
- case HAL_PIXEL_FORMAT_RGBA_1010102:
- case HAL_PIXEL_FORMAT_RGB_888:
- case HAL_PIXEL_FORMAT_RGB_565:
- case HAL_PIXEL_FORMAT_Y8:
- case HAL_PIXEL_FORMAT_RAW10:
- case HAL_PIXEL_FORMAT_RAW12:
- case HAL_PIXEL_FORMAT_YCbCr_420_888:
- case HAL_PIXEL_FORMAT_YV12:
- // Enums overlap in both name and value
- return static_cast<PublicFormat>(format);
- case HAL_PIXEL_FORMAT_RAW16:
- switch (dataSpace) {
- case HAL_DATASPACE_DEPTH:
- return PublicFormat::RAW_DEPTH;
- default:
- return PublicFormat::RAW_SENSOR;
- }
- case HAL_PIXEL_FORMAT_RAW_OPAQUE:
- // Name differs, though value is the same
- return PublicFormat::RAW_PRIVATE;
- case HAL_PIXEL_FORMAT_YCbCr_422_SP:
- // Name differs, though the value is the same
- return PublicFormat::NV16;
- case HAL_PIXEL_FORMAT_YCrCb_420_SP:
- // Name differs, though the value is the same
- return PublicFormat::NV21;
- case HAL_PIXEL_FORMAT_YCbCr_422_I:
- // Name differs, though the value is the same
- return PublicFormat::YUY2;
- case HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED:
- // Name differs, though the value is the same
- return PublicFormat::PRIVATE;
- case HAL_PIXEL_FORMAT_Y16:
- // Dataspace-dependent
- switch (dataSpace) {
- case HAL_DATASPACE_DEPTH:
- return PublicFormat::DEPTH16;
- default:
- // Assume non-depth Y16 is just Y16.
- return PublicFormat::Y16;
- }
- break;
- case HAL_PIXEL_FORMAT_BLOB:
- // Dataspace-dependent
- switch (dataSpace) {
- case HAL_DATASPACE_DEPTH:
- return PublicFormat::DEPTH_POINT_CLOUD;
- case HAL_DATASPACE_V0_JFIF:
- return PublicFormat::JPEG;
- default:
- // Assume otherwise-marked blobs are also JPEG
- return PublicFormat::JPEG;
- }
- break;
- case HAL_PIXEL_FORMAT_BGRA_8888:
- // Not defined in public API
- return PublicFormat::UNKNOWN;
-
- default:
- return PublicFormat::UNKNOWN;
- }
+ return mapHalFormatDataspaceToPublicFormat(format, dataSpace);
}
// ----------------------------------------------------------------------------
diff --git a/core/jni/include/android_runtime/android_view_Surface.h b/core/jni/include/android_runtime/android_view_Surface.h
index 36487b3..04718cd 100644
--- a/core/jni/include/android_runtime/android_view_Surface.h
+++ b/core/jni/include/android_runtime/android_view_Surface.h
@@ -19,6 +19,7 @@
#include <android/native_window.h>
#include <system/graphics.h>
+#include <ui/PublicFormat.h>
#include "jni.h"
@@ -27,39 +28,6 @@
class Surface;
class IGraphicBufferProducer;
-/**
- * Enum mirroring the public API definitions for image and pixel formats.
- * Some of these are hidden in the public API
- *
- * Keep up to date with android.graphics.ImageFormat and
- * android.graphics.PixelFormat
- */
-enum class PublicFormat {
- UNKNOWN = 0x0,
- RGBA_8888 = 0x1,
- RGBX_8888 = 0x2,
- RGB_888 = 0x3,
- RGB_565 = 0x4,
- NV16 = 0x10,
- NV21 = 0x11,
- YUY2 = 0x14,
- RGBA_FP16 = 0x16,
- RAW_SENSOR = 0x20,
- PRIVATE = 0x22,
- YUV_420_888 = 0x23,
- RAW_PRIVATE = 0x24,
- RAW10 = 0x25,
- RAW12 = 0x26,
- RGBA_1010102 = 0x2b,
- JPEG = 0x100,
- DEPTH_POINT_CLOUD = 0x101,
- RAW_DEPTH = 0x1002, // @hide
- YV12 = 0x32315659,
- Y8 = 0x20203859, // @hide
- Y16 = 0x20363159, // @hide
- DEPTH16 = 0x44363159
-};
-
/* Gets the underlying ANativeWindow for a Surface. */
extern sp<ANativeWindow> android_view_Surface_getNativeWindow(
JNIEnv* env, jobject surfaceObj);
diff --git a/core/jni/runtime_native_boot-flags-test.sh b/core/jni/runtime_native_boot-flags-test.sh
index 01f37f0..cdfeffc 100755
--- a/core/jni/runtime_native_boot-flags-test.sh
+++ b/core/jni/runtime_native_boot-flags-test.sh
@@ -139,47 +139,73 @@
adb logcat -d -s "$zygote" | grep -q -e "option\[[0-9]\+\]=$runtime_option"
}
-# check_zygote_gc_runtime_option CONTEXT VALUE
-# --------------------------------------------
-# Check that all zygote processes are passed device configuration flag VALUE as
-# GC runtime option. Use CONTEXT in logging.
-function check_zygote_gc_runtime_option {
+# check_zygote_runtime_option CONTEXT RUNTIME_OPTION
+# --------------------------------------------------
+# Check that all zygote processes are passed RUNTIME_OPTION as runtime option. Use
+# CONTEXT in logging.
+function check_zygote_runtime_option {
local context=$1
- local value=$2
+ local runtime_option=$2
say \
- "[$context] Check that all zygote processes are passed the flag value as a GC runtime option..."
- local runtime_option="-Xgc:$value"
+ "[$context] Check that all zygote processes are passed \`$runtime_option\` as runtime option..."
for zygote in $zygotes; do
- find_zygote_runtime_option "$zygote" "$runtime_option"\
+ find_zygote_runtime_option "$zygote" "$runtime_option" \
|| fail "Found no \`$runtime_option\` among runtime options passed to \`$zygote\`"
done
}
-# check_no_zygote_gc_runtime_option CONTEXT VALUE
-# -----------------------------------------------
-# Check that no zygote process is passed device configuration flag VALUE as GC
-# runtime option. Use CONTEXT in logging.
-function check_no_zygote_gc_runtime_option {
+# check_no_zygote_runtime_option CONTEXT RUNTIME_OPTION
+# -----------------------------------------------------
+# Check that no zygote process is passed RUNTIME_OPTION as runtime option. Use
+# CONTEXT in logging.
+function check_no_zygote_runtime_option {
local context=$1
- local value=$2
+ local runtime_option=$2
- say "[$context] Check no zygote process is passed the flag value as a GC runtime option..."
- local runtime_option="-Xgc:$value"
+ say "[$context] Check that no zygote process is passed \`$runtime_option\` as runtime option..."
for zygote in $zygotes; do
- find_zygote_runtime_option "$zygote" "$runtime_option"\
+ find_zygote_runtime_option "$zygote" "$runtime_option" \
&& fail "Found \`$runtime_option\` among runtime options passed to \`$zygote\`"
done
}
-# test_android_runtime_flag FLAG VALUE GC_RUNTIME_OPTION
-# ------------------------------------------------------
-# Test device configuration FLAG with VALUE. Check that GC_RUNTIME_OPTION is
-# passed as GC Runtime option by the zygote.
+# check_android_runtime_message CONTEXT MESSAGE
+# ---------------------------------------------
+# Return whether AndroidRuntime generated MESSAGE in logcat. Use CONTEXT in
+# logging.
+function check_android_runtime_message {
+ local context=$1
+ local message=$2
+
+ say "[$context] Check that AndroidRuntime generated expected message in logcat..."
+ adb logcat -d -s AndroidRuntime | grep -F -q "$message" \
+ || fail "Found no message \"$message\" generated by AndroidRuntime"
+}
+
+# check_no_android_runtime_message CONTEXT MESSAGE
+# ------------------------------------------------
+# Return whether AndroidRuntime did not generate MESSAGE in logcat. Use CONTEXT
+# in logging.
+function check_no_android_runtime_message {
+ local context=$1
+ local message=$2
+
+ say "[$context] Check that AndroidRuntime did not generate unexpected message in logcat..."
+ adb logcat -d -s AndroidRuntime | grep -F -q -v "$message" \
+ || fail "Found message \"$message\" generated by AndroidRuntime"
+}
+
+# test_android_runtime_flag FLAG VALUE CHECK_EFFECT CHECK_NO_EFFECT
+# -----------------------------------------------------------------
+# Test device configuration FLAG with VALUE. CHECK_EFFECT and CHECK_NO_EFFECT
+# are functions that are passed a context as sole argument and that respectively
+# check the effect or the absence of effect of the flag.
function test_android_runtime_flag {
local flag=$1
local value=$2
- local gc_runtime_option=$3
+ local check_effect=$3
+ local check_no_effect=$4
# Persistent system property (set after a reboot) associated with the device
# configuration flag.
@@ -193,26 +219,26 @@
sleep 3
# Check that both the device configuration flag and the associated system
- # property are set, but that the zygote hasn't had the flag passed to it as a
- # GC runtime option (as we haven't rebooted yet).
+ # property are set, but that flag has not produced an effect on the system (as
+ # we haven't rebooted yet).
local context="Flag set, before reboot"
check_device_config_flag "$context" "$flag" "$value"
check_system_property "$context" "$prop" "$value"
- check_no_zygote_gc_runtime_option "$context" "$gc_runtime_option"
+ $check_no_effect "$context"
# Reboot device for the flag value to take effect.
reboot_and_wait_for_device
context="Flag set, after 1st reboot"
check_device_config_flag "$context" "$flag" "$value"
check_system_property "$context" "$prop" "$value"
- check_zygote_gc_runtime_option "$context" "$gc_runtime_option"
+ $check_effect "$context"
# Reboot device a second time and check that the state has persisted.
reboot_and_wait_for_device
context="Flag set, after 2nd reboot"
check_device_config_flag "$context" "$flag" "$value"
check_system_property "$context" "$prop" "$value"
- check_zygote_gc_runtime_option "$context" "$gc_runtime_option"
+ $check_effect "$context"
say "Unsetting device configuration flag..."
adb shell device_config delete "$namespace" "$flag" >/dev/null
@@ -224,9 +250,13 @@
context="Flag unset, after 3rd reboot"
check_no_device_config_flag "$context" "$flag"
check_no_system_property "$context" "$prop"
- check_no_zygote_gc_runtime_option "$context" "$gc_runtime_option"
+ $check_no_effect "$context"
}
+
+# Pre-test actions.
+# =================
+
# Enumerate Zygote processes.
case $(adb shell getprop ro.zygote) in
(zygote32) zygotes="zygote";;
@@ -235,8 +265,56 @@
esac
# Test "enable_generational_cc" flag values.
-test_android_runtime_flag enable_generational_cc false nogenerational_cc
-test_android_runtime_flag enable_generational_cc true generational_cc
+# ==========================================
+
+function check_nogenerational_cc {
+ check_zygote_runtime_option "$1" "-Xgc:nogenerational_cc"
+}
+function check_no_nogenerational_cc {
+ check_no_zygote_runtime_option "$1" "-Xgc:nogenerational_cc"
+}
+
+function check_generational_cc {
+ check_zygote_runtime_option "$1" "-Xgc:generational_cc"
+}
+function check_no_generational_cc {
+ check_no_zygote_runtime_option "$1" "-Xgc:generational_cc"
+}
+
+test_android_runtime_flag \
+ enable_generational_cc false check_nogenerational_cc check_no_nogenerational_cc
+test_android_runtime_flag \
+ enable_generational_cc true check_generational_cc check_no_generational_cc
+
+# Test "enable_apex_image" flag values.
+# =====================================
+
+default_boot_image_message="Using default boot image"
+function check_default_boot_image {
+ check_android_runtime_message "$1" "$default_boot_image_message"
+}
+function check_no_default_boot_image {
+ check_no_android_runtime_message "$1" "$default_boot_image_message"
+}
+
+apex_boot_image_option="-Ximage:/system/framework/apex.art"
+apex_boot_image_message="Using Apex boot image: '$apex_boot_image_option'"
+function check_apex_boot_image {
+ check_zygote_runtime_option "$1" "$apex_boot_image_option"
+ check_android_runtime_message "$1" "$apex_boot_image_message"
+}
+function check_no_apex_boot_image {
+ check_no_zygote_runtime_option "$1" "$apex_boot_image_option"
+ check_no_android_runtime_message "$1" "$apex_boot_image_message"
+}
+
+test_android_runtime_flag \
+ enable_apex_image false check_default_boot_image check_no_default_boot_image
+test_android_runtime_flag \
+ enable_apex_image true check_apex_boot_image check_no_apex_boot_image
+
+# Post-test actions.
+# ==================
if [[ "$exit_status" -eq 0 ]]; then
banner "All tests passed."
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index e40d97b..35bc46a 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -1839,12 +1839,12 @@
<!-- Must be required by a {@link android.telecom.PhoneAccountSuggestionService},
to ensure that only the system can bind to it.
- <p>Protection level: signature|privileged
+ <p>Protection level: signature
@SystemApi
@hide
-->
<permission android:name="android.permission.BIND_PHONE_ACCOUNT_SUGGESTION_SERVICE"
- android:protectionLevel="signature|privileged" />
+ android:protectionLevel="signature" />
<!-- Must be required by a {@link android.telecom.CallRedirectionService},
to ensure that only the system can bind to it.
diff --git a/core/res/res/values-mcc311-mnc480/config.xml b/core/res/res/values-mcc311-mnc480/config.xml
index cc7daa8..db2f8d0 100755
--- a/core/res/res/values-mcc311-mnc480/config.xml
+++ b/core/res/res/values-mcc311-mnc480/config.xml
@@ -19,21 +19,6 @@
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <!-- CDMA home system id for Verizon -->
- <string-array translatable="false" name="config_cdma_home_system">
- <item>64</item>
- <item>65</item>
- <item>66</item>
- <item>76</item>
- <item>77</item>
- <item>78</item>
- <item>79</item>
- <item>80</item>
- <item>81</item>
- <item>82</item>
- <item>83</item>
- </string-array>
-
<!-- Flag indicating whether the IMS service can be turned off. If false then
the service will not be turned-off completely (the ImsManager.turnOffIms() will
be disabled) but individual Features can be disabled using ImsConfig.setFeatureValue() -->
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index de07b86..97ae8e5 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -477,22 +477,16 @@
- the return value of TelephonyManager.getTetherApnRequired()
determines how the array is further modified:
- * DUN_REQUIRED
- TYPE_MOBILE is removed (if present)
- TYPE_MOBILE_HIPRI is removed (if present)
- TYPE_MOBILE_DUN is appended (if not already present)
+ * TRUE (DUN REQUIRED).
+ TYPE_MOBILE is removed (if present).
+ TYPE_MOBILE_HIPRI is removed (if present).
+ TYPE_MOBILE_DUN is appended (if not already present).
- * DUN_NOT_REQUIRED
- TYPE_MOBILE_DUN is removed (if present)
- TYPE_MOBILE is appended (if not already present)
- TYPE_MOBILE_HIPRI is appended (if not already present)
-
- * DUN_UNSPECIFIED
- if any of TYPE_MOBILE{,_DUN,_HIPRI} are present:
- change nothing
- else:
- TYPE_MOBILE is appended
- TYPE_MOBILE_HIPRI is appended
+ * FALSE (DUN NOT REQUIRED).
+ TYPE_MOBILE_DUN is removed (if present).
+ If both of TYPE_MOBILE{,_HIPRI} are not present:
+ TYPE_MOBILE is appended.
+ TYPE_MOBILE_HIPRI is appended.
For other changes applied to this list, now and in the future, see
com.android.server.connectivity.tethering.TetheringConfiguration.
@@ -659,7 +653,7 @@
<bool translatable="false" name="config_wifi_framework_enable_associated_network_selection">true</bool>
<!-- Boolean indicating whether single radio chain scan results are to be used for network selection -->
- <bool translatable="false" name="config_wifi_framework_use_single_radio_chain_scan_results_network_selection">false</bool>
+ <bool translatable="false" name="config_wifi_framework_use_single_radio_chain_scan_results_network_selection">true</bool>
<!-- Boolean indicating that wifi only link configuratios that have exact same credentials (i.e PSK) -->
<bool translatable="false" name="config_wifi_only_link_same_credential_configurations">true</bool>
@@ -2754,14 +2748,6 @@
<bool name="config_networkSamplingWakesDevice">true</bool>
- <!-- Home (non-roaming) values for CDMA roaming indicator.
- Carriers can override this table by resource overlay. If not,
- the default values come from 3GPP2 C.R1001 table
- 8.1-1. Enhanced Roaming Indicator Number Assignments -->
- <string-array translatable="false" name="config_cdma_home_system">
- <item>1</item>
- </string-array>
-
<!--From SmsMessage-->
<!--Support decoding the user data payload as pack GSM 8-bit (a GSM alphabet
string that's stored in 8-bit unpacked format) characters.-->
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index a69914b..4689caa 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -2482,7 +2482,6 @@
<java-symbol type="attr" name="lightRadius" />
<java-symbol type="attr" name="ambientShadowAlpha" />
<java-symbol type="attr" name="spotShadowAlpha" />
- <java-symbol type="array" name="config_cdma_home_system" />
<java-symbol type="bool" name="config_sms_decode_gsm_8bit_data" />
<java-symbol type="dimen" name="text_size_small_material" />
<java-symbol type="attr" name="checkMarkGravity" />
diff --git a/core/xsd/Android.bp b/core/xsd/Android.bp
new file mode 100644
index 0000000..81669eb
--- /dev/null
+++ b/core/xsd/Android.bp
@@ -0,0 +1,6 @@
+xsd_config {
+ name: "permission",
+ srcs: ["permission.xsd"],
+ api_dir: "schema",
+ package_name: "com.android.xml.permission",
+}
diff --git a/core/xsd/permission.xsd b/core/xsd/permission.xsd
new file mode 100644
index 0000000..d90863b
--- /dev/null
+++ b/core/xsd/permission.xsd
@@ -0,0 +1,166 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright (C) 2019 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- TODO: define a targetNamespace. Note that it will break retrocompatibility -->
+<xs:schema version="2.0"
+ elementFormDefault="qualified"
+ attributeFormDefault="unqualified"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema">
+ <xs:element name="permissions">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="group" type="group" maxOccurs="unbounded"/>
+ <xs:element name="permission" type="permission" maxOccurs="unbounded"/>
+ <xs:element name="assign-permission" type="assign-permission" maxOccurs="unbounded"/>
+ <xs:element name="split-permission" type="split-permission" maxOccurs="unbounded"/>
+ <xs:element name="library" type="library" maxOccurs="unbounded"/>
+ <xs:element name="feature" type="feature" maxOccurs="unbounded"/>
+ <xs:element name="unavailable-feature" type="unavailable-feature" maxOccurs="unbounded"/>
+ <xs:element name="allow-in-power-save-except-idle" type="allow-in-power-save-except-idle" maxOccurs="unbounded"/>
+ <xs:element name="allow-in-power-save" type="allow-in-power-save" maxOccurs="unbounded"/>
+ <xs:element name="allow-in-data-usage-save" type="allow-in-data-usage-save" maxOccurs="unbounded"/>
+ <xs:element name="allow-unthrottled-location" type="allow-unthrottled-location" maxOccurs="unbounded"/>
+ <xs:element name="allow-ignore-location-settings" type="allow-ignore-location-settings" maxOccurs="unbounded"/>
+ <xs:element name="allow-implicit-broadcast" type="allow-implicit-broadcast" maxOccurs="unbounded"/>
+ <xs:element name="app-link" type="app-link" maxOccurs="unbounded"/>
+ <xs:element name="system-user-whitelisted-app" type="system-user-whitelisted-app" maxOccurs="unbounded"/>
+ <xs:element name="system-user-blacklisted-app" type="system-user-blacklisted-app" maxOccurs="unbounded"/>
+ <xs:element name="default-enabled-vr-app" type="default-enabled-vr-app" maxOccurs="unbounded"/>
+ <xs:element name="backup-transport-whitelisted-service" type="backup-transport-whitelisted-service" maxOccurs="unbounded"/>
+ <xs:element name="disabled-until-used-preinstalled-carrier-associated-app" type="disabled-until-used-preinstalled-carrier-associated-app" maxOccurs="unbounded"/>
+ <xs:element name="disabled-until-used-preinstalled-carrier-app" type="disabled-until-used-preinstalled-carrier-app" maxOccurs="unbounded"/>
+ <xs:element name="privapp-permissions" type="privapp-permissions" maxOccurs="unbounded"/>
+ <xs:element name="oem-permissions" type="oem-permissions" maxOccurs="unbounded"/>
+ <xs:element name="hidden-api-whitelisted-app" type="hidden-api-whitelisted-app" maxOccurs="unbounded"/>
+ <xs:element name="allow-association" type="allow-association" maxOccurs="unbounded"/>
+ <xs:element name="bugreport-whitelisted" type="bugreport-whitelisted" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:complexType name="group">
+ <xs:attribute name="gid" type="xs:int"/>
+ </xs:complexType>
+ <xs:complexType name="permission">
+ <xs:attribute name="name" type="xs:string"/>
+ </xs:complexType>
+ <xs:complexType name="assign-permission">
+ <xs:attribute name="name" type="xs:string"/>
+ <xs:attribute name="uid" type="xs:int"/>
+ </xs:complexType>
+ <xs:complexType name="split-permission">
+ <xs:attribute name="name" type="xs:string"/>
+ <xs:attribute name="targetSdk" type="xs:int"/>
+ <xs:sequence>
+ <xs:element name="library" maxOccurs="unbounded">
+ <xs:complexType>
+ <xs:attribute name="name" type="xs:string"/>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="library">
+ <xs:attribute name="name" type="xs:string"/>
+ <xs:attribute name="file" type="xs:string"/>
+ <xs:attribute name="dependency" type="xs:string"/>
+ </xs:complexType>
+ <xs:complexType name="feature">
+ <xs:attribute name="name" type="xs:string"/>
+ <xs:attribute name="notLowRam" type="xs:string"/>
+ </xs:complexType>
+ <xs:complexType name="unavailable-feature">
+ <xs:attribute name="name" type="xs:string"/>
+ </xs:complexType>
+ <xs:complexType name="allow-in-power-save-except-idle">
+ <xs:attribute name="package" type="xs:string"/>
+ </xs:complexType>
+ <xs:complexType name="allow-in-power-save">
+ <xs:attribute name="package" type="xs:string"/>
+ </xs:complexType>
+ <xs:complexType name="allow-in-data-usage-save">
+ <xs:attribute name="package" type="xs:string"/>
+ </xs:complexType>
+ <xs:complexType name="allow-unthrottled-location">
+ <xs:attribute name="package" type="xs:string"/>
+ </xs:complexType>
+ <xs:complexType name="allow-ignore-location-settings">
+ <xs:attribute name="package" type="xs:string"/>
+ </xs:complexType>
+ <xs:complexType name="allow-implicit-broadcast">
+ <xs:attribute name="action" type="xs:string"/>
+ </xs:complexType>
+ <xs:complexType name="app-link">
+ <xs:attribute name="package" type="xs:string"/>
+ </xs:complexType>
+ <xs:complexType name="system-user-whitelisted-app">
+ <xs:attribute name="package" type="xs:string"/>
+ </xs:complexType>
+ <xs:complexType name="system-user-blacklisted-app">
+ <xs:attribute name="package" type="xs:string"/>
+ </xs:complexType>
+ <xs:complexType name="default-enabled-vr-app">
+ <xs:attribute name="package" type="xs:string"/>
+ <xs:attribute name="class" type="xs:string"/>
+ </xs:complexType>
+ <xs:complexType name="backup-transport-whitelisted-service">
+ <xs:attribute name="service" type="xs:string"/>
+ </xs:complexType>
+ <xs:complexType name="disabled-until-used-preinstalled-carrier-associated-app">
+ <xs:attribute name="package" type="xs:string"/>
+ <xs:attribute name="carrierAppPackage" type="xs:string"/>
+ </xs:complexType>
+ <xs:complexType name="disabled-until-used-preinstalled-carrier-app">
+ <xs:attribute name="package" type="xs:string"/>
+ </xs:complexType>
+ <xs:complexType name="privapp-permissions">
+ <xs:attribute name="package" type="xs:string"/>
+ <xs:sequence>
+ <xs:element name="permission" maxOccurs="unbounded">
+ <xs:complexType>
+ <xs:attribute name="name" type="xs:string"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="deny-permission" maxOccurs="unbounded">
+ <xs:complexType>
+ <xs:attribute name="name" type="xs:string"/>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="oem-permissions">
+ <xs:attribute name="package" type="xs:string"/>
+ <xs:sequence>
+ <xs:element name="permission" maxOccurs="unbounded">
+ <xs:complexType>
+ <xs:attribute name="name" type="xs:string"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="deny-permission" maxOccurs="unbounded">
+ <xs:complexType>
+ <xs:attribute name="name" type="xs:string"/>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="hidden-api-whitelisted-app">
+ <xs:attribute name="package" type="xs:string"/>
+ </xs:complexType>
+ <xs:complexType name="allow-association">
+ <xs:attribute name="target" type="xs:string"/>
+ <xs:attribute name="allowed" type="xs:string"/>
+ </xs:complexType>
+ <xs:complexType name="bugreport-whitelisted">
+ <xs:attribute name="package" type="xs:string"/>
+ </xs:complexType>
+</xs:schema>
diff --git a/core/xsd/schema/README.md b/core/xsd/schema/README.md
new file mode 100644
index 0000000..f52d93d
--- /dev/null
+++ b/core/xsd/schema/README.md
@@ -0,0 +1 @@
+Please see the [README](https://android.googlesource.com/platform/system/tools/xsdc/+/refs/heads/master/README.md) for details regarding the Configfile as API.
diff --git a/core/xsd/schema/current.txt b/core/xsd/schema/current.txt
new file mode 100644
index 0000000..82bb0fea
--- /dev/null
+++ b/core/xsd/schema/current.txt
@@ -0,0 +1,242 @@
+// Signature format: 2.0
+package com.android.xml.permission {
+
+ public class AllowAssociation {
+ ctor public AllowAssociation();
+ method public String getAllowed();
+ method public String getTarget();
+ method public void setAllowed(String);
+ method public void setTarget(String);
+ }
+
+ public class AllowIgnoreLocationSettings {
+ ctor public AllowIgnoreLocationSettings();
+ method public String get_package();
+ method public void set_package(String);
+ }
+
+ public class AllowImplicitBroadcast {
+ ctor public AllowImplicitBroadcast();
+ method public String getAction();
+ method public void setAction(String);
+ }
+
+ public class AllowInDataUsageSave {
+ ctor public AllowInDataUsageSave();
+ method public String get_package();
+ method public void set_package(String);
+ }
+
+ public class AllowInPowerSave {
+ ctor public AllowInPowerSave();
+ method public String get_package();
+ method public void set_package(String);
+ }
+
+ public class AllowInPowerSaveExceptIdle {
+ ctor public AllowInPowerSaveExceptIdle();
+ method public String get_package();
+ method public void set_package(String);
+ }
+
+ public class AllowUnthrottledLocation {
+ ctor public AllowUnthrottledLocation();
+ method public String get_package();
+ method public void set_package(String);
+ }
+
+ public class AppLink {
+ ctor public AppLink();
+ method public String get_package();
+ method public void set_package(String);
+ }
+
+ public class AssignPermission {
+ ctor public AssignPermission();
+ method public String getName();
+ method public int getUid();
+ method public void setName(String);
+ method public void setUid(int);
+ }
+
+ public class BackupTransportWhitelistedService {
+ ctor public BackupTransportWhitelistedService();
+ method public String getService();
+ method public void setService(String);
+ }
+
+ public class BugreportWhitelisted {
+ ctor public BugreportWhitelisted();
+ method public String get_package();
+ method public void set_package(String);
+ }
+
+ public class DefaultEnabledVrApp {
+ ctor public DefaultEnabledVrApp();
+ method public String get_class();
+ method public String get_package();
+ method public void set_class(String);
+ method public void set_package(String);
+ }
+
+ public class DisabledUntilUsedPreinstalledCarrierApp {
+ ctor public DisabledUntilUsedPreinstalledCarrierApp();
+ method public String get_package();
+ method public void set_package(String);
+ }
+
+ public class DisabledUntilUsedPreinstalledCarrierAssociatedApp {
+ ctor public DisabledUntilUsedPreinstalledCarrierAssociatedApp();
+ method public String getCarrierAppPackage();
+ method public String get_package();
+ method public void setCarrierAppPackage(String);
+ method public void set_package(String);
+ }
+
+ public class Feature {
+ ctor public Feature();
+ method public String getName();
+ method public String getNotLowRam();
+ method public void setName(String);
+ method public void setNotLowRam(String);
+ }
+
+ public class Group {
+ ctor public Group();
+ method public int getGid();
+ method public void setGid(int);
+ }
+
+ public class HiddenApiWhitelistedApp {
+ ctor public HiddenApiWhitelistedApp();
+ method public String get_package();
+ method public void set_package(String);
+ }
+
+ public class Library {
+ ctor public Library();
+ method public String getDependency();
+ method public String getFile();
+ method public String getName();
+ method public void setDependency(String);
+ method public void setFile(String);
+ method public void setName(String);
+ }
+
+ public class OemPermissions {
+ ctor public OemPermissions();
+ method public java.util.List<com.android.xml.permission.OemPermissions.DenyPermission> getDenyPermission();
+ method public java.util.List<com.android.xml.permission.OemPermissions.Permission> getPermission();
+ method public String get_package();
+ method public void set_package(String);
+ }
+
+ public static class OemPermissions.DenyPermission {
+ ctor public OemPermissions.DenyPermission();
+ method public String getName();
+ method public void setName(String);
+ }
+
+ public static class OemPermissions.Permission {
+ ctor public OemPermissions.Permission();
+ method public String getName();
+ method public void setName(String);
+ }
+
+ public class Permission {
+ ctor public Permission();
+ method public String getName();
+ method public void setName(String);
+ }
+
+ public class Permissions {
+ ctor public Permissions();
+ method public java.util.List<com.android.xml.permission.AllowAssociation> getAllowAssociation();
+ method public java.util.List<com.android.xml.permission.AllowIgnoreLocationSettings> getAllowIgnoreLocationSettings();
+ method public java.util.List<com.android.xml.permission.AllowImplicitBroadcast> getAllowImplicitBroadcast();
+ method public java.util.List<com.android.xml.permission.AllowInDataUsageSave> getAllowInDataUsageSave();
+ method public java.util.List<com.android.xml.permission.AllowInPowerSave> getAllowInPowerSave();
+ method public java.util.List<com.android.xml.permission.AllowInPowerSaveExceptIdle> getAllowInPowerSaveExceptIdle();
+ method public java.util.List<com.android.xml.permission.AllowUnthrottledLocation> getAllowUnthrottledLocation();
+ method public java.util.List<com.android.xml.permission.AppLink> getAppLink();
+ method public java.util.List<com.android.xml.permission.AssignPermission> getAssignPermission();
+ method public java.util.List<com.android.xml.permission.BackupTransportWhitelistedService> getBackupTransportWhitelistedService();
+ method public java.util.List<com.android.xml.permission.BugreportWhitelisted> getBugreportWhitelisted();
+ method public java.util.List<com.android.xml.permission.DefaultEnabledVrApp> getDefaultEnabledVrApp();
+ method public java.util.List<com.android.xml.permission.DisabledUntilUsedPreinstalledCarrierApp> getDisabledUntilUsedPreinstalledCarrierApp();
+ method public java.util.List<com.android.xml.permission.DisabledUntilUsedPreinstalledCarrierAssociatedApp> getDisabledUntilUsedPreinstalledCarrierAssociatedApp();
+ method public java.util.List<com.android.xml.permission.Feature> getFeature();
+ method public java.util.List<com.android.xml.permission.Group> getGroup();
+ method public java.util.List<com.android.xml.permission.HiddenApiWhitelistedApp> getHiddenApiWhitelistedApp();
+ method public java.util.List<com.android.xml.permission.Library> getLibrary();
+ method public java.util.List<com.android.xml.permission.OemPermissions> getOemPermissions();
+ method public java.util.List<com.android.xml.permission.Permission> getPermission();
+ method public java.util.List<com.android.xml.permission.PrivappPermissions> getPrivappPermissions();
+ method public java.util.List<com.android.xml.permission.SplitPermission> getSplitPermission();
+ method public java.util.List<com.android.xml.permission.SystemUserBlacklistedApp> getSystemUserBlacklistedApp();
+ method public java.util.List<com.android.xml.permission.SystemUserWhitelistedApp> getSystemUserWhitelistedApp();
+ method public java.util.List<com.android.xml.permission.UnavailableFeature> getUnavailableFeature();
+ }
+
+ public class PrivappPermissions {
+ ctor public PrivappPermissions();
+ method public java.util.List<com.android.xml.permission.PrivappPermissions.DenyPermission> getDenyPermission();
+ method public java.util.List<com.android.xml.permission.PrivappPermissions.Permission> getPermission();
+ method public String get_package();
+ method public void set_package(String);
+ }
+
+ public static class PrivappPermissions.DenyPermission {
+ ctor public PrivappPermissions.DenyPermission();
+ method public String getName();
+ method public void setName(String);
+ }
+
+ public static class PrivappPermissions.Permission {
+ ctor public PrivappPermissions.Permission();
+ method public String getName();
+ method public void setName(String);
+ }
+
+ public class SplitPermission {
+ ctor public SplitPermission();
+ method public java.util.List<com.android.xml.permission.SplitPermission.Library> getLibrary();
+ method public String getName();
+ method public int getTargetSdk();
+ method public void setName(String);
+ method public void setTargetSdk(int);
+ }
+
+ public static class SplitPermission.Library {
+ ctor public SplitPermission.Library();
+ method public String getName();
+ method public void setName(String);
+ }
+
+ public class SystemUserBlacklistedApp {
+ ctor public SystemUserBlacklistedApp();
+ method public String get_package();
+ method public void set_package(String);
+ }
+
+ public class SystemUserWhitelistedApp {
+ ctor public SystemUserWhitelistedApp();
+ method public String get_package();
+ method public void set_package(String);
+ }
+
+ public class UnavailableFeature {
+ ctor public UnavailableFeature();
+ method public String getName();
+ method public void setName(String);
+ }
+
+ public class XmlParser {
+ ctor public XmlParser();
+ method public static com.android.xml.permission.Permissions read(java.io.InputStream) throws javax.xml.datatype.DatatypeConfigurationException, java.io.IOException, org.xmlpull.v1.XmlPullParserException;
+ method public static String readText(org.xmlpull.v1.XmlPullParser) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
+ method public static void skip(org.xmlpull.v1.XmlPullParser) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
+ }
+
+}
+
diff --git a/core/xsd/schema/last_current.txt b/core/xsd/schema/last_current.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/core/xsd/schema/last_current.txt
diff --git a/core/xsd/schema/last_removed.txt b/core/xsd/schema/last_removed.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/core/xsd/schema/last_removed.txt
diff --git a/core/xsd/schema/removed.txt b/core/xsd/schema/removed.txt
new file mode 100644
index 0000000..d802177
--- /dev/null
+++ b/core/xsd/schema/removed.txt
@@ -0,0 +1 @@
+// Signature format: 2.0
diff --git a/graphics/java/android/graphics/drawable/GradientDrawable.java b/graphics/java/android/graphics/drawable/GradientDrawable.java
index d34d461..2a286af 100644
--- a/graphics/java/android/graphics/drawable/GradientDrawable.java
+++ b/graphics/java/android/graphics/drawable/GradientDrawable.java
@@ -579,9 +579,9 @@
* The default value for this property is {@code false}.
* <p>
* <strong>Note</strong>: This property corresponds to the
- * {@code android:useLevel} attribute on the inner {@code <gradient>}
+ * {@code android:useLevel} attribute on the inner {@code <gradient>}
* tag, NOT the {@code android:useLevel} attribute on the outer
- * {@code <shape>} tag. For example,
+ * {@code <shape>} tag. For example,
* <pre>{@code
* <shape ...>
* <gradient
diff --git a/keystore/java/android/security/Credentials.java b/keystore/java/android/security/Credentials.java
index 072fe73..962ce512 100644
--- a/keystore/java/android/security/Credentials.java
+++ b/keystore/java/android/security/Credentials.java
@@ -131,6 +131,7 @@
* Convert objects to a PEM format which is used for
* CA_CERTIFICATE and USER_CERTIFICATE entries.
*/
+ @UnsupportedAppUsage
public static byte[] convertToPem(Certificate... objects)
throws IOException, CertificateEncodingException {
ByteArrayOutputStream bao = new ByteArrayOutputStream();
diff --git a/keystore/java/android/security/IKeyChainService.aidl b/keystore/java/android/security/IKeyChainService.aidl
index 0d32075..b3cdff7 100644
--- a/keystore/java/android/security/IKeyChainService.aidl
+++ b/keystore/java/android/security/IKeyChainService.aidl
@@ -27,6 +27,7 @@
*/
interface IKeyChainService {
// APIs used by KeyChain
+ @UnsupportedAppUsage
String requestPrivateKey(String alias);
byte[] getCertificate(String alias);
byte[] getCaCertificates(String alias);
diff --git a/keystore/java/android/security/KeyChain.java b/keystore/java/android/security/KeyChain.java
index 030fa60..6155ae4 100644
--- a/keystore/java/android/security/KeyChain.java
+++ b/keystore/java/android/security/KeyChain.java
@@ -36,6 +36,7 @@
import android.os.RemoteException;
import android.os.UserHandle;
import android.security.keystore.AndroidKeyStoreProvider;
+import android.security.keystore.KeyPermanentlyInvalidatedException;
import android.security.keystore.KeyProperties;
import java.io.ByteArrayInputStream;
@@ -538,7 +539,7 @@
try {
return AndroidKeyStoreProvider.loadAndroidKeyStoreKeyPairFromKeystore(
KeyStore.getInstance(), keyId, KeyStore.UID_SELF);
- } catch (RuntimeException | UnrecoverableKeyException e) {
+ } catch (RuntimeException | UnrecoverableKeyException | KeyPermanentlyInvalidatedException e) {
throw new KeyChainException(e);
}
}
diff --git a/keystore/java/android/security/KeyStore.java b/keystore/java/android/security/KeyStore.java
index 25a6cdc..330d24d 100644
--- a/keystore/java/android/security/KeyStore.java
+++ b/keystore/java/android/security/KeyStore.java
@@ -97,6 +97,9 @@
*/
public static final int OP_AUTH_NEEDED = 15;
+ // Used when a user changes their pin, invalidating old auth bound keys.
+ public static final int KEY_PERMANENTLY_INVALIDATED = 17;
+
// Used for UID field to indicate the calling UID.
public static final int UID_SELF = -1;
@@ -1188,6 +1191,8 @@
return new KeyStoreException(errorCode, "Key blob corrupted");
case OP_AUTH_NEEDED:
return new KeyStoreException(errorCode, "Operation requires authorization");
+ case KEY_PERMANENTLY_INVALIDATED:
+ return new KeyStoreException(errorCode, "Key permanently invalidated");
default:
return new KeyStoreException(errorCode, String.valueOf(errorCode));
}
diff --git a/keystore/java/android/security/keystore/AndroidKeyStoreKeyPairGeneratorSpi.java b/keystore/java/android/security/keystore/AndroidKeyStoreKeyPairGeneratorSpi.java
index d44c894..91aac83 100644
--- a/keystore/java/android/security/keystore/AndroidKeyStoreKeyPairGeneratorSpi.java
+++ b/keystore/java/android/security/keystore/AndroidKeyStoreKeyPairGeneratorSpi.java
@@ -526,7 +526,7 @@
+ result.getPrivate().getAlgorithm() + " vs " + mJcaKeyAlgorithm);
}
return result;
- } catch (UnrecoverableKeyException e) {
+ } catch (UnrecoverableKeyException | KeyPermanentlyInvalidatedException e) {
throw new ProviderException("Failed to load generated key pair from keystore", e);
}
}
diff --git a/keystore/java/android/security/keystore/AndroidKeyStoreProvider.java b/keystore/java/android/security/keystore/AndroidKeyStoreProvider.java
index c7c9ee4..234615d 100644
--- a/keystore/java/android/security/keystore/AndroidKeyStoreProvider.java
+++ b/keystore/java/android/security/keystore/AndroidKeyStoreProvider.java
@@ -228,10 +228,16 @@
@NonNull
private static KeyCharacteristics getKeyCharacteristics(@NonNull KeyStore keyStore,
@NonNull String alias, int uid)
- throws UnrecoverableKeyException {
+ throws UnrecoverableKeyException, KeyPermanentlyInvalidatedException {
KeyCharacteristics keyCharacteristics = new KeyCharacteristics();
int errorCode = keyStore.getKeyCharacteristics(
alias, null, null, uid, keyCharacteristics);
+ if (errorCode == KeyStore.KEY_PERMANENTLY_INVALIDATED) {
+ throw (KeyPermanentlyInvalidatedException)
+ new KeyPermanentlyInvalidatedException(
+ "User changed or deleted their auth credentials",
+ KeyStore.getKeyStoreException(errorCode));
+ }
if (errorCode != KeyStore.NO_ERROR) {
throw (UnrecoverableKeyException)
new UnrecoverableKeyException("Failed to obtain information about key")
@@ -276,7 +282,7 @@
@NonNull
public static AndroidKeyStorePublicKey loadAndroidKeyStorePublicKeyFromKeystore(
@NonNull KeyStore keyStore, @NonNull String privateKeyAlias, int uid)
- throws UnrecoverableKeyException {
+ throws UnrecoverableKeyException, KeyPermanentlyInvalidatedException {
return loadAndroidKeyStorePublicKeyFromKeystore(keyStore, privateKeyAlias, uid,
getKeyCharacteristics(keyStore, privateKeyAlias, uid));
}
@@ -297,7 +303,7 @@
@NonNull
public static KeyPair loadAndroidKeyStoreKeyPairFromKeystore(
@NonNull KeyStore keyStore, @NonNull String privateKeyAlias, int uid)
- throws UnrecoverableKeyException {
+ throws UnrecoverableKeyException, KeyPermanentlyInvalidatedException {
return loadAndroidKeyStoreKeyPairFromKeystore(keyStore, privateKeyAlias, uid,
getKeyCharacteristics(keyStore, privateKeyAlias, uid));
}
@@ -315,7 +321,7 @@
@NonNull
public static AndroidKeyStorePrivateKey loadAndroidKeyStorePrivateKeyFromKeystore(
@NonNull KeyStore keyStore, @NonNull String privateKeyAlias, int uid)
- throws UnrecoverableKeyException {
+ throws UnrecoverableKeyException, KeyPermanentlyInvalidatedException {
return loadAndroidKeyStorePrivateKeyFromKeystore(keyStore, privateKeyAlias, uid,
getKeyCharacteristics(keyStore, privateKeyAlias, uid));
}
@@ -354,7 +360,7 @@
@NonNull
public static AndroidKeyStoreKey loadAndroidKeyStoreKeyFromKeystore(
@NonNull KeyStore keyStore, @NonNull String userKeyAlias, int uid)
- throws UnrecoverableKeyException {
+ throws UnrecoverableKeyException, KeyPermanentlyInvalidatedException {
KeyCharacteristics keyCharacteristics = getKeyCharacteristics(keyStore, userKeyAlias, uid);
Integer keymasterAlgorithm = keyCharacteristics.getEnum(KeymasterDefs.KM_TAG_ALGORITHM);
diff --git a/keystore/java/android/security/keystore/AndroidKeyStoreSpi.java b/keystore/java/android/security/keystore/AndroidKeyStoreSpi.java
index 4c007cb..105af6e 100644
--- a/keystore/java/android/security/keystore/AndroidKeyStoreSpi.java
+++ b/keystore/java/android/security/keystore/AndroidKeyStoreSpi.java
@@ -24,6 +24,7 @@
import android.security.keymaster.KeyCharacteristics;
import android.security.keymaster.KeymasterArguments;
import android.security.keymaster.KeymasterDefs;
+import android.security.keystore.KeyPermanentlyInvalidatedException;
import android.security.keystore.KeyProperties;
import android.security.keystore.KeyProtection;
import android.security.keystore.SecureKeyImportUnavailableException;
@@ -93,13 +94,20 @@
public Key engineGetKey(String alias, char[] password) throws NoSuchAlgorithmException,
UnrecoverableKeyException {
String userKeyAlias = Credentials.USER_PRIVATE_KEY + alias;
+ AndroidKeyStoreKey key;
if (!mKeyStore.contains(userKeyAlias, mUid)) {
// try legacy prefix for backward compatibility
userKeyAlias = Credentials.USER_SECRET_KEY + alias;
if (!mKeyStore.contains(userKeyAlias, mUid)) return null;
}
- return AndroidKeyStoreProvider.loadAndroidKeyStoreKeyFromKeystore(mKeyStore, userKeyAlias,
- mUid);
+ try {
+ key = AndroidKeyStoreProvider.loadAndroidKeyStoreKeyFromKeystore(mKeyStore,
+ userKeyAlias,
+ mUid);
+ } catch (KeyPermanentlyInvalidatedException e) {
+ throw new UnrecoverableKeyException(e.getMessage());
+ }
+ return key;
}
@Override
diff --git a/location/java/android/location/IGeocodeProvider.aidl b/location/java/android/location/IGeocodeProvider.aidl
index aaa70c7..7eaf7b8 100644
--- a/location/java/android/location/IGeocodeProvider.aidl
+++ b/location/java/android/location/IGeocodeProvider.aidl
@@ -26,9 +26,11 @@
*/
interface IGeocodeProvider {
+ @UnsupportedAppUsage
String getFromLocation(double latitude, double longitude, int maxResults,
in GeocoderParams params, out List<Address> addrs);
+ @UnsupportedAppUsage
String getFromLocationName(String locationName,
double lowerLeftLatitude, double lowerLeftLongitude,
double upperRightLatitude, double upperRightLongitude, int maxResults,
diff --git a/location/java/android/location/IGeofenceProvider.aidl b/location/java/android/location/IGeofenceProvider.aidl
index d4ff0dd..426ebef 100644
--- a/location/java/android/location/IGeofenceProvider.aidl
+++ b/location/java/android/location/IGeofenceProvider.aidl
@@ -24,5 +24,6 @@
* {@hide}
*/
oneway interface IGeofenceProvider {
+ @UnsupportedAppUsage
void setGeofenceHardware(in IGeofenceHardware proxy);
}
diff --git a/location/java/android/location/ILocationListener.aidl b/location/java/android/location/ILocationListener.aidl
index 7627cf6..e40b408 100644
--- a/location/java/android/location/ILocationListener.aidl
+++ b/location/java/android/location/ILocationListener.aidl
@@ -25,8 +25,12 @@
*/
oneway interface ILocationListener
{
+ @UnsupportedAppUsage
void onLocationChanged(in Location location);
+ @UnsupportedAppUsage
void onStatusChanged(String provider, int status, in Bundle extras);
+ @UnsupportedAppUsage
void onProviderEnabled(String provider);
+ @UnsupportedAppUsage
void onProviderDisabled(String provider);
}
diff --git a/location/java/android/location/ILocationManager.aidl b/location/java/android/location/ILocationManager.aidl
index 1276881..0ba1700 100644
--- a/location/java/android/location/ILocationManager.aidl
+++ b/location/java/android/location/ILocationManager.aidl
@@ -82,11 +82,13 @@
boolean injectLocation(in Location location);
// --- deprecated ---
+ @UnsupportedAppUsage
List<String> getAllProviders();
List<String> getProviders(in Criteria criteria, boolean enabledOnly);
String getBestProvider(in Criteria criteria, boolean enabledOnly);
boolean providerMeetsCriteria(String provider, in Criteria criteria);
ProviderProperties getProviderProperties(String provider);
+ @UnsupportedAppUsage
String getNetworkProviderPackage();
boolean isProviderEnabledForUser(String provider, int userId);
@@ -110,6 +112,7 @@
// Used by location providers to tell the location manager when it has a new location.
// Passive is true if the location is coming from the passive provider, in which case
// it need not be shared with other providers.
+ @UnsupportedAppUsage
void reportLocation(in Location location, boolean passive);
// Used when a (initially Gnss) Location batch arrives
diff --git a/location/java/android/location/INetInitiatedListener.aidl b/location/java/android/location/INetInitiatedListener.aidl
index fc64dd6..a9e9136 100644
--- a/location/java/android/location/INetInitiatedListener.aidl
+++ b/location/java/android/location/INetInitiatedListener.aidl
@@ -22,5 +22,6 @@
*/
interface INetInitiatedListener
{
+ @UnsupportedAppUsage
boolean sendNiResponse(int notifId, int userResponse);
}
diff --git a/location/java/com/android/internal/location/ILocationProvider.aidl b/location/java/com/android/internal/location/ILocationProvider.aidl
index 39c2d92..1820bb7 100644
--- a/location/java/com/android/internal/location/ILocationProvider.aidl
+++ b/location/java/com/android/internal/location/ILocationProvider.aidl
@@ -31,14 +31,21 @@
* @hide
*/
interface ILocationProvider {
+ @UnsupportedAppUsage
void enable();
+ @UnsupportedAppUsage
void disable();
+ @UnsupportedAppUsage
void setRequest(in ProviderRequest request, in WorkSource ws);
// --- deprecated (but still supported) ---
+ @UnsupportedAppUsage
ProviderProperties getProperties();
+ @UnsupportedAppUsage
int getStatus(out Bundle extras);
+ @UnsupportedAppUsage
long getStatusUpdateTime();
+ @UnsupportedAppUsage
boolean sendExtraCommand(String command, inout Bundle extras);
}
diff --git a/media/java/android/media/IAudioFocusDispatcher.aidl b/media/java/android/media/IAudioFocusDispatcher.aidl
index 3b33c5b..e3512fa 100644
--- a/media/java/android/media/IAudioFocusDispatcher.aidl
+++ b/media/java/android/media/IAudioFocusDispatcher.aidl
@@ -23,6 +23,7 @@
*/
oneway interface IAudioFocusDispatcher {
+ @UnsupportedAppUsage
void dispatchAudioFocusChange(int focusChange, String clientId);
void dispatchFocusResultFromExtPolicy(int requestResult, String clientId);
diff --git a/media/java/android/media/IAudioService.aidl b/media/java/android/media/IAudioService.aidl
index abd6411..1a44a83 100644
--- a/media/java/android/media/IAudioService.aidl
+++ b/media/java/android/media/IAudioService.aidl
@@ -63,6 +63,7 @@
void adjustStreamVolume(int streamType, int direction, int flags, String callingPackage);
+ @UnsupportedAppUsage
void setStreamVolume(int streamType, int index, int flags, String callingPackage);
boolean isStreamMute(int streamType);
@@ -73,10 +74,12 @@
void setMasterMute(boolean mute, int flags, String callingPackage, int userId);
+ @UnsupportedAppUsage
int getStreamVolume(int streamType);
int getStreamMinVolume(int streamType);
+ @UnsupportedAppUsage
int getStreamMaxVolume(int streamType);
int getLastAudibleStreamVolume(int streamType);
@@ -155,6 +158,7 @@
void handleBluetoothA2dpDeviceConfigChange(in BluetoothDevice device);
+ @UnsupportedAppUsage
AudioRoutesInfo startWatchingRoutes(in IAudioRoutesObserver observer);
boolean isCameraSoundForced();
diff --git a/media/java/android/media/IMediaScannerService.aidl b/media/java/android/media/IMediaScannerService.aidl
index c531646..24b5595 100644
--- a/media/java/android/media/IMediaScannerService.aidl
+++ b/media/java/android/media/IMediaScannerService.aidl
@@ -31,6 +31,7 @@
* @param listener an optional IMediaScannerListener.
* If specified, the caller will be notified when scanning is complete via the listener.
*/
+ @UnsupportedAppUsage
void requestScanFile(String path, String mimeType, in IMediaScannerListener listener);
/**
@@ -40,5 +41,6 @@
* @param mimeType an optional mimeType for the file.
* If mimeType is null, then the mimeType will be inferred from the file extension.
*/
+ @UnsupportedAppUsage
void scanFile(String path, String mimeType);
}
diff --git a/media/java/android/media/IRemoteDisplayCallback.aidl b/media/java/android/media/IRemoteDisplayCallback.aidl
index 19cf070..584417d 100644
--- a/media/java/android/media/IRemoteDisplayCallback.aidl
+++ b/media/java/android/media/IRemoteDisplayCallback.aidl
@@ -22,5 +22,6 @@
* {@hide}
*/
oneway interface IRemoteDisplayCallback {
+ @UnsupportedAppUsage
void onStateChanged(in RemoteDisplayState state);
}
diff --git a/media/java/android/media/projection/IMediaProjectionManager.aidl b/media/java/android/media/projection/IMediaProjectionManager.aidl
index 7e10c51..d190fce 100644
--- a/media/java/android/media/projection/IMediaProjectionManager.aidl
+++ b/media/java/android/media/projection/IMediaProjectionManager.aidl
@@ -24,6 +24,7 @@
/** {@hide} */
interface IMediaProjectionManager {
+ @UnsupportedAppUsage
boolean hasProjectionPermission(int uid, String packageName);
IMediaProjection createProjection(int uid, String packageName, int type,
boolean permanentGrant);
diff --git a/media/jni/Android.bp b/media/jni/Android.bp
index 25c7b5c..5966192 100644
--- a/media/jni/Android.bp
+++ b/media/jni/Android.bp
@@ -20,8 +20,8 @@
"android_media_MediaScanner.cpp",
"android_media_MediaSync.cpp",
"android_media_ResampleInputStream.cpp",
+ "android_media_Streams.cpp",
"android_media_SyncParams.cpp",
- "android_media_Utils.cpp",
"android_mtp_MtpDatabase.cpp",
"android_mtp_MtpDevice.cpp",
"android_mtp_MtpServer.cpp",
@@ -36,6 +36,7 @@
"libbinder",
"libmedia",
"libmediaextractor",
+ "libmedia_jni_utils",
"libmedia_omx",
"libmediametrics",
"libmediadrm",
@@ -91,6 +92,36 @@
}
cc_library_shared {
+ name: "libmedia_jni_utils",
+ srcs: [
+ "android_media_Utils.cpp",
+ ],
+
+ shared_libs: [
+ "liblog",
+ "libmedia_omx",
+ "libnativewindow",
+ "libui",
+ "libutils",
+ "android.hidl.token@1.0-utils",
+ ],
+
+ include_dirs: [
+ "system/media/camera/include",
+ ],
+
+ export_include_dirs: ["."],
+
+ cflags: [
+ "-Wall",
+ "-Werror",
+ "-Wno-error=deprecated-declarations",
+ "-Wunused",
+ "-Wunreachable-code",
+ ],
+}
+
+cc_library_shared {
name: "libmedia2_jni",
srcs: [
diff --git a/media/jni/android_media_MediaCodec.cpp b/media/jni/android_media_MediaCodec.cpp
index 3490ff8..cf73b21 100644
--- a/media/jni/android_media_MediaCodec.cpp
+++ b/media/jni/android_media_MediaCodec.cpp
@@ -23,7 +23,7 @@
#include "android_media_MediaCrypto.h"
#include "android_media_MediaDescrambler.h"
#include "android_media_MediaMetricsJNI.h"
-#include "android_media_Utils.h"
+#include "android_media_Streams.h"
#include "android_runtime/AndroidRuntime.h"
#include "android_runtime/android_view_Surface.h"
#include "android_util_Binder.h"
diff --git a/media/jni/android_media_MediaCodecList.cpp b/media/jni/android_media_MediaCodecList.cpp
index 8de11ca..878910a 100644
--- a/media/jni/android_media_MediaCodecList.cpp
+++ b/media/jni/android_media_MediaCodecList.cpp
@@ -27,7 +27,7 @@
#include "android_runtime/AndroidRuntime.h"
#include "jni.h"
#include <nativehelper/JNIHelp.h>
-#include "android_media_Utils.h"
+#include "android_media_Streams.h"
using namespace android;
diff --git a/media/jni/android_media_MediaExtractor.cpp b/media/jni/android_media_MediaExtractor.cpp
index dad0e53..3edac44 100644
--- a/media/jni/android_media_MediaExtractor.cpp
+++ b/media/jni/android_media_MediaExtractor.cpp
@@ -21,7 +21,7 @@
#include "android_media_MediaDataSource.h"
#include "android_media_MediaExtractor.h"
#include "android_media_MediaMetricsJNI.h"
-#include "android_media_Utils.h"
+#include "android_media_Streams.h"
#include "android_os_HwRemoteBinder.h"
#include "android_runtime/AndroidRuntime.h"
#include "android_runtime/Log.h"
diff --git a/media/jni/android_media_MediaMetadataRetriever.cpp b/media/jni/android_media_MediaMetadataRetriever.cpp
index c1226fa..a480784 100644
--- a/media/jni/android_media_MediaMetadataRetriever.cpp
+++ b/media/jni/android_media_MediaMetadataRetriever.cpp
@@ -18,6 +18,7 @@
//#define LOG_NDEBUG 0
#define LOG_TAG "MediaMetadataRetrieverJNI"
+#include <cmath>
#include <assert.h>
#include <utils/Log.h>
#include <utils/threads.h>
@@ -32,7 +33,7 @@
#include <nativehelper/JNIHelp.h>
#include "android_runtime/AndroidRuntime.h"
#include "android_media_MediaDataSource.h"
-#include "android_media_Utils.h"
+#include "android_media_Streams.h"
#include "android_util_Binder.h"
#include "android/graphics/GraphicsJNI.h"
diff --git a/media/jni/android_media_MediaMuxer.cpp b/media/jni/android_media_MediaMuxer.cpp
index f11452a..f0aa4c3 100644
--- a/media/jni/android_media_MediaMuxer.cpp
+++ b/media/jni/android_media_MediaMuxer.cpp
@@ -18,7 +18,7 @@
#define LOG_TAG "MediaMuxer-JNI"
#include <utils/Log.h>
-#include "android_media_Utils.h"
+#include "android_media_Streams.h"
#include "android_runtime/AndroidRuntime.h"
#include "jni.h"
#include <nativehelper/JNIHelp.h>
diff --git a/media/jni/android_media_MediaPlayer.cpp b/media/jni/android_media_MediaPlayer.cpp
index 5dd01b0..2acb0e5 100644
--- a/media/jni/android_media_MediaPlayer.cpp
+++ b/media/jni/android_media_MediaPlayer.cpp
@@ -45,7 +45,7 @@
#include "android_media_PlaybackParams.h"
#include "android_media_SyncParams.h"
#include "android_media_VolumeShaper.h"
-#include "android_media_Utils.h"
+#include "android_media_Streams.h"
#include "android_os_Parcel.h"
#include "android_util_Binder.h"
diff --git a/media/jni/android_media_Streams.cpp b/media/jni/android_media_Streams.cpp
new file mode 100644
index 0000000..b7cbd97
--- /dev/null
+++ b/media/jni/android_media_Streams.cpp
@@ -0,0 +1,559 @@
+/*
+ * Copyright 2019, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// #define LOG_NDEBUG 0
+#define LOG_TAG "AndroidMediaStreams"
+
+#include <utils/Log.h>
+#include "android_media_Streams.h"
+
+#include <media/stagefright/foundation/ADebug.h>
+#include <media/stagefright/foundation/ABuffer.h>
+#include <media/stagefright/foundation/AMessage.h>
+
+#include <nativehelper/ScopedLocalRef.h>
+
+namespace android {
+
+AssetStream::AssetStream(SkStream* stream)
+ : mStream(stream), mPosition(0) {
+}
+
+AssetStream::~AssetStream() {
+}
+
+piex::Error AssetStream::GetData(
+ const size_t offset, const size_t length, std::uint8_t* data) {
+ // Seek first.
+ if (mPosition != offset) {
+ if (!mStream->seek(offset)) {
+ return piex::Error::kFail;
+ }
+ }
+
+ // Read bytes.
+ size_t size = mStream->read((void*)data, length);
+ mPosition = offset + size;
+
+ return size == length ? piex::Error::kOk : piex::Error::kFail;
+}
+
+BufferedStream::BufferedStream(SkStream* stream)
+ : mStream(stream) {
+}
+
+BufferedStream::~BufferedStream() {
+}
+
+piex::Error BufferedStream::GetData(
+ const size_t offset, const size_t length, std::uint8_t* data) {
+ // Seek first.
+ if (offset + length > mStreamBuffer.bytesWritten()) {
+ size_t sizeToRead = offset + length - mStreamBuffer.bytesWritten();
+ if (sizeToRead <= kMinSizeToRead) {
+ sizeToRead = kMinSizeToRead;
+ }
+
+ void* tempBuffer = malloc(sizeToRead);
+ if (tempBuffer == NULL) {
+ return piex::Error::kFail;
+ }
+
+ size_t bytesRead = mStream->read(tempBuffer, sizeToRead);
+ if (bytesRead != sizeToRead) {
+ free(tempBuffer);
+ return piex::Error::kFail;
+ }
+ mStreamBuffer.write(tempBuffer, bytesRead);
+ free(tempBuffer);
+ }
+
+ // Read bytes.
+ if (mStreamBuffer.read((void*)data, offset, length)) {
+ return piex::Error::kOk;
+ } else {
+ return piex::Error::kFail;
+ }
+}
+
+FileStream::FileStream(const int fd)
+ : mPosition(0) {
+ mFile = fdopen(fd, "r");
+ if (mFile == NULL) {
+ return;
+ }
+}
+
+FileStream::FileStream(const String8 filename)
+ : mPosition(0) {
+ mFile = fopen(filename.string(), "r");
+ if (mFile == NULL) {
+ return;
+ }
+}
+
+FileStream::~FileStream() {
+ if (mFile != NULL) {
+ fclose(mFile);
+ mFile = NULL;
+ }
+}
+
+piex::Error FileStream::GetData(
+ const size_t offset, const size_t length, std::uint8_t* data) {
+ if (mFile == NULL) {
+ return piex::Error::kFail;
+ }
+
+ // Seek first.
+ if (mPosition != offset) {
+ fseek(mFile, offset, SEEK_SET);
+ }
+
+ // Read bytes.
+ size_t size = fread((void*)data, sizeof(std::uint8_t), length, mFile);
+ mPosition += size;
+
+ // Handle errors and verify the size.
+ if (ferror(mFile) || size != length) {
+ ALOGV("GetData read failed: (offset: %zu, length: %zu)", offset, length);
+ return piex::Error::kFail;
+ }
+ return piex::Error::kOk;
+}
+
+bool FileStream::exists() const {
+ return mFile != NULL;
+}
+
+bool GetExifFromRawImage(
+ piex::StreamInterface* stream, const String8& filename,
+ piex::PreviewImageData& image_data) {
+ // Reset the PreviewImageData to its default.
+ image_data = piex::PreviewImageData();
+
+ if (!piex::IsRaw(stream)) {
+ // Format not supported.
+ ALOGV("Format not supported: %s", filename.string());
+ return false;
+ }
+
+ piex::Error err = piex::GetPreviewImageData(stream, &image_data);
+
+ if (err != piex::Error::kOk) {
+ // The input data seems to be broken.
+ ALOGV("Raw image not detected: %s (piex error code: %d)", filename.string(), (int32_t)err);
+ return false;
+ }
+
+ return true;
+}
+
+bool ConvertKeyValueArraysToKeyedVector(
+ JNIEnv *env, jobjectArray keys, jobjectArray values,
+ KeyedVector<String8, String8>* keyedVector) {
+
+ int nKeyValuePairs = 0;
+ bool failed = false;
+ if (keys != NULL && values != NULL) {
+ nKeyValuePairs = env->GetArrayLength(keys);
+ failed = (nKeyValuePairs != env->GetArrayLength(values));
+ }
+
+ if (!failed) {
+ failed = ((keys != NULL && values == NULL) ||
+ (keys == NULL && values != NULL));
+ }
+
+ if (failed) {
+ ALOGE("keys and values arrays have different length");
+ jniThrowException(env, "java/lang/IllegalArgumentException", NULL);
+ return false;
+ }
+
+ for (int i = 0; i < nKeyValuePairs; ++i) {
+ // No need to check on the ArrayIndexOutOfBoundsException, since
+ // it won't happen here.
+ jstring key = (jstring) env->GetObjectArrayElement(keys, i);
+ jstring value = (jstring) env->GetObjectArrayElement(values, i);
+
+ const char* keyStr = env->GetStringUTFChars(key, NULL);
+ if (!keyStr) { // OutOfMemoryError
+ return false;
+ }
+
+ const char* valueStr = env->GetStringUTFChars(value, NULL);
+ if (!valueStr) { // OutOfMemoryError
+ env->ReleaseStringUTFChars(key, keyStr);
+ return false;
+ }
+
+ keyedVector->add(String8(keyStr), String8(valueStr));
+
+ env->ReleaseStringUTFChars(key, keyStr);
+ env->ReleaseStringUTFChars(value, valueStr);
+ env->DeleteLocalRef(key);
+ env->DeleteLocalRef(value);
+ }
+ return true;
+}
+
+static jobject makeIntegerObject(JNIEnv *env, int32_t value) {
+ ScopedLocalRef<jclass> clazz(env, env->FindClass("java/lang/Integer"));
+ CHECK(clazz.get() != NULL);
+
+ jmethodID integerConstructID =
+ env->GetMethodID(clazz.get(), "<init>", "(I)V");
+ CHECK(integerConstructID != NULL);
+
+ return env->NewObject(clazz.get(), integerConstructID, value);
+}
+
+static jobject makeLongObject(JNIEnv *env, int64_t value) {
+ ScopedLocalRef<jclass> clazz(env, env->FindClass("java/lang/Long"));
+ CHECK(clazz.get() != NULL);
+
+ jmethodID longConstructID = env->GetMethodID(clazz.get(), "<init>", "(J)V");
+ CHECK(longConstructID != NULL);
+
+ return env->NewObject(clazz.get(), longConstructID, value);
+}
+
+static jobject makeFloatObject(JNIEnv *env, float value) {
+ ScopedLocalRef<jclass> clazz(env, env->FindClass("java/lang/Float"));
+ CHECK(clazz.get() != NULL);
+
+ jmethodID floatConstructID =
+ env->GetMethodID(clazz.get(), "<init>", "(F)V");
+ CHECK(floatConstructID != NULL);
+
+ return env->NewObject(clazz.get(), floatConstructID, value);
+}
+
+static jobject makeByteBufferObject(
+ JNIEnv *env, const void *data, size_t size) {
+ jbyteArray byteArrayObj = env->NewByteArray(size);
+ env->SetByteArrayRegion(byteArrayObj, 0, size, (const jbyte *)data);
+
+ ScopedLocalRef<jclass> clazz(env, env->FindClass("java/nio/ByteBuffer"));
+ CHECK(clazz.get() != NULL);
+
+ jmethodID byteBufWrapID =
+ env->GetStaticMethodID(
+ clazz.get(), "wrap", "([B)Ljava/nio/ByteBuffer;");
+ CHECK(byteBufWrapID != NULL);
+
+ jobject byteBufObj = env->CallStaticObjectMethod(
+ clazz.get(), byteBufWrapID, byteArrayObj);
+
+ env->DeleteLocalRef(byteArrayObj); byteArrayObj = NULL;
+
+ return byteBufObj;
+}
+
+static void SetMapInt32(
+ JNIEnv *env, jobject hashMapObj, jmethodID hashMapPutID,
+ const char *key, int32_t value) {
+ jstring keyObj = env->NewStringUTF(key);
+ jobject valueObj = makeIntegerObject(env, value);
+
+ env->CallObjectMethod(hashMapObj, hashMapPutID, keyObj, valueObj);
+
+ env->DeleteLocalRef(valueObj); valueObj = NULL;
+ env->DeleteLocalRef(keyObj); keyObj = NULL;
+}
+
+status_t ConvertMessageToMap(
+ JNIEnv *env, const sp<AMessage> &msg, jobject *map) {
+ ScopedLocalRef<jclass> hashMapClazz(
+ env, env->FindClass("java/util/HashMap"));
+
+ if (hashMapClazz.get() == NULL) {
+ return -EINVAL;
+ }
+
+ jmethodID hashMapConstructID =
+ env->GetMethodID(hashMapClazz.get(), "<init>", "()V");
+
+ if (hashMapConstructID == NULL) {
+ return -EINVAL;
+ }
+
+ jmethodID hashMapPutID =
+ env->GetMethodID(
+ hashMapClazz.get(),
+ "put",
+ "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;");
+
+ if (hashMapPutID == NULL) {
+ return -EINVAL;
+ }
+
+ jobject hashMap = env->NewObject(hashMapClazz.get(), hashMapConstructID);
+
+ for (size_t i = 0; i < msg->countEntries(); ++i) {
+ AMessage::Type valueType;
+ const char *key = msg->getEntryNameAt(i, &valueType);
+
+ if (!strncmp(key, "android._", 9)) {
+ // don't expose private keys (starting with android._)
+ continue;
+ }
+
+ jobject valueObj = NULL;
+
+ switch (valueType) {
+ case AMessage::kTypeInt32:
+ {
+ int32_t val;
+ CHECK(msg->findInt32(key, &val));
+
+ valueObj = makeIntegerObject(env, val);
+ break;
+ }
+
+ case AMessage::kTypeInt64:
+ {
+ int64_t val;
+ CHECK(msg->findInt64(key, &val));
+
+ valueObj = makeLongObject(env, val);
+ break;
+ }
+
+ case AMessage::kTypeFloat:
+ {
+ float val;
+ CHECK(msg->findFloat(key, &val));
+
+ valueObj = makeFloatObject(env, val);
+ break;
+ }
+
+ case AMessage::kTypeString:
+ {
+ AString val;
+ CHECK(msg->findString(key, &val));
+
+ valueObj = env->NewStringUTF(val.c_str());
+ break;
+ }
+
+ case AMessage::kTypeBuffer:
+ {
+ sp<ABuffer> buffer;
+ CHECK(msg->findBuffer(key, &buffer));
+
+ valueObj = makeByteBufferObject(
+ env, buffer->data(), buffer->size());
+ break;
+ }
+
+ case AMessage::kTypeRect:
+ {
+ int32_t left, top, right, bottom;
+ CHECK(msg->findRect(key, &left, &top, &right, &bottom));
+
+ SetMapInt32(
+ env,
+ hashMap,
+ hashMapPutID,
+ AStringPrintf("%s-left", key).c_str(),
+ left);
+
+ SetMapInt32(
+ env,
+ hashMap,
+ hashMapPutID,
+ AStringPrintf("%s-top", key).c_str(),
+ top);
+
+ SetMapInt32(
+ env,
+ hashMap,
+ hashMapPutID,
+ AStringPrintf("%s-right", key).c_str(),
+ right);
+
+ SetMapInt32(
+ env,
+ hashMap,
+ hashMapPutID,
+ AStringPrintf("%s-bottom", key).c_str(),
+ bottom);
+ break;
+ }
+
+ default:
+ break;
+ }
+
+ if (valueObj != NULL) {
+ jstring keyObj = env->NewStringUTF(key);
+
+ env->CallObjectMethod(hashMap, hashMapPutID, keyObj, valueObj);
+
+ env->DeleteLocalRef(keyObj); keyObj = NULL;
+ env->DeleteLocalRef(valueObj); valueObj = NULL;
+ }
+ }
+
+ *map = hashMap;
+
+ return OK;
+}
+
+status_t ConvertKeyValueArraysToMessage(
+ JNIEnv *env, jobjectArray keys, jobjectArray values,
+ sp<AMessage> *out) {
+ ScopedLocalRef<jclass> stringClass(env, env->FindClass("java/lang/String"));
+ CHECK(stringClass.get() != NULL);
+ ScopedLocalRef<jclass> integerClass(env, env->FindClass("java/lang/Integer"));
+ CHECK(integerClass.get() != NULL);
+ ScopedLocalRef<jclass> longClass(env, env->FindClass("java/lang/Long"));
+ CHECK(longClass.get() != NULL);
+ ScopedLocalRef<jclass> floatClass(env, env->FindClass("java/lang/Float"));
+ CHECK(floatClass.get() != NULL);
+ ScopedLocalRef<jclass> byteBufClass(env, env->FindClass("java/nio/ByteBuffer"));
+ CHECK(byteBufClass.get() != NULL);
+
+ sp<AMessage> msg = new AMessage;
+
+ jsize numEntries = 0;
+
+ if (keys != NULL) {
+ if (values == NULL) {
+ return -EINVAL;
+ }
+
+ numEntries = env->GetArrayLength(keys);
+
+ if (numEntries != env->GetArrayLength(values)) {
+ return -EINVAL;
+ }
+ } else if (values != NULL) {
+ return -EINVAL;
+ }
+
+ for (jsize i = 0; i < numEntries; ++i) {
+ jobject keyObj = env->GetObjectArrayElement(keys, i);
+
+ if (!env->IsInstanceOf(keyObj, stringClass.get())) {
+ return -EINVAL;
+ }
+
+ const char *tmp = env->GetStringUTFChars((jstring)keyObj, NULL);
+
+ if (tmp == NULL) {
+ return -ENOMEM;
+ }
+
+ AString key = tmp;
+
+ env->ReleaseStringUTFChars((jstring)keyObj, tmp);
+ tmp = NULL;
+
+ if (key.startsWith("android._")) {
+ // don't propagate private keys (starting with android._)
+ continue;
+ }
+
+ jobject valueObj = env->GetObjectArrayElement(values, i);
+
+ if (env->IsInstanceOf(valueObj, stringClass.get())) {
+ const char *value = env->GetStringUTFChars((jstring)valueObj, NULL);
+
+ if (value == NULL) {
+ return -ENOMEM;
+ }
+
+ msg->setString(key.c_str(), value);
+
+ env->ReleaseStringUTFChars((jstring)valueObj, value);
+ value = NULL;
+ } else if (env->IsInstanceOf(valueObj, integerClass.get())) {
+ jmethodID intValueID =
+ env->GetMethodID(integerClass.get(), "intValue", "()I");
+ CHECK(intValueID != NULL);
+
+ jint value = env->CallIntMethod(valueObj, intValueID);
+
+ msg->setInt32(key.c_str(), value);
+ } else if (env->IsInstanceOf(valueObj, longClass.get())) {
+ jmethodID longValueID =
+ env->GetMethodID(longClass.get(), "longValue", "()J");
+ CHECK(longValueID != NULL);
+
+ jlong value = env->CallLongMethod(valueObj, longValueID);
+
+ msg->setInt64(key.c_str(), value);
+ } else if (env->IsInstanceOf(valueObj, floatClass.get())) {
+ jmethodID floatValueID =
+ env->GetMethodID(floatClass.get(), "floatValue", "()F");
+ CHECK(floatValueID != NULL);
+
+ jfloat value = env->CallFloatMethod(valueObj, floatValueID);
+
+ msg->setFloat(key.c_str(), value);
+ } else if (env->IsInstanceOf(valueObj, byteBufClass.get())) {
+ jmethodID positionID =
+ env->GetMethodID(byteBufClass.get(), "position", "()I");
+ CHECK(positionID != NULL);
+
+ jmethodID limitID =
+ env->GetMethodID(byteBufClass.get(), "limit", "()I");
+ CHECK(limitID != NULL);
+
+ jint position = env->CallIntMethod(valueObj, positionID);
+ jint limit = env->CallIntMethod(valueObj, limitID);
+
+ sp<ABuffer> buffer = new ABuffer(limit - position);
+
+ void *data = env->GetDirectBufferAddress(valueObj);
+
+ if (data != NULL) {
+ memcpy(buffer->data(),
+ (const uint8_t *)data + position,
+ buffer->size());
+ } else {
+ jmethodID arrayID =
+ env->GetMethodID(byteBufClass.get(), "array", "()[B");
+ CHECK(arrayID != NULL);
+
+ jbyteArray byteArray =
+ (jbyteArray)env->CallObjectMethod(valueObj, arrayID);
+ CHECK(byteArray != NULL);
+
+ env->GetByteArrayRegion(
+ byteArray,
+ position,
+ buffer->size(),
+ (jbyte *)buffer->data());
+
+ env->DeleteLocalRef(byteArray); byteArray = NULL;
+ }
+
+ msg->setBuffer(key.c_str(), buffer);
+ }
+ }
+
+ *out = msg;
+
+ return OK;
+}
+
+} // namespace android
+
diff --git a/media/jni/android_media_Streams.h b/media/jni/android_media_Streams.h
new file mode 100644
index 0000000..d174f9a
--- /dev/null
+++ b/media/jni/android_media_Streams.h
@@ -0,0 +1,116 @@
+/*
+ * Copyright 2019, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _ANDROID_MEDIA_STREAMS_H_
+#define _ANDROID_MEDIA_STREAMS_H_
+
+#include "src/piex_types.h"
+#include "src/piex.h"
+
+#include <jni.h>
+#include <nativehelper/JNIHelp.h>
+#include <utils/KeyedVector.h>
+#include <utils/String8.h>
+#include <utils/StrongPointer.h>
+#include <SkStream.h>
+
+
+namespace android {
+
+class AssetStream : public piex::StreamInterface {
+private:
+ SkStream *mStream;
+ size_t mPosition;
+
+public:
+ explicit AssetStream(SkStream* stream);
+ ~AssetStream();
+
+ // Reads 'length' amount of bytes from 'offset' to 'data'. The 'data' buffer
+ // provided by the caller, guaranteed to be at least "length" bytes long.
+ // On 'kOk' the 'data' pointer contains 'length' valid bytes beginning at
+ // 'offset' bytes from the start of the stream.
+ // Returns 'kFail' if 'offset' + 'length' exceeds the stream and does not
+ // change the contents of 'data'.
+ piex::Error GetData(
+ const size_t offset, const size_t length, std::uint8_t* data) override;
+};
+
+class BufferedStream : public piex::StreamInterface {
+private:
+ SkStream *mStream;
+ // Growable memory stream
+ SkDynamicMemoryWStream mStreamBuffer;
+
+ // Minimum size to read on filling the buffer.
+ const size_t kMinSizeToRead = 8192;
+
+public:
+ explicit BufferedStream(SkStream* stream);
+ ~BufferedStream();
+
+ // Reads 'length' amount of bytes from 'offset' to 'data'. The 'data' buffer
+ // provided by the caller, guaranteed to be at least "length" bytes long.
+ // On 'kOk' the 'data' pointer contains 'length' valid bytes beginning at
+ // 'offset' bytes from the start of the stream.
+ // Returns 'kFail' if 'offset' + 'length' exceeds the stream and does not
+ // change the contents of 'data'.
+ piex::Error GetData(
+ const size_t offset, const size_t length, std::uint8_t* data) override;
+};
+
+class FileStream : public piex::StreamInterface {
+private:
+ FILE *mFile;
+ size_t mPosition;
+
+public:
+ explicit FileStream(const int fd);
+ explicit FileStream(const String8 filename);
+ ~FileStream();
+
+ // Reads 'length' amount of bytes from 'offset' to 'data'. The 'data' buffer
+ // provided by the caller, guaranteed to be at least "length" bytes long.
+ // On 'kOk' the 'data' pointer contains 'length' valid bytes beginning at
+ // 'offset' bytes from the start of the stream.
+ // Returns 'kFail' if 'offset' + 'length' exceeds the stream and does not
+ // change the contents of 'data'.
+ piex::Error GetData(
+ const size_t offset, const size_t length, std::uint8_t* data) override;
+ bool exists() const;
+};
+
+// Reads EXIF metadata from a given raw image via piex.
+// And returns true if the operation is successful; otherwise, false.
+bool GetExifFromRawImage(
+ piex::StreamInterface* stream, const String8& filename, piex::PreviewImageData& image_data);
+
+// Returns true if the conversion is successful; otherwise, false.
+bool ConvertKeyValueArraysToKeyedVector(
+ JNIEnv *env, jobjectArray keys, jobjectArray values,
+ KeyedVector<String8, String8>* vector);
+
+struct AMessage;
+status_t ConvertMessageToMap(
+ JNIEnv *env, const sp<AMessage> &msg, jobject *map);
+
+status_t ConvertKeyValueArraysToMessage(
+ JNIEnv *env, jobjectArray keys, jobjectArray values,
+ sp<AMessage> *msg);
+
+}; // namespace android
+
+#endif // _ANDROID_MEDIA_STREAMS_H_
diff --git a/media/jni/android_media_Utils.cpp b/media/jni/android_media_Utils.cpp
index 458d847..8bdf534 100644
--- a/media/jni/android_media_Utils.cpp
+++ b/media/jni/android_media_Utils.cpp
@@ -21,543 +21,10 @@
#include <utils/Log.h>
#include "android_media_Utils.h"
-#include <media/stagefright/foundation/ADebug.h>
-#include <media/stagefright/foundation/ABuffer.h>
-#include <media/stagefright/foundation/AMessage.h>
-
-#include <nativehelper/ScopedLocalRef.h>
-
#define ALIGN(x, mask) ( ((x) + (mask) - 1) & ~((mask) - 1) )
namespace android {
-AssetStream::AssetStream(SkStream* stream)
- : mStream(stream), mPosition(0) {
-}
-
-AssetStream::~AssetStream() {
-}
-
-piex::Error AssetStream::GetData(
- const size_t offset, const size_t length, std::uint8_t* data) {
- // Seek first.
- if (mPosition != offset) {
- if (!mStream->seek(offset)) {
- return piex::Error::kFail;
- }
- }
-
- // Read bytes.
- size_t size = mStream->read((void*)data, length);
- mPosition = offset + size;
-
- return size == length ? piex::Error::kOk : piex::Error::kFail;
-}
-
-BufferedStream::BufferedStream(SkStream* stream)
- : mStream(stream) {
-}
-
-BufferedStream::~BufferedStream() {
-}
-
-piex::Error BufferedStream::GetData(
- const size_t offset, const size_t length, std::uint8_t* data) {
- // Seek first.
- if (offset + length > mStreamBuffer.bytesWritten()) {
- size_t sizeToRead = offset + length - mStreamBuffer.bytesWritten();
- if (sizeToRead <= kMinSizeToRead) {
- sizeToRead = kMinSizeToRead;
- }
-
- void* tempBuffer = malloc(sizeToRead);
- if (tempBuffer == NULL) {
- return piex::Error::kFail;
- }
-
- size_t bytesRead = mStream->read(tempBuffer, sizeToRead);
- if (bytesRead != sizeToRead) {
- free(tempBuffer);
- return piex::Error::kFail;
- }
- mStreamBuffer.write(tempBuffer, bytesRead);
- free(tempBuffer);
- }
-
- // Read bytes.
- if (mStreamBuffer.read((void*)data, offset, length)) {
- return piex::Error::kOk;
- } else {
- return piex::Error::kFail;
- }
-}
-
-FileStream::FileStream(const int fd)
- : mPosition(0) {
- mFile = fdopen(fd, "r");
- if (mFile == NULL) {
- return;
- }
-}
-
-FileStream::FileStream(const String8 filename)
- : mPosition(0) {
- mFile = fopen(filename.string(), "r");
- if (mFile == NULL) {
- return;
- }
-}
-
-FileStream::~FileStream() {
- if (mFile != NULL) {
- fclose(mFile);
- mFile = NULL;
- }
-}
-
-piex::Error FileStream::GetData(
- const size_t offset, const size_t length, std::uint8_t* data) {
- if (mFile == NULL) {
- return piex::Error::kFail;
- }
-
- // Seek first.
- if (mPosition != offset) {
- fseek(mFile, offset, SEEK_SET);
- }
-
- // Read bytes.
- size_t size = fread((void*)data, sizeof(std::uint8_t), length, mFile);
- mPosition += size;
-
- // Handle errors and verify the size.
- if (ferror(mFile) || size != length) {
- ALOGV("GetData read failed: (offset: %zu, length: %zu)", offset, length);
- return piex::Error::kFail;
- }
- return piex::Error::kOk;
-}
-
-bool FileStream::exists() const {
- return mFile != NULL;
-}
-
-bool GetExifFromRawImage(
- piex::StreamInterface* stream, const String8& filename,
- piex::PreviewImageData& image_data) {
- // Reset the PreviewImageData to its default.
- image_data = piex::PreviewImageData();
-
- if (!piex::IsRaw(stream)) {
- // Format not supported.
- ALOGV("Format not supported: %s", filename.string());
- return false;
- }
-
- piex::Error err = piex::GetPreviewImageData(stream, &image_data);
-
- if (err != piex::Error::kOk) {
- // The input data seems to be broken.
- ALOGV("Raw image not detected: %s (piex error code: %d)", filename.string(), (int32_t)err);
- return false;
- }
-
- return true;
-}
-
-bool ConvertKeyValueArraysToKeyedVector(
- JNIEnv *env, jobjectArray keys, jobjectArray values,
- KeyedVector<String8, String8>* keyedVector) {
-
- int nKeyValuePairs = 0;
- bool failed = false;
- if (keys != NULL && values != NULL) {
- nKeyValuePairs = env->GetArrayLength(keys);
- failed = (nKeyValuePairs != env->GetArrayLength(values));
- }
-
- if (!failed) {
- failed = ((keys != NULL && values == NULL) ||
- (keys == NULL && values != NULL));
- }
-
- if (failed) {
- ALOGE("keys and values arrays have different length");
- jniThrowException(env, "java/lang/IllegalArgumentException", NULL);
- return false;
- }
-
- for (int i = 0; i < nKeyValuePairs; ++i) {
- // No need to check on the ArrayIndexOutOfBoundsException, since
- // it won't happen here.
- jstring key = (jstring) env->GetObjectArrayElement(keys, i);
- jstring value = (jstring) env->GetObjectArrayElement(values, i);
-
- const char* keyStr = env->GetStringUTFChars(key, NULL);
- if (!keyStr) { // OutOfMemoryError
- return false;
- }
-
- const char* valueStr = env->GetStringUTFChars(value, NULL);
- if (!valueStr) { // OutOfMemoryError
- env->ReleaseStringUTFChars(key, keyStr);
- return false;
- }
-
- keyedVector->add(String8(keyStr), String8(valueStr));
-
- env->ReleaseStringUTFChars(key, keyStr);
- env->ReleaseStringUTFChars(value, valueStr);
- env->DeleteLocalRef(key);
- env->DeleteLocalRef(value);
- }
- return true;
-}
-
-static jobject makeIntegerObject(JNIEnv *env, int32_t value) {
- ScopedLocalRef<jclass> clazz(env, env->FindClass("java/lang/Integer"));
- CHECK(clazz.get() != NULL);
-
- jmethodID integerConstructID =
- env->GetMethodID(clazz.get(), "<init>", "(I)V");
- CHECK(integerConstructID != NULL);
-
- return env->NewObject(clazz.get(), integerConstructID, value);
-}
-
-static jobject makeLongObject(JNIEnv *env, int64_t value) {
- ScopedLocalRef<jclass> clazz(env, env->FindClass("java/lang/Long"));
- CHECK(clazz.get() != NULL);
-
- jmethodID longConstructID = env->GetMethodID(clazz.get(), "<init>", "(J)V");
- CHECK(longConstructID != NULL);
-
- return env->NewObject(clazz.get(), longConstructID, value);
-}
-
-static jobject makeFloatObject(JNIEnv *env, float value) {
- ScopedLocalRef<jclass> clazz(env, env->FindClass("java/lang/Float"));
- CHECK(clazz.get() != NULL);
-
- jmethodID floatConstructID =
- env->GetMethodID(clazz.get(), "<init>", "(F)V");
- CHECK(floatConstructID != NULL);
-
- return env->NewObject(clazz.get(), floatConstructID, value);
-}
-
-static jobject makeByteBufferObject(
- JNIEnv *env, const void *data, size_t size) {
- jbyteArray byteArrayObj = env->NewByteArray(size);
- env->SetByteArrayRegion(byteArrayObj, 0, size, (const jbyte *)data);
-
- ScopedLocalRef<jclass> clazz(env, env->FindClass("java/nio/ByteBuffer"));
- CHECK(clazz.get() != NULL);
-
- jmethodID byteBufWrapID =
- env->GetStaticMethodID(
- clazz.get(), "wrap", "([B)Ljava/nio/ByteBuffer;");
- CHECK(byteBufWrapID != NULL);
-
- jobject byteBufObj = env->CallStaticObjectMethod(
- clazz.get(), byteBufWrapID, byteArrayObj);
-
- env->DeleteLocalRef(byteArrayObj); byteArrayObj = NULL;
-
- return byteBufObj;
-}
-
-static void SetMapInt32(
- JNIEnv *env, jobject hashMapObj, jmethodID hashMapPutID,
- const char *key, int32_t value) {
- jstring keyObj = env->NewStringUTF(key);
- jobject valueObj = makeIntegerObject(env, value);
-
- env->CallObjectMethod(hashMapObj, hashMapPutID, keyObj, valueObj);
-
- env->DeleteLocalRef(valueObj); valueObj = NULL;
- env->DeleteLocalRef(keyObj); keyObj = NULL;
-}
-
-status_t ConvertMessageToMap(
- JNIEnv *env, const sp<AMessage> &msg, jobject *map) {
- ScopedLocalRef<jclass> hashMapClazz(
- env, env->FindClass("java/util/HashMap"));
-
- if (hashMapClazz.get() == NULL) {
- return -EINVAL;
- }
-
- jmethodID hashMapConstructID =
- env->GetMethodID(hashMapClazz.get(), "<init>", "()V");
-
- if (hashMapConstructID == NULL) {
- return -EINVAL;
- }
-
- jmethodID hashMapPutID =
- env->GetMethodID(
- hashMapClazz.get(),
- "put",
- "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;");
-
- if (hashMapPutID == NULL) {
- return -EINVAL;
- }
-
- jobject hashMap = env->NewObject(hashMapClazz.get(), hashMapConstructID);
-
- for (size_t i = 0; i < msg->countEntries(); ++i) {
- AMessage::Type valueType;
- const char *key = msg->getEntryNameAt(i, &valueType);
-
- if (!strncmp(key, "android._", 9)) {
- // don't expose private keys (starting with android._)
- continue;
- }
-
- jobject valueObj = NULL;
-
- switch (valueType) {
- case AMessage::kTypeInt32:
- {
- int32_t val;
- CHECK(msg->findInt32(key, &val));
-
- valueObj = makeIntegerObject(env, val);
- break;
- }
-
- case AMessage::kTypeInt64:
- {
- int64_t val;
- CHECK(msg->findInt64(key, &val));
-
- valueObj = makeLongObject(env, val);
- break;
- }
-
- case AMessage::kTypeFloat:
- {
- float val;
- CHECK(msg->findFloat(key, &val));
-
- valueObj = makeFloatObject(env, val);
- break;
- }
-
- case AMessage::kTypeString:
- {
- AString val;
- CHECK(msg->findString(key, &val));
-
- valueObj = env->NewStringUTF(val.c_str());
- break;
- }
-
- case AMessage::kTypeBuffer:
- {
- sp<ABuffer> buffer;
- CHECK(msg->findBuffer(key, &buffer));
-
- valueObj = makeByteBufferObject(
- env, buffer->data(), buffer->size());
- break;
- }
-
- case AMessage::kTypeRect:
- {
- int32_t left, top, right, bottom;
- CHECK(msg->findRect(key, &left, &top, &right, &bottom));
-
- SetMapInt32(
- env,
- hashMap,
- hashMapPutID,
- AStringPrintf("%s-left", key).c_str(),
- left);
-
- SetMapInt32(
- env,
- hashMap,
- hashMapPutID,
- AStringPrintf("%s-top", key).c_str(),
- top);
-
- SetMapInt32(
- env,
- hashMap,
- hashMapPutID,
- AStringPrintf("%s-right", key).c_str(),
- right);
-
- SetMapInt32(
- env,
- hashMap,
- hashMapPutID,
- AStringPrintf("%s-bottom", key).c_str(),
- bottom);
- break;
- }
-
- default:
- break;
- }
-
- if (valueObj != NULL) {
- jstring keyObj = env->NewStringUTF(key);
-
- env->CallObjectMethod(hashMap, hashMapPutID, keyObj, valueObj);
-
- env->DeleteLocalRef(keyObj); keyObj = NULL;
- env->DeleteLocalRef(valueObj); valueObj = NULL;
- }
- }
-
- *map = hashMap;
-
- return OK;
-}
-
-status_t ConvertKeyValueArraysToMessage(
- JNIEnv *env, jobjectArray keys, jobjectArray values,
- sp<AMessage> *out) {
- ScopedLocalRef<jclass> stringClass(env, env->FindClass("java/lang/String"));
- CHECK(stringClass.get() != NULL);
- ScopedLocalRef<jclass> integerClass(env, env->FindClass("java/lang/Integer"));
- CHECK(integerClass.get() != NULL);
- ScopedLocalRef<jclass> longClass(env, env->FindClass("java/lang/Long"));
- CHECK(longClass.get() != NULL);
- ScopedLocalRef<jclass> floatClass(env, env->FindClass("java/lang/Float"));
- CHECK(floatClass.get() != NULL);
- ScopedLocalRef<jclass> byteBufClass(env, env->FindClass("java/nio/ByteBuffer"));
- CHECK(byteBufClass.get() != NULL);
-
- sp<AMessage> msg = new AMessage;
-
- jsize numEntries = 0;
-
- if (keys != NULL) {
- if (values == NULL) {
- return -EINVAL;
- }
-
- numEntries = env->GetArrayLength(keys);
-
- if (numEntries != env->GetArrayLength(values)) {
- return -EINVAL;
- }
- } else if (values != NULL) {
- return -EINVAL;
- }
-
- for (jsize i = 0; i < numEntries; ++i) {
- jobject keyObj = env->GetObjectArrayElement(keys, i);
-
- if (!env->IsInstanceOf(keyObj, stringClass.get())) {
- return -EINVAL;
- }
-
- const char *tmp = env->GetStringUTFChars((jstring)keyObj, NULL);
-
- if (tmp == NULL) {
- return -ENOMEM;
- }
-
- AString key = tmp;
-
- env->ReleaseStringUTFChars((jstring)keyObj, tmp);
- tmp = NULL;
-
- if (key.startsWith("android._")) {
- // don't propagate private keys (starting with android._)
- continue;
- }
-
- jobject valueObj = env->GetObjectArrayElement(values, i);
-
- if (env->IsInstanceOf(valueObj, stringClass.get())) {
- const char *value = env->GetStringUTFChars((jstring)valueObj, NULL);
-
- if (value == NULL) {
- return -ENOMEM;
- }
-
- msg->setString(key.c_str(), value);
-
- env->ReleaseStringUTFChars((jstring)valueObj, value);
- value = NULL;
- } else if (env->IsInstanceOf(valueObj, integerClass.get())) {
- jmethodID intValueID =
- env->GetMethodID(integerClass.get(), "intValue", "()I");
- CHECK(intValueID != NULL);
-
- jint value = env->CallIntMethod(valueObj, intValueID);
-
- msg->setInt32(key.c_str(), value);
- } else if (env->IsInstanceOf(valueObj, longClass.get())) {
- jmethodID longValueID =
- env->GetMethodID(longClass.get(), "longValue", "()J");
- CHECK(longValueID != NULL);
-
- jlong value = env->CallLongMethod(valueObj, longValueID);
-
- msg->setInt64(key.c_str(), value);
- } else if (env->IsInstanceOf(valueObj, floatClass.get())) {
- jmethodID floatValueID =
- env->GetMethodID(floatClass.get(), "floatValue", "()F");
- CHECK(floatValueID != NULL);
-
- jfloat value = env->CallFloatMethod(valueObj, floatValueID);
-
- msg->setFloat(key.c_str(), value);
- } else if (env->IsInstanceOf(valueObj, byteBufClass.get())) {
- jmethodID positionID =
- env->GetMethodID(byteBufClass.get(), "position", "()I");
- CHECK(positionID != NULL);
-
- jmethodID limitID =
- env->GetMethodID(byteBufClass.get(), "limit", "()I");
- CHECK(limitID != NULL);
-
- jint position = env->CallIntMethod(valueObj, positionID);
- jint limit = env->CallIntMethod(valueObj, limitID);
-
- sp<ABuffer> buffer = new ABuffer(limit - position);
-
- void *data = env->GetDirectBufferAddress(valueObj);
-
- if (data != NULL) {
- memcpy(buffer->data(),
- (const uint8_t *)data + position,
- buffer->size());
- } else {
- jmethodID arrayID =
- env->GetMethodID(byteBufClass.get(), "array", "()[B");
- CHECK(arrayID != NULL);
-
- jbyteArray byteArray =
- (jbyteArray)env->CallObjectMethod(valueObj, arrayID);
- CHECK(byteArray != NULL);
-
- env->GetByteArrayRegion(
- byteArray,
- position,
- buffer->size(),
- (jbyte *)buffer->data());
-
- env->DeleteLocalRef(byteArray); byteArray = NULL;
- }
-
- msg->setBuffer(key.c_str(), buffer);
- }
- }
-
- *out = msg;
-
- return OK;
-}
-
// -----------Utility functions used by ImageReader/Writer JNI-----------------
enum {
diff --git a/media/jni/android_media_Utils.h b/media/jni/android_media_Utils.h
index 821c6b2..24f1610 100644
--- a/media/jni/android_media_Utils.h
+++ b/media/jni/android_media_Utils.h
@@ -17,100 +17,10 @@
#ifndef _ANDROID_MEDIA_UTILS_H_
#define _ANDROID_MEDIA_UTILS_H_
-#include "src/piex_types.h"
-#include "src/piex.h"
-
-#include <android_runtime/AndroidRuntime.h>
#include <gui/CpuConsumer.h>
-#include <jni.h>
-#include <nativehelper/JNIHelp.h>
-#include <utils/KeyedVector.h>
-#include <utils/String8.h>
-#include <SkStream.h>
namespace android {
-class AssetStream : public piex::StreamInterface {
-private:
- SkStream *mStream;
- size_t mPosition;
-
-public:
- explicit AssetStream(SkStream* stream);
- ~AssetStream();
-
- // Reads 'length' amount of bytes from 'offset' to 'data'. The 'data' buffer
- // provided by the caller, guaranteed to be at least "length" bytes long.
- // On 'kOk' the 'data' pointer contains 'length' valid bytes beginning at
- // 'offset' bytes from the start of the stream.
- // Returns 'kFail' if 'offset' + 'length' exceeds the stream and does not
- // change the contents of 'data'.
- piex::Error GetData(
- const size_t offset, const size_t length, std::uint8_t* data) override;
-};
-
-class BufferedStream : public piex::StreamInterface {
-private:
- SkStream *mStream;
- // Growable memory stream
- SkDynamicMemoryWStream mStreamBuffer;
-
- // Minimum size to read on filling the buffer.
- const size_t kMinSizeToRead = 8192;
-
-public:
- explicit BufferedStream(SkStream* stream);
- ~BufferedStream();
-
- // Reads 'length' amount of bytes from 'offset' to 'data'. The 'data' buffer
- // provided by the caller, guaranteed to be at least "length" bytes long.
- // On 'kOk' the 'data' pointer contains 'length' valid bytes beginning at
- // 'offset' bytes from the start of the stream.
- // Returns 'kFail' if 'offset' + 'length' exceeds the stream and does not
- // change the contents of 'data'.
- piex::Error GetData(
- const size_t offset, const size_t length, std::uint8_t* data) override;
-};
-
-class FileStream : public piex::StreamInterface {
-private:
- FILE *mFile;
- size_t mPosition;
-
-public:
- explicit FileStream(const int fd);
- explicit FileStream(const String8 filename);
- ~FileStream();
-
- // Reads 'length' amount of bytes from 'offset' to 'data'. The 'data' buffer
- // provided by the caller, guaranteed to be at least "length" bytes long.
- // On 'kOk' the 'data' pointer contains 'length' valid bytes beginning at
- // 'offset' bytes from the start of the stream.
- // Returns 'kFail' if 'offset' + 'length' exceeds the stream and does not
- // change the contents of 'data'.
- piex::Error GetData(
- const size_t offset, const size_t length, std::uint8_t* data) override;
- bool exists() const;
-};
-
-// Reads EXIF metadata from a given raw image via piex.
-// And returns true if the operation is successful; otherwise, false.
-bool GetExifFromRawImage(
- piex::StreamInterface* stream, const String8& filename, piex::PreviewImageData& image_data);
-
-// Returns true if the conversion is successful; otherwise, false.
-bool ConvertKeyValueArraysToKeyedVector(
- JNIEnv *env, jobjectArray keys, jobjectArray values,
- KeyedVector<String8, String8>* vector);
-
-struct AMessage;
-status_t ConvertMessageToMap(
- JNIEnv *env, const sp<AMessage> &msg, jobject *map);
-
-status_t ConvertKeyValueArraysToMessage(
- JNIEnv *env, jobjectArray keys, jobjectArray values,
- sp<AMessage> *msg);
-
// -----------Utility functions used by ImageReader/Writer JNI-----------------
typedef CpuConsumer::LockedBuffer LockedImage;
diff --git a/media/jni/android_mtp_MtpDatabase.cpp b/media/jni/android_mtp_MtpDatabase.cpp
index 213c3d9..a6c5fc8 100644
--- a/media/jni/android_mtp_MtpDatabase.cpp
+++ b/media/jni/android_mtp_MtpDatabase.cpp
@@ -18,7 +18,7 @@
#include "utils/Log.h"
#include "utils/String8.h"
-#include "android_media_Utils.h"
+#include "android_media_Streams.h"
#include "mtp.h"
#include "IMtpDatabase.h"
#include "MtpDataPacket.h"
diff --git a/native/android/OWNERS b/native/android/OWNERS
index b3f50aa..266764a 100644
--- a/native/android/OWNERS
+++ b/native/android/OWNERS
@@ -1,4 +1,4 @@
set noparent
-per-file libandroid_net.map.txt, net.c = codewiz@google.com, ek@google.com, jchalard@google.com
+per-file libandroid_net.map.txt, net.c = codewiz@google.com, jchalard@google.com, junyulai@google.com
per-file libandroid_net.map.txt, net.c = lorenzo@google.com, reminv@google.com, satk@google.com
diff --git a/packages/CaptivePortalLogin/Android.bp b/packages/CaptivePortalLogin/Android.bp
index 9c31b4d..f545a61 100644
--- a/packages/CaptivePortalLogin/Android.bp
+++ b/packages/CaptivePortalLogin/Android.bp
@@ -18,6 +18,7 @@
name: "CaptivePortalLogin",
srcs: ["src/**/*.java"],
sdk_version: "system_current",
+ min_sdk_version: "28",
certificate: "networkstack",
static_libs: [
"android-support-v4",
diff --git a/packages/CaptivePortalLogin/AndroidManifest.xml b/packages/CaptivePortalLogin/AndroidManifest.xml
index 2a43238..44e0a65 100644
--- a/packages/CaptivePortalLogin/AndroidManifest.xml
+++ b/packages/CaptivePortalLogin/AndroidManifest.xml
@@ -18,9 +18,10 @@
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.captiveportallogin"
- android:versionCode="10"
+ android:versionCode="11"
android:versionName="Q-initial">
+ <uses-sdk android:minSdkVersion="28" android:targetSdkVersion="28" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
diff --git a/packages/CaptivePortalLogin/OWNERS b/packages/CaptivePortalLogin/OWNERS
index 7311eee..d3836d4 100644
--- a/packages/CaptivePortalLogin/OWNERS
+++ b/packages/CaptivePortalLogin/OWNERS
@@ -1,8 +1,8 @@
set noparent
codewiz@google.com
-ek@google.com
jchalard@google.com
+junyulai@google.com
lorenzo@google.com
reminv@google.com
satk@google.com
diff --git a/packages/ExtServices/tests/Android.mk b/packages/ExtServices/tests/Android.mk
index 0a95b85..36e573a 100644
--- a/packages/ExtServices/tests/Android.mk
+++ b/packages/ExtServices/tests/Android.mk
@@ -8,9 +8,9 @@
LOCAL_JAVA_LIBRARIES := android.test.runner android.test.base
LOCAL_STATIC_JAVA_LIBRARIES := \
- android-support-test \
+ androidx.test.rules \
mockito-target-minus-junit4 \
- espresso-core \
+ androidx.test.espresso.core \
truth-prebuilt \
testables
diff --git a/packages/ExtServices/tests/AndroidManifest.xml b/packages/ExtServices/tests/AndroidManifest.xml
index ddf725b..42293b5 100644
--- a/packages/ExtServices/tests/AndroidManifest.xml
+++ b/packages/ExtServices/tests/AndroidManifest.xml
@@ -23,7 +23,7 @@
<uses-library android:name="android.test.runner" />
</application>
- <instrumentation android:name="android.support.test.runner.AndroidJUnitRunner"
+ <instrumentation android:name="androidx.test.runner.AndroidJUnitRunner"
android:targetPackage="android.ext.services"
android:label="ExtServices Test Cases">
</instrumentation>
diff --git a/packages/ExtServices/tests/AndroidTest.xml b/packages/ExtServices/tests/AndroidTest.xml
index c3d32de..cd26ebc 100644
--- a/packages/ExtServices/tests/AndroidTest.xml
+++ b/packages/ExtServices/tests/AndroidTest.xml
@@ -23,7 +23,7 @@
<option name="test-tag" value="ExtServicesUnitTests" />
<test class="com.android.tradefed.testtype.AndroidJUnitTest" >
<option name="package" value="android.ext.services.tests.unit" />
- <option name="runner" value="android.support.test.runner.AndroidJUnitRunner" />
+ <option name="runner" value="androidx.test.runner.AndroidJUnitRunner" />
<option name="hidden-api-checks" value="false"/>
</test>
</configuration>
\ No newline at end of file
diff --git a/packages/ExtServices/tests/src/android/ext/services/notification/AssistantTest.java b/packages/ExtServices/tests/src/android/ext/services/notification/AssistantTest.java
index a6b6a6b..6ef25e5 100644
--- a/packages/ExtServices/tests/src/android/ext/services/notification/AssistantTest.java
+++ b/packages/ExtServices/tests/src/android/ext/services/notification/AssistantTest.java
@@ -21,6 +21,7 @@
import static android.app.NotificationManager.IMPORTANCE_MIN;
import static junit.framework.Assert.assertEquals;
+
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
@@ -33,7 +34,6 @@
import android.app.Notification;
import android.app.NotificationChannel;
import android.content.ContentResolver;
-import android.content.IContentProvider;
import android.content.Intent;
import android.os.UserHandle;
import android.provider.Settings;
@@ -43,11 +43,11 @@
import android.service.notification.NotificationListenerService.RankingMap;
import android.service.notification.NotificationStats;
import android.service.notification.StatusBarNotification;
-import android.support.test.InstrumentationRegistry;
import android.test.ServiceTestCase;
import android.testing.TestableContext;
import android.util.AtomicFile;
-import android.util.Xml;
+
+import androidx.test.InstrumentationRegistry;
import com.android.internal.util.FastXmlSerializer;
@@ -57,7 +57,6 @@
import org.mockito.ArgumentCaptor;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
-import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlSerializer;
import java.io.BufferedInputStream;
diff --git a/packages/NetworkStack/Android.bp b/packages/NetworkStack/Android.bp
index 5f1f26d..f210840 100644
--- a/packages/NetworkStack/Android.bp
+++ b/packages/NetworkStack/Android.bp
@@ -36,6 +36,7 @@
android_app {
name: "NetworkStack",
sdk_version: "system_current",
+ min_sdk_version: "28",
certificate: "networkstack",
privileged: true,
static_libs: [
diff --git a/packages/NetworkStack/AndroidManifest.xml b/packages/NetworkStack/AndroidManifest.xml
index 90521de..003f1e5 100644
--- a/packages/NetworkStack/AndroidManifest.xml
+++ b/packages/NetworkStack/AndroidManifest.xml
@@ -19,8 +19,9 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.networkstack"
android:sharedUserId="android.uid.networkstack"
- android:versionCode="10"
+ android:versionCode="11"
android:versionName="Q-initial">
+ <uses-sdk android:minSdkVersion="28" android:targetSdkVersion="28" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
diff --git a/packages/NetworkStack/OWNERS b/packages/NetworkStack/OWNERS
index a395465..0e1e65d 100644
--- a/packages/NetworkStack/OWNERS
+++ b/packages/NetworkStack/OWNERS
@@ -1,5 +1,6 @@
codewiz@google.com
jchalard@google.com
+junyulai@google.com
lorenzo@google.com
reminv@google.com
satk@google.com
diff --git a/packages/NetworkStack/src/android/net/apf/ApfFilter.java b/packages/NetworkStack/src/android/net/apf/ApfFilter.java
index 923f162..3dd90ee 100644
--- a/packages/NetworkStack/src/android/net/apf/ApfFilter.java
+++ b/packages/NetworkStack/src/android/net/apf/ApfFilter.java
@@ -475,7 +475,7 @@
socket = Os.socket(AF_PACKET, SOCK_RAW, ETH_P_IPV6);
SocketAddress addr = makePacketSocketAddress(
(short) ETH_P_IPV6, mInterfaceParams.index);
- SocketUtils.bindSocket(socket, addr);
+ Os.bind(socket, addr);
SocketUtils.attachRaFilter(socket, mApfCapabilities.apfPacketFormat);
} catch(SocketException|ErrnoException e) {
Log.e(TAG, "Error starting filter", e);
diff --git a/packages/NetworkStack/src/android/net/dhcp/DhcpClient.java b/packages/NetworkStack/src/android/net/dhcp/DhcpClient.java
index b0e8da9..0b7809e 100644
--- a/packages/NetworkStack/src/android/net/dhcp/DhcpClient.java
+++ b/packages/NetworkStack/src/android/net/dhcp/DhcpClient.java
@@ -317,7 +317,7 @@
try {
mPacketSock = Os.socket(AF_PACKET, SOCK_RAW, ETH_P_IP);
SocketAddress addr = makePacketSocketAddress((short) ETH_P_IP, mIface.index);
- SocketUtils.bindSocket(mPacketSock, addr);
+ Os.bind(mPacketSock, addr);
SocketUtils.attachDhcpFilter(mPacketSock);
} catch(SocketException|ErrnoException e) {
Log.e(TAG, "Error creating packet socket", e);
@@ -412,8 +412,7 @@
try {
if (encap == DhcpPacket.ENCAP_L2) {
if (DBG) Log.d(TAG, "Broadcasting " + description);
- SocketUtils.sendTo(
- mPacketSock, buf.array(), 0, buf.limit(), 0, mInterfaceBroadcastAddr);
+ Os.sendto(mPacketSock, buf.array(), 0, buf.limit(), 0, mInterfaceBroadcastAddr);
} else if (encap == DhcpPacket.ENCAP_BOOTP && to.equals(INADDR_BROADCAST)) {
if (DBG) Log.d(TAG, "Broadcasting " + description);
// We only send L3-encapped broadcasts in DhcpRebindingState,
diff --git a/packages/NetworkStack/src/android/net/ip/ConnectivityPacketTracker.java b/packages/NetworkStack/src/android/net/ip/ConnectivityPacketTracker.java
index 649257a..de54824 100644
--- a/packages/NetworkStack/src/android/net/ip/ConnectivityPacketTracker.java
+++ b/packages/NetworkStack/src/android/net/ip/ConnectivityPacketTracker.java
@@ -104,8 +104,7 @@
try {
s = Os.socket(AF_PACKET, SOCK_RAW | SOCK_NONBLOCK, 0);
SocketUtils.attachControlPacketFilter(s, ARPHRD_ETHER);
- SocketUtils.bindSocket(
- s, makePacketSocketAddress((short) ETH_P_ALL, mInterface.index));
+ Os.bind(s, makePacketSocketAddress((short) ETH_P_ALL, mInterface.index));
} catch (ErrnoException | IOException e) {
logError("Failed to create packet tracking socket: ", e);
closeFd(s);
diff --git a/packages/NetworkStack/src/android/net/ip/IpNeighborMonitor.java b/packages/NetworkStack/src/android/net/ip/IpNeighborMonitor.java
index b29d617..6ae9a2b 100644
--- a/packages/NetworkStack/src/android/net/ip/IpNeighborMonitor.java
+++ b/packages/NetworkStack/src/android/net/ip/IpNeighborMonitor.java
@@ -34,7 +34,6 @@
import android.net.util.NetworkStackUtils;
import android.net.util.PacketReader;
import android.net.util.SharedLog;
-import android.net.util.SocketUtils;
import android.os.Handler;
import android.os.SystemClock;
import android.system.ErrnoException;
@@ -150,7 +149,7 @@
try {
fd = Os.socket(AF_NETLINK, SOCK_DGRAM | SOCK_NONBLOCK, NETLINK_ROUTE);
- SocketUtils.bindSocket(fd, makeNetlinkSocketAddress(0, OsConstants.RTMGRP_NEIGH));
+ Os.bind(fd, makeNetlinkSocketAddress(0, OsConstants.RTMGRP_NEIGH));
NetlinkSocket.connectToKernel(fd);
if (VDBG) {
diff --git a/packages/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java b/packages/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
index e82a5d7..c3447fd 100644
--- a/packages/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
+++ b/packages/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
@@ -32,6 +32,7 @@
import static android.net.metrics.ValidationProbeEvent.PROBE_FALLBACK;
import static android.net.metrics.ValidationProbeEvent.PROBE_PRIVDNS;
import static android.net.util.NetworkStackUtils.isEmpty;
+import static android.provider.Settings.Global.DATA_STALL_EVALUATION_TYPE_DNS;
import android.annotation.NonNull;
import android.annotation.Nullable;
@@ -128,9 +129,8 @@
private static final int DEFAULT_DATA_STALL_MIN_EVALUATE_TIME_MS = 60 * 1000;
private static final int DEFAULT_DATA_STALL_VALID_DNS_TIME_THRESHOLD_MS = 30 * 60 * 1000;
- private static final int DATA_STALL_EVALUATION_TYPE_DNS = 1;
private static final int DEFAULT_DATA_STALL_EVALUATION_TYPES =
- (1 << DATA_STALL_EVALUATION_TYPE_DNS);
+ DATA_STALL_EVALUATION_TYPE_DNS;
// Reevaluate it as intending to increase the number. Larger log size may cause statsd
// log buffer bust and have stats log lost.
private static final int DEFAULT_DNS_LOG_SIZE = 20;
@@ -1772,7 +1772,7 @@
}
private boolean dataStallEvaluateTypeEnabled(int type) {
- return (mDataStallEvaluationType & (1 << type)) != 0;
+ return (mDataStallEvaluationType & type) != 0;
}
@VisibleForTesting
@@ -1792,7 +1792,7 @@
}
// Check dns signal. Suspect it may be a data stall if both :
- // 1. The number of consecutive DNS query timeouts > mConsecutiveDnsTimeoutThreshold.
+ // 1. The number of consecutive DNS query timeouts >= mConsecutiveDnsTimeoutThreshold.
// 2. Those consecutive DNS queries happened in the last mValidDataStallDnsTimeThreshold ms.
if (dataStallEvaluateTypeEnabled(DATA_STALL_EVALUATION_TYPE_DNS)) {
if (mDnsStallDetector.isDataStallSuspected(mConsecutiveDnsTimeoutThreshold,
diff --git a/packages/NetworkStack/src/com/android/server/util/PermissionUtil.java b/packages/NetworkStack/src/com/android/server/util/PermissionUtil.java
index f6eb900..6fbeead 100644
--- a/packages/NetworkStack/src/com/android/server/util/PermissionUtil.java
+++ b/packages/NetworkStack/src/com/android/server/util/PermissionUtil.java
@@ -33,7 +33,9 @@
public static void checkNetworkStackCallingPermission() {
// TODO: check that the calling PID is the system server.
final int caller = getCallingUid();
- if (caller != Process.SYSTEM_UID && UserHandle.getAppId(caller) != Process.BLUETOOTH_UID) {
+ if (caller != Process.SYSTEM_UID
+ && UserHandle.getAppId(caller) != Process.BLUETOOTH_UID
+ && UserHandle.getAppId(caller) != Process.PHONE_UID) {
throw new SecurityException("Invalid caller: " + caller);
}
}
diff --git a/packages/NetworkStack/tests/Android.bp b/packages/NetworkStack/tests/Android.bp
index 5c7b514..f22b647 100644
--- a/packages/NetworkStack/tests/Android.bp
+++ b/packages/NetworkStack/tests/Android.bp
@@ -21,7 +21,7 @@
test_suites: ["device-tests"],
resource_dirs: ["res"],
static_libs: [
- "android-support-test",
+ "androidx.test.rules",
"frameworks-base-testutils",
"mockito-target-extended-minus-junit4",
"NetworkStackLib",
diff --git a/packages/NetworkStack/tests/AndroidManifest.xml b/packages/NetworkStack/tests/AndroidManifest.xml
index 9cb2c21..5dcf6ff 100644
--- a/packages/NetworkStack/tests/AndroidManifest.xml
+++ b/packages/NetworkStack/tests/AndroidManifest.xml
@@ -47,7 +47,7 @@
<application android:debuggable="true">
<uses-library android:name="android.test.runner" />
</application>
- <instrumentation android:name="android.support.test.runner.AndroidJUnitRunner"
+ <instrumentation android:name="androidx.test.runner.AndroidJUnitRunner"
android:targetPackage="com.android.server.networkstack.tests"
android:label="Networking service tests">
</instrumentation>
diff --git a/packages/NetworkStack/tests/AndroidTest.xml b/packages/NetworkStack/tests/AndroidTest.xml
index 6b08b57..047bc2e 100644
--- a/packages/NetworkStack/tests/AndroidTest.xml
+++ b/packages/NetworkStack/tests/AndroidTest.xml
@@ -23,7 +23,7 @@
<option name="test-tag" value="NetworkStackTests" />
<test class="com.android.tradefed.testtype.AndroidJUnitTest" >
<option name="package" value="com.android.server.networkstack.tests" />
- <option name="runner" value="android.support.test.runner.AndroidJUnitRunner" />
+ <option name="runner" value="androidx.test.runner.AndroidJUnitRunner" />
<option name="hidden-api-checks" value="false"/>
</test>
</configuration>
\ No newline at end of file
diff --git a/packages/NetworkStack/tests/src/android/net/apf/ApfTest.java b/packages/NetworkStack/tests/src/android/net/apf/ApfTest.java
index 3414397..88a05d5 100644
--- a/packages/NetworkStack/tests/src/android/net/apf/ApfTest.java
+++ b/packages/NetworkStack/tests/src/android/net/apf/ApfTest.java
@@ -53,14 +53,15 @@
import android.os.ConditionVariable;
import android.os.Parcelable;
import android.os.SystemClock;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
import android.system.ErrnoException;
import android.system.Os;
import android.text.format.DateUtils;
import android.util.Log;
+import androidx.test.InstrumentationRegistry;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.internal.util.HexDump;
import com.android.server.networkstack.tests.R;
import com.android.server.util.NetworkStackConstants;
diff --git a/packages/NetworkStack/tests/src/android/net/dhcp/DhcpLeaseRepositoryTest.java b/packages/NetworkStack/tests/src/android/net/dhcp/DhcpLeaseRepositoryTest.java
index 4abd77e..27d7255 100644
--- a/packages/NetworkStack/tests/src/android/net/dhcp/DhcpLeaseRepositoryTest.java
+++ b/packages/NetworkStack/tests/src/android/net/dhcp/DhcpLeaseRepositoryTest.java
@@ -31,16 +31,15 @@
import static org.junit.Assert.fail;
import static org.mockito.Mockito.when;
-import static java.lang.String.format;
-
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.net.IpPrefix;
import android.net.MacAddress;
import android.net.dhcp.DhcpServer.Clock;
import android.net.util.SharedLog;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import org.junit.Before;
import org.junit.Test;
@@ -48,6 +47,8 @@
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
+import static java.lang.String.format;
+
import java.net.Inet4Address;
import java.util.Arrays;
import java.util.Collections;
diff --git a/packages/NetworkStack/tests/src/android/net/dhcp/DhcpPacketTest.java b/packages/NetworkStack/tests/src/android/net/dhcp/DhcpPacketTest.java
index 7544e72..4d98403 100644
--- a/packages/NetworkStack/tests/src/android/net/dhcp/DhcpPacketTest.java
+++ b/packages/NetworkStack/tests/src/android/net/dhcp/DhcpPacketTest.java
@@ -48,8 +48,9 @@
import android.net.LinkAddress;
import android.net.NetworkUtils;
import android.net.metrics.DhcpErrorEvent;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import com.android.internal.util.HexDump;
@@ -324,7 +325,7 @@
@Test
public void testOffer1() throws Exception {
// TODO: Turn all of these into golden files. This will probably require using
- // android.support.test.InstrumentationRegistry for obtaining a Context object
+ // androidx.test.InstrumentationRegistry for obtaining a Context object
// to read such golden files, along with an appropriate Android.mk.
final ByteBuffer packet = ByteBuffer.wrap(HexDump.hexStringToByteArray(
// IP header.
diff --git a/packages/NetworkStack/tests/src/android/net/dhcp/DhcpServerTest.java b/packages/NetworkStack/tests/src/android/net/dhcp/DhcpServerTest.java
index d4c1e2e..7d5e9e3 100644
--- a/packages/NetworkStack/tests/src/android/net/dhcp/DhcpServerTest.java
+++ b/packages/NetworkStack/tests/src/android/net/dhcp/DhcpServerTest.java
@@ -51,11 +51,12 @@
import android.net.dhcp.DhcpServer.Dependencies;
import android.net.util.SharedLog;
import android.os.HandlerThread;
-import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.testing.TestableLooper.RunWithLooper;
+import androidx.test.filters.SmallTest;
+
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
diff --git a/packages/NetworkStack/tests/src/android/net/dhcp/DhcpServingParamsTest.java b/packages/NetworkStack/tests/src/android/net/dhcp/DhcpServingParamsTest.java
index 1004382..57a87a4 100644
--- a/packages/NetworkStack/tests/src/android/net/dhcp/DhcpServingParamsTest.java
+++ b/packages/NetworkStack/tests/src/android/net/dhcp/DhcpServingParamsTest.java
@@ -29,8 +29,9 @@
import android.net.LinkAddress;
import android.net.dhcp.DhcpServingParams.InvalidParameterException;
import android.net.shared.Inet4AddressUtils;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import org.junit.Before;
import org.junit.Test;
diff --git a/packages/NetworkStack/tests/src/android/net/ip/IpClientTest.java b/packages/NetworkStack/tests/src/android/net/ip/IpClientTest.java
index aaaff02..1990229 100644
--- a/packages/NetworkStack/tests/src/android/net/ip/IpClientTest.java
+++ b/packages/NetworkStack/tests/src/android/net/ip/IpClientTest.java
@@ -47,10 +47,11 @@
import android.net.shared.ProvisioningConfiguration;
import android.net.util.InterfaceParams;
import android.provider.Settings;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
import android.test.mock.MockContentResolver;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.internal.R;
import com.android.internal.util.test.FakeSettingsProvider;
import com.android.server.NetworkObserver;
diff --git a/packages/NetworkStack/tests/src/android/net/ip/IpReachabilityMonitorTest.java b/packages/NetworkStack/tests/src/android/net/ip/IpReachabilityMonitorTest.java
index e3b5ddf..64b168a 100644
--- a/packages/NetworkStack/tests/src/android/net/ip/IpReachabilityMonitorTest.java
+++ b/packages/NetworkStack/tests/src/android/net/ip/IpReachabilityMonitorTest.java
@@ -24,8 +24,9 @@
import android.net.util.SharedLog;
import android.os.Handler;
import android.os.Looper;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import org.junit.Before;
import org.junit.Test;
@@ -33,7 +34,6 @@
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
-
/**
* Tests for IpReachabilityMonitor.
*/
diff --git a/packages/NetworkStack/tests/src/android/net/util/ConnectivityPacketSummaryTest.java b/packages/NetworkStack/tests/src/android/net/util/ConnectivityPacketSummaryTest.java
index dfaf52a..71be8b3 100644
--- a/packages/NetworkStack/tests/src/android/net/util/ConnectivityPacketSummaryTest.java
+++ b/packages/NetworkStack/tests/src/android/net/util/ConnectivityPacketSummaryTest.java
@@ -20,8 +20,9 @@
import static org.junit.Assert.assertTrue;
import android.net.MacAddress;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import libcore.util.HexEncoding;
diff --git a/packages/NetworkStack/tests/src/android/net/util/PacketReaderTest.java b/packages/NetworkStack/tests/src/android/net/util/PacketReaderTest.java
index 6e11c40..289dcad 100644
--- a/packages/NetworkStack/tests/src/android/net/util/PacketReaderTest.java
+++ b/packages/NetworkStack/tests/src/android/net/util/PacketReaderTest.java
@@ -31,12 +31,13 @@
import android.os.Handler;
import android.os.HandlerThread;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
import android.system.ErrnoException;
import android.system.Os;
import android.system.StructTimeval;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
diff --git a/packages/NetworkStack/tests/src/com/android/server/connectivity/NetworkMonitorTest.java b/packages/NetworkStack/tests/src/com/android/server/connectivity/NetworkMonitorTest.java
index ddb7030..34ca6ac 100644
--- a/packages/NetworkStack/tests/src/com/android/server/connectivity/NetworkMonitorTest.java
+++ b/packages/NetworkStack/tests/src/com/android/server/connectivity/NetworkMonitorTest.java
@@ -20,6 +20,7 @@
import static android.net.INetworkMonitor.NETWORK_TEST_RESULT_INVALID;
import static android.net.INetworkMonitor.NETWORK_TEST_RESULT_VALID;
import static android.net.NetworkCapabilities.NET_CAPABILITY_INTERNET;
+import static android.provider.Settings.Global.DATA_STALL_EVALUATION_TYPE_DNS;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertFalse;
@@ -60,12 +61,13 @@
import android.os.Handler;
import android.os.SystemClock;
import android.provider.Settings;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
import android.telephony.CellSignalStrength;
import android.telephony.TelephonyManager;
import android.util.ArrayMap;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -82,7 +84,6 @@
import javax.net.ssl.SSLHandshakeException;
-
@RunWith(AndroidJUnit4.class)
@SmallTest
public class NetworkMonitorTest {
@@ -114,7 +115,6 @@
private static final String TEST_OTHER_FALLBACK_URL = "http://otherfallback.google.com/gen_204";
private static final String TEST_MCCMNC = "123456";
- private static final int DATA_STALL_EVALUATION_TYPE_DNS = 1;
private static final int RETURN_CODE_DNS_SUCCESS = 0;
private static final int RETURN_CODE_DNS_TIMEOUT = 255;
private static final int DEFAULT_DNS_TIMEOUT_THRESHOLD = 5;
@@ -186,7 +186,7 @@
when(mCm.getNetworkCapabilities(any())).thenReturn(METERED_CAPABILITIES);
setMinDataStallEvaluateInterval(500);
- setDataStallEvaluationType(1 << DATA_STALL_EVALUATION_TYPE_DNS);
+ setDataStallEvaluationType(DATA_STALL_EVALUATION_TYPE_DNS);
setValidDataStallDnsTimeThreshold(500);
setConsecutiveDnsTimeoutThreshold(5);
}
@@ -525,7 +525,7 @@
wrappedMonitor.setLastProbeTime(SystemClock.elapsedRealtime() - 1000);
makeDnsTimeoutEvent(wrappedMonitor, 5);
assertTrue(wrappedMonitor.isDataStall());
- verify(mDataStallStatsUtils, times(1)).write(any(), any());
+ verify(mDataStallStatsUtils, times(1)).write(makeEmptyDataStallDetectionStats(), any());
}
@Test
@@ -534,7 +534,7 @@
wrappedMonitor.setLastProbeTime(SystemClock.elapsedRealtime() - 1000);
makeDnsTimeoutEvent(wrappedMonitor, 3);
assertFalse(wrappedMonitor.isDataStall());
- verify(mDataStallStatsUtils, never()).write(any(), any());
+ verify(mDataStallStatsUtils, never()).write(makeEmptyDataStallDetectionStats(), any());
}
@Test
@@ -586,6 +586,10 @@
}
}
+ private DataStallDetectionStats makeEmptyDataStallDetectionStats() {
+ return new DataStallDetectionStats.Builder().build();
+ }
+
private void setDataStallEvaluationType(int type) {
when(mDependencies.getSetting(any(),
eq(Settings.Global.DATA_STALL_EVALUATION_TYPE), anyInt())).thenReturn(type);
diff --git a/packages/NetworkStack/tests/src/com/android/server/util/SharedLogTest.java b/packages/NetworkStack/tests/src/com/android/server/util/SharedLogTest.java
index 07ad3123..b1db051 100644
--- a/packages/NetworkStack/tests/src/com/android/server/util/SharedLogTest.java
+++ b/packages/NetworkStack/tests/src/com/android/server/util/SharedLogTest.java
@@ -20,8 +20,9 @@
import static org.junit.Assert.assertTrue;
import android.net.util.SharedLog;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
diff --git a/packages/NetworkStackPermissionStub/Android.bp b/packages/NetworkStackPermissionStub/Android.bp
index dd70cf5..8cee92e 100644
--- a/packages/NetworkStackPermissionStub/Android.bp
+++ b/packages/NetworkStackPermissionStub/Android.bp
@@ -21,6 +21,7 @@
// a classes.dex.
srcs: ["src/**/*.java"],
platform_apis: true,
+ min_sdk_version: "28",
certificate: "networkstack",
privileged: true,
manifest: "AndroidManifest.xml",
diff --git a/packages/NetworkStackPermissionStub/AndroidManifest.xml b/packages/NetworkStackPermissionStub/AndroidManifest.xml
index ba8a178..e83f050 100644
--- a/packages/NetworkStackPermissionStub/AndroidManifest.xml
+++ b/packages/NetworkStackPermissionStub/AndroidManifest.xml
@@ -19,8 +19,9 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.networkstack.permissionstub"
android:sharedUserId="android.uid.networkstack"
- android:versionCode="10"
+ android:versionCode="11"
android:versionName="Q-initial">
+ <uses-sdk android:minSdkVersion="28" android:targetSdkVersion="28" />
<!--
This package only exists to define the below permissions, and enforce that they are only
granted to apps sharing the same signature.
@@ -36,4 +37,4 @@
android:protectionLevel="signature"/>
<application android:name="com.android.server.NetworkStackPermissionStub"/>
-</manifest>
\ No newline at end of file
+</manifest>
diff --git a/packages/SystemUI/shared/tests/Android.mk b/packages/SystemUI/shared/tests/Android.mk
index 02774c9..34069ef 100644
--- a/packages/SystemUI/shared/tests/Android.mk
+++ b/packages/SystemUI/shared/tests/Android.mk
@@ -35,7 +35,7 @@
LOCAL_STATIC_JAVA_LIBRARIES := \
SystemUISharedLib \
metrics-helper-lib \
- android-support-test \
+ androidx.test.rules \
mockito-target-inline-minus-junit4 \
SystemUI-proto \
SystemUI-tags \
diff --git a/packages/SystemUI/shared/tests/src/com/android/systemui/shared/SysuiSharedLibTestCase.java b/packages/SystemUI/shared/tests/src/com/android/systemui/shared/SysuiSharedLibTestCase.java
index 04b341e..4f4d878 100644
--- a/packages/SystemUI/shared/tests/src/com/android/systemui/shared/SysuiSharedLibTestCase.java
+++ b/packages/SystemUI/shared/tests/src/com/android/systemui/shared/SysuiSharedLibTestCase.java
@@ -20,7 +20,8 @@
import android.os.Handler;
import android.os.Looper;
import android.os.MessageQueue;
-import android.support.test.InstrumentationRegistry;
+
+import androidx.test.InstrumentationRegistry;
import org.junit.After;
import org.junit.Before;
diff --git a/packages/SystemUI/shared/tests/src/com/android/systemui/shared/recents/model/HighResThumbnailLoaderTest.java b/packages/SystemUI/shared/tests/src/com/android/systemui/shared/recents/model/HighResThumbnailLoaderTest.java
index 3b647c1..e7f3388 100644
--- a/packages/SystemUI/shared/tests/src/com/android/systemui/shared/recents/model/HighResThumbnailLoaderTest.java
+++ b/packages/SystemUI/shared/tests/src/com/android/systemui/shared/recents/model/HighResThumbnailLoaderTest.java
@@ -26,10 +26,10 @@
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
-import android.content.ComponentName;
import android.os.Looper;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import com.android.systemui.shared.SysuiSharedLibTestCase;
import com.android.systemui.shared.recents.model.Task.TaskKey;
diff --git a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java
index 897ab88..a38838d 100644
--- a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java
+++ b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java
@@ -458,7 +458,9 @@
public void onPress() {
MetricsLogger.action(mContext, MetricsEvent.ACTION_EMERGENCY_DIALER_FROM_POWER_MENU);
Intent intent = new Intent(EmergencyDialerConstants.ACTION_DIAL);
- intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
+ intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK
+ | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS
+ | Intent.FLAG_ACTIVITY_CLEAR_TOP);
intent.putExtra(EmergencyDialerConstants.EXTRA_ENTRY_TYPE,
EmergencyDialerConstants.ENTRY_TYPE_POWER_MENU);
mContext.startActivityAsUser(intent, UserHandle.CURRENT);
diff --git a/packages/SystemUI/tests/Android.mk b/packages/SystemUI/tests/Android.mk
index 9ee5532..aa3d2d3 100644
--- a/packages/SystemUI/tests/Android.mk
+++ b/packages/SystemUI/tests/Android.mk
@@ -39,7 +39,8 @@
LOCAL_STATIC_JAVA_LIBRARIES := \
metrics-helper-lib \
- android-support-test \
+ androidx.test.rules \
+ hamcrest-library \
mockito-target-inline-minus-junit4 \
testables \
truth-prebuilt \
diff --git a/packages/SystemUI/tests/src/com/android/AAAPlusPlusVerifySysuiRequiredTestPropertiesTest.java b/packages/SystemUI/tests/src/com/android/AAAPlusPlusVerifySysuiRequiredTestPropertiesTest.java
index fe23541..1472243 100644
--- a/packages/SystemUI/tests/src/com/android/AAAPlusPlusVerifySysuiRequiredTestPropertiesTest.java
+++ b/packages/SystemUI/tests/src/com/android/AAAPlusPlusVerifySysuiRequiredTestPropertiesTest.java
@@ -16,22 +16,22 @@
import static org.junit.Assert.assertFalse;
-import android.support.test.filters.LargeTest;
-import android.support.test.filters.MediumTest;
-import android.support.test.filters.SmallTest;
-import android.support.test.internal.runner.ClassPathScanner;
-import android.support.test.internal.runner.ClassPathScanner.ChainedClassNameFilter;
-import android.support.test.internal.runner.ClassPathScanner.ExternalClassNameFilter;
import android.testing.AndroidTestingRunner;
import android.text.TextUtils;
import android.util.Log;
+import androidx.test.filters.LargeTest;
+import androidx.test.filters.MediumTest;
+import androidx.test.filters.SmallTest;
+import androidx.test.internal.runner.ClassPathScanner;
+import androidx.test.internal.runner.ClassPathScanner.ChainedClassNameFilter;
+import androidx.test.internal.runner.ClassPathScanner.ExternalClassNameFilter;
+
import com.android.systemui.SysuiBaseFragmentTest;
import com.android.systemui.SysuiTestCase;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.junit.internal.builders.AllDefaultPossibilitiesBuilder;
import java.io.IOException;
import java.lang.reflect.Method;
diff --git a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardClockAccessibilityDelegateTest.java b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardClockAccessibilityDelegateTest.java
index e37ea95..dcafa72 100644
--- a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardClockAccessibilityDelegateTest.java
+++ b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardClockAccessibilityDelegateTest.java
@@ -20,12 +20,13 @@
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
-import android.support.test.filters.SmallTest;
import android.text.TextUtils;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityNodeInfo;
import android.widget.TextView;
+import androidx.test.filters.SmallTest;
+
import com.android.systemui.SysuiTestCase;
import org.junit.Before;
diff --git a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardPinBasedInputViewTest.java b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardPinBasedInputViewTest.java
index 359832f..d1a1ad6 100644
--- a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardPinBasedInputViewTest.java
+++ b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardPinBasedInputViewTest.java
@@ -21,12 +21,13 @@
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyZeroInteractions;
-import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper.RunWithLooper;
import android.view.KeyEvent;
import android.view.LayoutInflater;
+import androidx.test.filters.SmallTest;
+
import com.android.systemui.SysuiTestCase;
import org.junit.Before;
diff --git a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardSecurityContainerTest.java b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardSecurityContainerTest.java
index fcf327b..8db195a 100644
--- a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardSecurityContainerTest.java
+++ b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardSecurityContainerTest.java
@@ -16,19 +16,18 @@
package com.android.keyguard;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
import android.content.Context;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
import android.test.UiThreadTest;
-import android.util.Log;
import android.view.LayoutInflater;
-import android.view.View;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import com.android.systemui.SysuiTestCase;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
@SmallTest
@RunWith(AndroidJUnit4.class)
public class KeyguardSecurityContainerTest extends SysuiTestCase {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/BatteryMeterDrawableTest.java b/packages/SystemUI/tests/src/com/android/systemui/BatteryMeterDrawableTest.java
index e1f56a47..d1573c3 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/BatteryMeterDrawableTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/BatteryMeterDrawableTest.java
@@ -16,8 +16,6 @@
package com.android.systemui;
-import com.android.settingslib.graph.BatteryMeterDrawableBase;
-
import static org.mockito.Mockito.any;
import static org.mockito.Mockito.anyFloat;
import static org.mockito.Mockito.anyString;
@@ -30,9 +28,12 @@
import android.content.res.Resources;
import android.graphics.Canvas;
-import android.support.test.runner.AndroidJUnit4;
import android.test.suitebuilder.annotation.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
+import com.android.settingslib.graph.BatteryMeterDrawableBase;
+
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/DependencyTest.java b/packages/SystemUI/tests/src/com/android/systemui/DependencyTest.java
index 3426e11..5513a54 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/DependencyTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/DependencyTest.java
@@ -21,7 +21,8 @@
import static org.mockito.Mockito.verify;
import android.os.Looper;
-import android.support.test.filters.SmallTest;
+
+import androidx.test.filters.SmallTest;
import com.android.systemui.Dependency.DependencyKey;
import com.android.systemui.statusbar.policy.FlashlightController;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/ExpandHelperTest.java b/packages/SystemUI/tests/src/com/android/systemui/ExpandHelperTest.java
index 08c4235..4d14c05 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/ExpandHelperTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/ExpandHelperTest.java
@@ -16,15 +16,18 @@
package com.android.systemui;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
import android.animation.ObjectAnimator;
import android.content.Context;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.annotation.UiThreadTest;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper.RunWithLooper;
+import androidx.test.annotation.UiThreadTest;
+import androidx.test.filters.SmallTest;
+
import com.android.systemui.statusbar.ExpandableNotificationRow;
import com.android.systemui.statusbar.NotificationTestHelper;
@@ -32,10 +35,6 @@
import org.junit.Test;
import org.junit.runner.RunWith;
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
@SmallTest
@RunWith(AndroidTestingRunner.class)
@RunWithLooper(setAsMainLooper = true)
diff --git a/packages/SystemUI/tests/src/com/android/systemui/ForegroundServiceControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/ForegroundServiceControllerTest.java
index f278a17..4090b1d 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/ForegroundServiceControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/ForegroundServiceControllerTest.java
@@ -30,10 +30,11 @@
import android.os.Bundle;
import android.os.UserHandle;
import android.service.notification.StatusBarNotification;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
import android.widget.RemoteViews;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.internal.messages.nano.SystemMessageProto;
import org.junit.Before;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/ScreenDecorationsTest.java b/packages/SystemUI/tests/src/com/android/systemui/ScreenDecorationsTest.java
index cc96917..1b9d283 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/ScreenDecorationsTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/ScreenDecorationsTest.java
@@ -20,8 +20,8 @@
import static com.android.systemui.tuner.TunablePadding.FLAG_START;
import static org.hamcrest.Matchers.is;
-import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertThat;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.anyString;
@@ -36,7 +36,6 @@
import android.app.Fragment;
import android.content.res.Configuration;
import android.os.Handler;
-import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.testing.TestableLooper.RunWithLooper;
@@ -44,6 +43,8 @@
import android.view.View;
import android.view.WindowManager;
+import androidx.test.filters.SmallTest;
+
import com.android.systemui.R.dimen;
import com.android.systemui.ScreenDecorations.TunablePaddingTagListener;
import com.android.systemui.fragments.FragmentHostManager;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/SliceBroadcastRelayHandlerTest.java b/packages/SystemUI/tests/src/com/android/systemui/SliceBroadcastRelayHandlerTest.java
index 383db05..c6e85c3 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/SliceBroadcastRelayHandlerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/SliceBroadcastRelayHandlerTest.java
@@ -29,9 +29,10 @@
import android.content.Intent;
import android.content.IntentFilter;
import android.net.Uri;
-import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
+import androidx.test.filters.SmallTest;
+
import com.android.settingslib.SliceBroadcastRelay;
import org.junit.Test;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/SysuiBaseFragmentTest.java b/packages/SystemUI/tests/src/com/android/systemui/SysuiBaseFragmentTest.java
index b6335f3..256cfb2 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/SysuiBaseFragmentTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/SysuiBaseFragmentTest.java
@@ -19,10 +19,11 @@
import android.app.Fragment;
import android.app.Instrumentation;
-import android.support.test.InstrumentationRegistry;
import android.testing.BaseFragmentTest;
import android.testing.DexmakerShareClassLoaderRule;
+import androidx.test.InstrumentationRegistry;
+
import com.android.systemui.utils.leaks.LeakCheckedTest;
import com.android.systemui.utils.leaks.LeakCheckedTest.SysuiLeakCheck;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/SysuiTestCase.java b/packages/SystemUI/tests/src/com/android/systemui/SysuiTestCase.java
index a35ca46..4ad103c 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/SysuiTestCase.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/SysuiTestCase.java
@@ -23,11 +23,12 @@
import android.os.Looper;
import android.os.MessageQueue;
import android.os.ParcelFileDescriptor;
-import android.support.test.InstrumentationRegistry;
import android.testing.DexmakerShareClassLoaderRule;
import android.testing.LeakCheck;
import android.util.Log;
+import androidx.test.InstrumentationRegistry;
+
import com.android.keyguard.KeyguardUpdateMonitor;
import org.junit.After;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/colorextraction/SysuiColorExtractorTests.java b/packages/SystemUI/tests/src/com/android/systemui/colorextraction/SysuiColorExtractorTests.java
index 13dc36d..1649f98 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/colorextraction/SysuiColorExtractorTests.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/colorextraction/SysuiColorExtractorTests.java
@@ -22,8 +22,9 @@
import android.app.WallpaperColors;
import android.app.WallpaperManager;
import android.graphics.Color;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import com.android.internal.colorextraction.ColorExtractor;
import com.android.systemui.SysuiTestCase;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/doze/AlwaysOnDisplayPolicyTest.java b/packages/SystemUI/tests/src/com/android/systemui/doze/AlwaysOnDisplayPolicyTest.java
index 0bbdeb5..ec9acdf 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/doze/AlwaysOnDisplayPolicyTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/doze/AlwaysOnDisplayPolicyTest.java
@@ -19,10 +19,11 @@
import static com.google.common.truth.Truth.assertThat;
import android.provider.Settings;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
import android.text.format.DateUtils;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.systemui.R;
import com.android.systemui.SysuiTestCase;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/doze/DozeConfigurationTest.java b/packages/SystemUI/tests/src/com/android/systemui/doze/DozeConfigurationTest.java
index bb67d6e..3062b8f 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/doze/DozeConfigurationTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/doze/DozeConfigurationTest.java
@@ -20,8 +20,9 @@
import android.os.UserHandle;
import android.provider.Settings;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import com.android.internal.hardware.AmbientDisplayConfiguration;
import com.android.systemui.SysuiTestCase;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/doze/DozeMachineTest.java b/packages/SystemUI/tests/src/com/android/systemui/doze/DozeMachineTest.java
index 368c814f..43836de 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/doze/DozeMachineTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/doze/DozeMachineTest.java
@@ -28,8 +28,8 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
-import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.mock;
@@ -38,16 +38,15 @@
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
-import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
-import android.view.Display;
+import android.testing.UiThreadTest;
+
+import androidx.test.filters.SmallTest;
import com.android.internal.hardware.AmbientDisplayConfiguration;
import com.android.systemui.SysuiTestCase;
import com.android.systemui.util.wakelock.WakeLockFake;
-import android.testing.UiThreadTest;
-
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/doze/DozeScreenBrightnessTest.java b/packages/SystemUI/tests/src/com/android/systemui/doze/DozeScreenBrightnessTest.java
index 5e12781..912a95a 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/doze/DozeScreenBrightnessTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/doze/DozeScreenBrightnessTest.java
@@ -28,14 +28,13 @@
import static com.android.systemui.doze.DozeMachine.State.UNINITIALIZED;
import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import android.os.PowerManager;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import com.android.systemui.SysuiTestCase;
import com.android.systemui.utils.hardware.FakeSensorManager;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/doze/DozeScreenStatePreventingAdapterTest.java b/packages/SystemUI/tests/src/com/android/systemui/doze/DozeScreenStatePreventingAdapterTest.java
index a17a95f..903e4a1 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/doze/DozeScreenStatePreventingAdapterTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/doze/DozeScreenStatePreventingAdapterTest.java
@@ -22,9 +22,10 @@
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
-import android.support.test.filters.SmallTest;
import android.view.Display;
+import androidx.test.filters.SmallTest;
+
import com.android.systemui.SysuiTestCase;
import com.android.systemui.statusbar.phone.DozeParameters;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/doze/DozeScreenStateTest.java b/packages/SystemUI/tests/src/com/android/systemui/doze/DozeScreenStateTest.java
index b6039b6..bfd448a 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/doze/DozeScreenStateTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/doze/DozeScreenStateTest.java
@@ -30,19 +30,16 @@
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
-import static org.mockito.Mockito.never;
-import static org.mockito.Mockito.reset;
-import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import android.os.Looper;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
import android.view.Display;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.systemui.SysuiTestCase;
import com.android.systemui.statusbar.phone.DozeParameters;
-import com.android.systemui.util.wakelock.WakeLock;
import com.android.systemui.util.wakelock.WakeLockFake;
import com.android.systemui.utils.os.FakeHandler;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/doze/DozeSuspendScreenStatePreventingAdapterTest.java b/packages/SystemUI/tests/src/com/android/systemui/doze/DozeSuspendScreenStatePreventingAdapterTest.java
index ed93561..fac58a0 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/doze/DozeSuspendScreenStatePreventingAdapterTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/doze/DozeSuspendScreenStatePreventingAdapterTest.java
@@ -22,9 +22,10 @@
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
-import android.support.test.filters.SmallTest;
import android.view.Display;
+import androidx.test.filters.SmallTest;
+
import com.android.systemui.SysuiTestCase;
import com.android.systemui.statusbar.phone.DozeParameters;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/doze/DozeTriggersTest.java b/packages/SystemUI/tests/src/com/android/systemui/doze/DozeTriggersTest.java
index c2da7f5..e18b625 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/doze/DozeTriggersTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/doze/DozeTriggersTest.java
@@ -27,11 +27,12 @@
import android.app.Instrumentation;
import android.os.Handler;
import android.os.Looper;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper.RunWithLooper;
+import androidx.test.InstrumentationRegistry;
+import androidx.test.filters.SmallTest;
+
import com.android.internal.hardware.AmbientDisplayConfiguration;
import com.android.systemui.SysuiTestCase;
import com.android.systemui.statusbar.phone.DozeParameters;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/doze/DozeUiTest.java b/packages/SystemUI/tests/src/com/android/systemui/doze/DozeUiTest.java
index 0d8d952..25231bc 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/doze/DozeUiTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/doze/DozeUiTest.java
@@ -27,19 +27,17 @@
import static org.mockito.ArgumentMatchers.anyLong;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.clearInvocations;
-import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.reset;
-import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import android.app.AlarmManager;
import android.os.Handler;
import android.os.HandlerThread;
-import android.os.PowerManager;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import com.android.keyguard.KeyguardUpdateMonitor;
import com.android.systemui.SysuiTestCase;
@@ -47,7 +45,6 @@
import com.android.systemui.util.wakelock.WakeLockFake;
import org.junit.After;
-import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -172,4 +169,4 @@
mDozeUi.transitionTo(UNINITIALIZED, DOZE);
verify(mHost).setAnimateWakeup(eq(false));
}
-}
\ No newline at end of file
+}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/doze/DozeWallpaperStateTest.java b/packages/SystemUI/tests/src/com/android/systemui/doze/DozeWallpaperStateTest.java
index 6ac4462..1ea2e29 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/doze/DozeWallpaperStateTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/doze/DozeWallpaperStateTest.java
@@ -18,16 +18,15 @@
import static org.mockito.ArgumentMatchers.anyBoolean;
import static org.mockito.ArgumentMatchers.eq;
-import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.reset;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import android.app.IWallpaperManager;
import android.os.RemoteException;
-import android.support.test.filters.SmallTest;
-import com.android.keyguard.KeyguardUpdateMonitor;
+import androidx.test.filters.SmallTest;
+
import com.android.systemui.SysuiTestCase;
import com.android.systemui.statusbar.phone.DozeParameters;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/keyguard/DismissCallbackRegistryTest.java b/packages/SystemUI/tests/src/com/android/systemui/keyguard/DismissCallbackRegistryTest.java
index 308670d..d35fc30 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/keyguard/DismissCallbackRegistryTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/keyguard/DismissCallbackRegistryTest.java
@@ -19,12 +19,11 @@
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import com.android.internal.policy.IKeyguardDismissCallback;
import com.android.systemui.SysuiTestCase;
-import com.android.systemui.UiOffloadThread;
import org.junit.Before;
import org.junit.Test;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/keyguard/KeyguardSliceProviderTest.java b/packages/SystemUI/tests/src/com/android/systemui/keyguard/KeyguardSliceProviderTest.java
index 46e2bfb..7ae7aa4 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/keyguard/KeyguardSliceProviderTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/keyguard/KeyguardSliceProviderTest.java
@@ -19,25 +19,28 @@
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.ArgumentMatchers.eq;
-import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
import android.app.AlarmManager;
import android.content.ContentResolver;
import android.content.Intent;
import android.net.Uri;
import android.provider.Settings;
-import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.testing.TestableLooper.RunWithLooper;
-import android.util.Log;
+
+import androidx.slice.Slice;
+import androidx.slice.SliceItem;
+import androidx.slice.SliceProvider;
+import androidx.slice.SliceSpecs;
+import androidx.slice.builders.ListBuilder;
+import androidx.slice.core.SliceQuery;
+import androidx.test.filters.SmallTest;
import com.android.systemui.SysuiTestCase;
-import com.android.systemui.statusbar.policy.ZenModeController;
import org.junit.Assert;
import org.junit.Before;
@@ -50,13 +53,6 @@
import java.util.HashSet;
import java.util.concurrent.TimeUnit;
-import androidx.slice.Slice;
-import androidx.slice.SliceItem;
-import androidx.slice.SliceProvider;
-import androidx.slice.SliceSpecs;
-import androidx.slice.builders.ListBuilder;
-import androidx.slice.core.SliceQuery;
-
@SmallTest
@RunWith(AndroidTestingRunner.class)
@RunWithLooper(setAsMainLooper = true)
diff --git a/packages/SystemUI/tests/src/com/android/systemui/keyguard/LifecycleTest.java b/packages/SystemUI/tests/src/com/android/systemui/keyguard/LifecycleTest.java
index e0807d6..50914c8 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/keyguard/LifecycleTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/keyguard/LifecycleTest.java
@@ -19,9 +19,10 @@
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
-import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
+import androidx.test.filters.SmallTest;
+
import com.android.systemui.SysuiTestCase;
import org.junit.Before;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/keyguard/ScreenLifecycleTest.java b/packages/SystemUI/tests/src/com/android/systemui/keyguard/ScreenLifecycleTest.java
index 8c918f6..06e597e 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/keyguard/ScreenLifecycleTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/keyguard/ScreenLifecycleTest.java
@@ -21,9 +21,10 @@
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;
-import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
+import androidx.test.filters.SmallTest;
+
import com.android.systemui.SysuiTestCase;
import org.junit.Before;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/keyguard/WakefulnessLifecycleTest.java b/packages/SystemUI/tests/src/com/android/systemui/keyguard/WakefulnessLifecycleTest.java
index 9eba9b8..1dc4150 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/keyguard/WakefulnessLifecycleTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/keyguard/WakefulnessLifecycleTest.java
@@ -22,9 +22,10 @@
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;
-import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
+import androidx.test.filters.SmallTest;
+
import com.android.systemui.SysuiTestCase;
import org.junit.Before;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/keyguard/WorkLockActivityControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/keyguard/WorkLockActivityControllerTest.java
index cf32760..7ccf905 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/keyguard/WorkLockActivityControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/keyguard/WorkLockActivityControllerTest.java
@@ -16,13 +16,13 @@
package com.android.systemui.keyguard;
+import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.anyInt;
+import static org.mockito.Matchers.argThat;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.eq;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyInt;
-import static org.mockito.Matchers.argThat;
import android.app.Activity;
import android.app.ActivityManager;
@@ -36,8 +36,9 @@
import android.os.Bundle;
import android.os.IBinder;
import android.os.UserHandle;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import com.android.systemui.SysuiTestCase;
import com.android.systemui.recents.misc.SysUiTaskStackChangeListener;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/keyguard/WorkLockActivityTest.java b/packages/SystemUI/tests/src/com/android/systemui/keyguard/WorkLockActivityTest.java
index 9f3573f..6e726cf 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/keyguard/WorkLockActivityTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/keyguard/WorkLockActivityTest.java
@@ -17,13 +17,11 @@
package com.android.systemui.keyguard;
import static android.app.ActivityManager.TaskDescription;
+
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.eq;
import static org.mockito.Mockito.when;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
-
import android.annotation.ColorInt;
import android.annotation.UserIdInt;
import android.app.KeyguardManager;
@@ -33,6 +31,9 @@
import android.graphics.Color;
import android.os.Looper;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.systemui.SysuiTestCase;
import com.android.systemui.keyguard.WorkLockActivity;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/pip/phone/PipTouchStateTest.java b/packages/SystemUI/tests/src/com/android/systemui/pip/phone/PipTouchStateTest.java
index b7c1e8e..3155e57 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/pip/phone/PipTouchStateTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/pip/phone/PipTouchStateTest.java
@@ -26,13 +26,14 @@
import android.os.Handler;
import android.os.Looper;
import android.os.SystemClock;
-import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.testing.TestableLooper.RunWithLooper;
import android.view.MotionEvent;
import android.view.ViewConfiguration;
+import androidx.test.filters.SmallTest;
+
import com.android.systemui.SysuiTestCase;
import org.junit.Before;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/plugins/PluginInstanceManagerTest.java b/packages/SystemUI/tests/src/com/android/systemui/plugins/PluginInstanceManagerTest.java
index 04441ab..0045d9d 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/plugins/PluginInstanceManagerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/plugins/PluginInstanceManagerTest.java
@@ -17,6 +17,7 @@
import static junit.framework.Assert.assertFalse;
import static junit.framework.Assert.assertNotNull;
import static junit.framework.Assert.assertTrue;
+
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyInt;
import static org.mockito.Matchers.eq;
@@ -25,19 +26,6 @@
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
-import com.android.internal.messages.nano.SystemMessageProto.SystemMessage;
-import com.android.systemui.SysuiTestCase;
-import com.android.systemui.plugins.PluginInstanceManager.PluginInfo;
-import com.android.systemui.plugins.VersionInfo.InvalidVersionException;
-import com.android.systemui.plugins.annotations.Requires;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.ArgumentCaptor;
-import org.mockito.Mockito;
-
import android.app.Activity;
import android.app.NotificationManager;
import android.content.BroadcastReceiver;
@@ -52,10 +40,24 @@
import android.content.pm.ServiceInfo;
import android.os.HandlerThread;
import android.os.UserHandle;
-import android.support.test.annotation.UiThreadTest;
-import android.support.test.runner.AndroidJUnit4;
import android.test.suitebuilder.annotation.SmallTest;
+import androidx.test.annotation.UiThreadTest;
+import androidx.test.runner.AndroidJUnit4;
+
+import com.android.internal.messages.nano.SystemMessageProto.SystemMessage;
+import com.android.systemui.SysuiTestCase;
+import com.android.systemui.plugins.PluginInstanceManager.PluginInfo;
+import com.android.systemui.plugins.VersionInfo.InvalidVersionException;
+import com.android.systemui.plugins.annotations.Requires;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.ArgumentCaptor;
+import org.mockito.Mockito;
+
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/plugins/PluginManagerTest.java b/packages/SystemUI/tests/src/com/android/systemui/plugins/PluginManagerTest.java
index 94dbc2a..dfbb855 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/plugins/PluginManagerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/plugins/PluginManagerTest.java
@@ -26,8 +26,6 @@
import android.content.Intent;
import android.content.pm.PackageManager;
import android.net.Uri;
-import android.support.test.annotation.UiThreadTest;
-import android.support.test.runner.AndroidJUnit4;
import android.test.suitebuilder.annotation.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
@@ -36,11 +34,10 @@
import com.android.internal.messages.nano.SystemMessageProto.SystemMessage;
import com.android.systemui.Dependency;
import com.android.systemui.SysuiTestCase;
-import com.android.systemui.plugins.annotations.ProvidesInterface;
import com.android.systemui.plugins.PluginInstanceManager.PluginInfo;
import com.android.systemui.plugins.PluginManagerImpl.PluginInstanceManagerFactory;
+import com.android.systemui.plugins.annotations.ProvidesInterface;
-import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/plugins/VersionInfoTest.java b/packages/SystemUI/tests/src/com/android/systemui/plugins/VersionInfoTest.java
index 0b4d9b5..6a2f739 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/plugins/VersionInfoTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/plugins/VersionInfoTest.java
@@ -17,13 +17,13 @@
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
-import android.support.test.filters.SmallTest;
+import androidx.test.filters.SmallTest;
import com.android.systemui.SysuiTestCase;
import com.android.systemui.plugins.VersionInfo.InvalidVersionException;
import com.android.systemui.plugins.annotations.Requires;
-import com.android.systemui.plugins.qs.QS;
import com.android.systemui.plugins.qs.DetailAdapter;
+import com.android.systemui.plugins.qs.QS;
import com.android.systemui.plugins.qs.QS.HeightListener;
import org.junit.Rule;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/power/PowerNotificationWarningsTest.java b/packages/SystemUI/tests/src/com/android/systemui/power/PowerNotificationWarningsTest.java
index bf6cc53..47a969b 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/power/PowerNotificationWarningsTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/power/PowerNotificationWarningsTest.java
@@ -16,9 +16,6 @@
package com.android.systemui.power;
-import static android.test.MoreAsserts.assertNotEqual;
-
-import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertFalse;
import static junit.framework.Assert.assertTrue;
@@ -31,14 +28,14 @@
import android.app.Notification;
import android.app.NotificationManager;
-import android.support.test.runner.AndroidJUnit4;
import android.test.suitebuilder.annotation.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.internal.messages.nano.SystemMessageProto.SystemMessage;
import com.android.systemui.SysuiTestCase;
import com.android.systemui.util.NotificationChannels;
-import java.util.concurrent.TimeUnit;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/qs/AutoAddTrackerTest.java b/packages/SystemUI/tests/src/com/android/systemui/qs/AutoAddTrackerTest.java
index dfc1852..0ae9461 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/qs/AutoAddTrackerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/qs/AutoAddTrackerTest.java
@@ -22,10 +22,11 @@
import static org.junit.Assert.assertTrue;
import android.provider.Settings.Secure;
-import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper.RunWithLooper;
+import androidx.test.filters.SmallTest;
+
import com.android.systemui.Prefs;
import com.android.systemui.Prefs.Key;
import com.android.systemui.SysuiTestCase;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/qs/QSDetailTest.java b/packages/SystemUI/tests/src/com/android/systemui/qs/QSDetailTest.java
index f845f3a..8879e83 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/qs/QSDetailTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/qs/QSDetailTest.java
@@ -23,7 +23,6 @@
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
-import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.testing.TestableLooper.RunWithLooper;
@@ -31,6 +30,8 @@
import android.view.LayoutInflater;
import android.view.View;
+import androidx.test.filters.SmallTest;
+
import com.android.internal.logging.MetricsLogger;
import com.android.systemui.R;
import com.android.systemui.SysuiTestCase;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/qs/QSFooterImplTest.java b/packages/SystemUI/tests/src/com/android/systemui/qs/QSFooterImplTest.java
index 703b4d5..d963689 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/qs/QSFooterImplTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/qs/QSFooterImplTest.java
@@ -20,13 +20,14 @@
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
-import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.testing.TestableLooper.RunWithLooper;
import android.view.LayoutInflater;
import android.view.View;
+import androidx.test.filters.SmallTest;
+
import com.android.systemui.R;
import com.android.systemui.R.id;
import com.android.systemui.plugins.ActivityStarter;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/qs/QSFragmentTest.java b/packages/SystemUI/tests/src/com/android/systemui/qs/QSFragmentTest.java
index 8cece92..8a27f12 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/qs/QSFragmentTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/qs/QSFragmentTest.java
@@ -18,37 +18,31 @@
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;
-import android.app.FragmentController;
-import android.app.FragmentManagerNonConfig;
+import android.content.Context;
import android.os.Looper;
-import android.support.test.filters.FlakyTest;
+import android.testing.AndroidTestingRunner;
+import android.testing.LayoutInflaterBuilder;
+import android.testing.TestableLooper;
+import android.testing.TestableLooper.RunWithLooper;
+import android.view.View;
+import android.widget.FrameLayout;
+
+import androidx.test.filters.SmallTest;
import com.android.internal.logging.MetricsLogger;
import com.android.keyguard.CarrierText;
import com.android.systemui.Dependency;
import com.android.systemui.R;
-
-import android.os.Parcelable;
-import android.support.test.filters.SmallTest;
-import android.testing.AndroidTestingRunner;
-
import com.android.systemui.SysuiBaseFragmentTest;
import com.android.systemui.statusbar.phone.StatusBarIconController;
import com.android.systemui.statusbar.policy.Clock;
import com.android.systemui.statusbar.policy.UserSwitcherController;
-import android.testing.LayoutInflaterBuilder;
-import android.testing.TestableLooper;
-import android.testing.TestableLooper.RunWithLooper;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
-import android.content.Context;
-import android.view.View;
-import android.widget.FrameLayout;
-
@RunWith(AndroidTestingRunner.class)
@RunWithLooper(setAsMainLooper = true)
@SmallTest
diff --git a/packages/SystemUI/tests/src/com/android/systemui/qs/QSPanelTest.java b/packages/SystemUI/tests/src/com/android/systemui/qs/QSPanelTest.java
index 85cdfcc..973a5e9e 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/qs/QSPanelTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/qs/QSPanelTest.java
@@ -19,11 +19,12 @@
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
-import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.testing.TestableLooper.RunWithLooper;
+import androidx.test.filters.SmallTest;
+
import com.android.internal.logging.MetricsLogger;
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.systemui.SysuiTestCase;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/qs/SlashImageViewTest.java b/packages/SystemUI/tests/src/com/android/systemui/qs/SlashImageViewTest.java
index e2159d2..ea8c64a 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/qs/SlashImageViewTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/qs/SlashImageViewTest.java
@@ -16,26 +16,25 @@
package com.android.systemui.qs;
-import android.content.Context;
-import android.graphics.drawable.Drawable;
-import android.support.test.filters.SmallTest;
-import android.testing.AndroidTestingRunner;
-import android.testing.TestableLooper.RunWithLooper;
-import com.android.systemui.SysuiTestCase;
-import com.android.systemui.plugins.qs.QSTile.SlashState;
-import com.android.systemui.qs.tileimpl.SlashImageView;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
-import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
+import android.content.Context;
+import android.graphics.drawable.Drawable;
+import android.testing.AndroidTestingRunner;
+import android.testing.TestableLooper.RunWithLooper;
+
+import androidx.test.filters.SmallTest;
+
+import com.android.systemui.SysuiTestCase;
+import com.android.systemui.plugins.qs.QSTile.SlashState;
+import com.android.systemui.qs.tileimpl.SlashImageView;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
@SmallTest
@RunWith(AndroidTestingRunner.class)
diff --git a/packages/SystemUI/tests/src/com/android/systemui/qs/TileLayoutTest.java b/packages/SystemUI/tests/src/com/android/systemui/qs/TileLayoutTest.java
index 2040e75..fef47bd 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/qs/TileLayoutTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/qs/TileLayoutTest.java
@@ -27,12 +27,12 @@
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
-import android.support.test.runner.AndroidJUnit4;
import android.test.suitebuilder.annotation.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.systemui.R;
import com.android.systemui.SysuiTestCase;
-import com.android.systemui.plugins.qs.QSIconView;
import com.android.systemui.plugins.qs.QSTile;
import com.android.systemui.qs.tileimpl.QSIconViewImpl;
import com.android.systemui.qs.tileimpl.QSTileView;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/qs/TouchAnimatorTest.java b/packages/SystemUI/tests/src/com/android/systemui/qs/TouchAnimatorTest.java
index 4cc0e20..c43c3e6 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/qs/TouchAnimatorTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/qs/TouchAnimatorTest.java
@@ -14,17 +14,20 @@
package com.android.systemui.qs;
-import android.support.test.runner.AndroidJUnit4;
+import static junit.framework.Assert.assertEquals;
+
import android.test.suitebuilder.annotation.SmallTest;
import android.view.View;
-import com.android.systemui.qs.TouchAnimator.Listener;
-import com.android.systemui.SysuiTestCase;
-import org.junit.Before;
-import org.junit.runner.RunWith;
-import org.junit.Test;
-import org.mockito.Mockito;
-import static junit.framework.Assert.assertEquals;
+import androidx.test.runner.AndroidJUnit4;
+
+import com.android.systemui.SysuiTestCase;
+import com.android.systemui.qs.TouchAnimator.Listener;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mockito;
@SmallTest
@RunWith(AndroidJUnit4.class)
diff --git a/packages/SystemUI/tests/src/com/android/systemui/qs/car/CarQsFragmentTest.java b/packages/SystemUI/tests/src/com/android/systemui/qs/car/CarQsFragmentTest.java
index c3defa4..24a0b69 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/qs/car/CarQsFragmentTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/qs/car/CarQsFragmentTest.java
@@ -17,7 +17,6 @@
import static org.mockito.Mockito.mock;
import android.content.Context;
-import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.LayoutInflaterBuilder;
import android.testing.TestableLooper;
@@ -25,6 +24,8 @@
import android.view.View;
import android.widget.FrameLayout;
+import androidx.test.filters.SmallTest;
+
import com.android.keyguard.CarrierText;
import com.android.systemui.Dependency;
import com.android.systemui.SysuiBaseFragmentTest;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/qs/customize/TileAdapterTest.java b/packages/SystemUI/tests/src/com/android/systemui/qs/customize/TileAdapterTest.java
index 0239ab0..25bac7a 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/qs/customize/TileAdapterTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/qs/customize/TileAdapterTest.java
@@ -18,11 +18,12 @@
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
-import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.testing.TestableLooper.RunWithLooper;
+import androidx.test.filters.SmallTest;
+
import com.android.systemui.SysuiTestCase;
import com.android.systemui.qs.QSTileHost;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/qs/customize/TileQueryHelperTest.java b/packages/SystemUI/tests/src/com/android/systemui/qs/customize/TileQueryHelperTest.java
index f63d236..c10ad58 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/qs/customize/TileQueryHelperTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/qs/customize/TileQueryHelperTest.java
@@ -14,7 +14,6 @@
package com.android.systemui.qs.customize;
-import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertTrue;
import static org.junit.Assert.assertFalse;
@@ -23,11 +22,12 @@
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
-import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.testing.TestableLooper.RunWithLooper;
+import androidx.test.filters.SmallTest;
+
import com.android.systemui.Dependency;
import com.android.systemui.SysuiTestCase;
import com.android.systemui.qs.QSTileHost;
@@ -38,8 +38,6 @@
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
-import java.util.ArrayList;
-
@SmallTest
@RunWith(AndroidTestingRunner.class)
@RunWithLooper
diff --git a/packages/SystemUI/tests/src/com/android/systemui/qs/external/TileColorPickerTest.java b/packages/SystemUI/tests/src/com/android/systemui/qs/external/TileColorPickerTest.java
index ba451e1..ec8552b 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/qs/external/TileColorPickerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/qs/external/TileColorPickerTest.java
@@ -15,17 +15,20 @@
*/
package com.android.systemui.qs.external;
+import static junit.framework.Assert.assertEquals;
+
import android.content.res.ColorStateList;
import android.service.quicksettings.Tile;
-import android.support.test.runner.AndroidJUnit4;
import android.test.suitebuilder.annotation.SmallTest;
+
+import androidx.test.runner.AndroidJUnit4;
+
+import com.android.systemui.R;
import com.android.systemui.SysuiTestCase;
+
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import com.android.systemui.R;
-
-import static junit.framework.Assert.assertEquals;
@SmallTest
@RunWith(AndroidJUnit4.class)
diff --git a/packages/SystemUI/tests/src/com/android/systemui/qs/external/TileLifecycleManagerTest.java b/packages/SystemUI/tests/src/com/android/systemui/qs/external/TileLifecycleManagerTest.java
index e5e8ae3..f35295c 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/qs/external/TileLifecycleManagerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/qs/external/TileLifecycleManagerTest.java
@@ -40,9 +40,10 @@
import android.service.quicksettings.IQSTileService;
import android.service.quicksettings.Tile;
import android.service.quicksettings.TileService;
-import android.support.test.runner.AndroidJUnit4;
import android.test.suitebuilder.annotation.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.systemui.SysuiTestCase;
import org.junit.After;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/qs/external/TileServiceManagerTest.java b/packages/SystemUI/tests/src/com/android/systemui/qs/external/TileServiceManagerTest.java
index cc743245..683e8f4 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/qs/external/TileServiceManagerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/qs/external/TileServiceManagerTest.java
@@ -15,12 +15,19 @@
*/
package com.android.systemui.qs.external;
+import static junit.framework.Assert.assertEquals;
+import static junit.framework.Assert.assertFalse;
+import static junit.framework.Assert.assertTrue;
+
import android.content.ComponentName;
import android.os.Handler;
import android.os.HandlerThread;
-import android.support.test.runner.AndroidJUnit4;
import android.test.suitebuilder.annotation.SmallTest;
+
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.systemui.SysuiTestCase;
+
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -28,10 +35,6 @@
import org.mockito.ArgumentCaptor;
import org.mockito.Mockito;
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertTrue;
-
@SmallTest
@RunWith(AndroidJUnit4.class)
public class TileServiceManagerTest extends SysuiTestCase {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/qs/tileimpl/QSIconViewImplTest.java b/packages/SystemUI/tests/src/com/android/systemui/qs/tileimpl/QSIconViewImplTest.java
index f9f4f497..633315e 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/qs/tileimpl/QSIconViewImplTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/qs/tileimpl/QSIconViewImplTest.java
@@ -21,14 +21,14 @@
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
-import android.content.res.ColorStateList;
import android.graphics.drawable.Drawable;
import android.service.quicksettings.Tile;
-import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.UiThreadTest;
import android.widget.ImageView;
+import androidx.test.filters.SmallTest;
+
import com.android.systemui.SysuiTestCase;
import com.android.systemui.plugins.qs.QSTile.Icon;
import com.android.systemui.plugins.qs.QSTile.State;
@@ -36,7 +36,6 @@
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.ArgumentMatcher;
@RunWith(AndroidTestingRunner.class)
@UiThreadTest
diff --git a/packages/SystemUI/tests/src/com/android/systemui/qs/tileimpl/QSTileImplTest.java b/packages/SystemUI/tests/src/com/android/systemui/qs/tileimpl/QSTileImplTest.java
index 6764634..03e67af 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/qs/tileimpl/QSTileImplTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/qs/tileimpl/QSTileImplTest.java
@@ -32,16 +32,14 @@
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
-import static java.lang.Thread.sleep;
-
import android.content.Intent;
import android.metrics.LogMaker;
-import android.support.test.filters.SmallTest;
-import android.support.test.InstrumentationRegistry;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.testing.TestableLooper.RunWithLooper;
+import androidx.test.filters.SmallTest;
+
import com.android.internal.logging.MetricsLogger;
import com.android.systemui.Dependency;
import com.android.systemui.SysuiTestCase;
@@ -55,6 +53,8 @@
import org.junit.runner.RunWith;
import org.mockito.ArgumentMatcher;
+import static java.lang.Thread.sleep;
+
@RunWith(AndroidTestingRunner.class)
@RunWithLooper
@SmallTest
diff --git a/packages/SystemUI/tests/src/com/android/systemui/recents/RecentsTest.java b/packages/SystemUI/tests/src/com/android/systemui/recents/RecentsTest.java
index bdbd244..6bbe249 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/recents/RecentsTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/recents/RecentsTest.java
@@ -27,8 +27,9 @@
import android.app.ActivityManager.RunningTaskInfo;
import android.app.IActivityManager;
import android.os.SystemClock;
-import android.support.test.filters.MediumTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.filters.MediumTest;
+import androidx.test.runner.AndroidJUnit4;
import com.android.systemui.SysuiTestCase;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/settings/CurrentUserTrackerTest.java b/packages/SystemUI/tests/src/com/android/systemui/settings/CurrentUserTrackerTest.java
index 17d7a41..4162bc1 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/settings/CurrentUserTrackerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/settings/CurrentUserTrackerTest.java
@@ -17,7 +17,8 @@
package com.android.systemui.settings;
import android.content.Intent;
-import android.support.test.filters.SmallTest;
+
+import androidx.test.filters.SmallTest;
import com.android.systemui.SysuiTestCase;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/AppOpsListenerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/AppOpsListenerTest.java
index 0feaa5a..ee4fbc8 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/AppOpsListenerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/AppOpsListenerTest.java
@@ -23,10 +23,11 @@
import android.app.AppOpsManager;
import android.os.Handler;
import android.os.Looper;
-import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
+import androidx.test.filters.SmallTest;
+
import com.android.systemui.ForegroundServiceController;
import com.android.systemui.SysuiTestCase;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/CommandQueueTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/CommandQueueTest.java
index a02ef98..9659235 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/CommandQueueTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/CommandQueueTest.java
@@ -22,7 +22,8 @@
import android.content.ComponentName;
import android.graphics.Rect;
import android.os.Bundle;
-import android.support.test.filters.SmallTest;
+
+import androidx.test.filters.SmallTest;
import com.android.internal.statusbar.StatusBarIcon;
import com.android.systemui.SysuiTestCase;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/ExpandableNotificationRowTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/ExpandableNotificationRowTest.java
index ff12c53..210aa56 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/ExpandableNotificationRowTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/ExpandableNotificationRowTest.java
@@ -33,13 +33,14 @@
import android.app.AppOpsManager;
import android.app.NotificationChannel;
-import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper.RunWithLooper;
import android.util.ArraySet;
import android.view.NotificationHeaderView;
import android.view.View;
+import androidx.test.filters.SmallTest;
+
import com.android.systemui.SysuiTestCase;
import com.android.systemui.plugins.statusbar.NotificationMenuRowPlugin;
import com.android.systemui.statusbar.notification.AboveShelfChangedListener;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/FooterViewTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/FooterViewTest.java
index e6fdfa4..a7e14dc7 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/FooterViewTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/FooterViewTest.java
@@ -16,23 +16,18 @@
package com.android.systemui.statusbar;
-import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertFalse;
import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertNull;
import static junit.framework.Assert.assertTrue;
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.ArgumentMatchers.eq;
-import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.spy;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
import android.view.LayoutInflater;
import android.view.View;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.systemui.R;
import com.android.systemui.SysuiTestCase;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/KeyguardIndicationControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/KeyguardIndicationControllerTest.java
index bdd05c7..6e5af99 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/KeyguardIndicationControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/KeyguardIndicationControllerTest.java
@@ -30,12 +30,13 @@
import android.content.Context;
import android.hardware.fingerprint.FingerprintManager;
import android.os.Looper;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
import android.view.View;
import android.view.ViewGroup;
+import androidx.test.InstrumentationRegistry;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.keyguard.KeyguardUpdateMonitorCallback;
import com.android.systemui.R;
import com.android.systemui.SysuiTestCase;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NonPhoneDependencyTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NonPhoneDependencyTest.java
index 2af0c3e..4a8f287 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NonPhoneDependencyTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NonPhoneDependencyTest.java
@@ -21,10 +21,11 @@
import android.os.Handler;
import android.os.Looper;
-import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
+import androidx.test.filters.SmallTest;
+
import com.android.systemui.Dependency;
import com.android.systemui.SysuiTestCase;
import com.android.systemui.statusbar.phone.NotificationGroupManager;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationBlockingHelperManagerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationBlockingHelperManagerTest.java
index 9638541..41ee732 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationBlockingHelperManagerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationBlockingHelperManagerTest.java
@@ -16,27 +16,10 @@
package com.android.systemui.statusbar;
-import com.android.systemui.SysuiTestCase;
-import com.android.systemui.plugins.statusbar.NotificationMenuRowPlugin;
-
-import android.content.Context;
-import android.support.test.filters.FlakyTest;
-import android.support.test.filters.SmallTest;
-import android.testing.AndroidTestingRunner;
-import android.testing.TestableLooper;
-import android.view.View;
-
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-import org.mockito.junit.MockitoJUnit;
-import org.mockito.junit.MockitoRule;
-
import static android.service.notification.NotificationListenerService.Ranking.USER_SENTIMENT_NEGATIVE;
import static android.service.notification.NotificationListenerService.Ranking.USER_SENTIMENT_NEUTRAL;
import static android.service.notification.NotificationListenerService.Ranking.USER_SENTIMENT_POSITIVE;
+
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.mockito.ArgumentMatchers.any;
@@ -46,6 +29,22 @@
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
+import android.content.Context;
+import android.testing.AndroidTestingRunner;
+import android.testing.TestableLooper;
+import android.view.View;
+
+import androidx.test.filters.FlakyTest;
+import androidx.test.filters.SmallTest;
+
+import com.android.systemui.SysuiTestCase;
+import com.android.systemui.plugins.statusbar.NotificationMenuRowPlugin;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+
/**
* Tests for {@link NotificationBlockingHelperManager}.
*/
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationContentViewTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationContentViewTest.java
index 1fb4c37..c4a80a7 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationContentViewTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationContentViewTest.java
@@ -28,13 +28,14 @@
import static org.mockito.Mockito.when;
import android.app.AppOpsManager;
-import android.support.test.annotation.UiThreadTest;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
import android.util.ArraySet;
import android.view.NotificationHeaderView;
import android.view.View;
+import androidx.test.annotation.UiThreadTest;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.systemui.SysuiTestCase;
import org.junit.Assert;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationCustomViewWrapperTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationCustomViewWrapperTest.java
index a34588d..99fe445 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationCustomViewWrapperTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationCustomViewWrapperTest.java
@@ -16,12 +16,13 @@
package com.android.systemui.statusbar;
-import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper.RunWithLooper;
import android.view.View;
import android.widget.RemoteViews;
+import androidx.test.filters.SmallTest;
+
import com.android.systemui.R;
import com.android.systemui.SysuiTestCase;
import com.android.systemui.statusbar.notification.NotificationCustomViewWrapper;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationDataTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationDataTest.java
index 77522e4..f62b13c 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationDataTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationDataTest.java
@@ -44,12 +44,13 @@
import android.os.Bundle;
import android.service.notification.NotificationListenerService;
import android.service.notification.StatusBarNotification;
-import android.support.test.annotation.UiThreadTest;
-import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper.RunWithLooper;
import android.util.ArraySet;
+import androidx.test.annotation.UiThreadTest;
+import androidx.test.filters.SmallTest;
+
import com.android.systemui.ForegroundServiceController;
import com.android.systemui.SysuiTestCase;
import com.android.systemui.statusbar.phone.NotificationGroupManager;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationEntryManagerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationEntryManagerTest.java
index afe16cf..2e14e71 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationEntryManagerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationEntryManagerTest.java
@@ -19,7 +19,6 @@
import static junit.framework.Assert.assertNotNull;
import static junit.framework.Assert.assertNull;
import static junit.framework.Assert.assertTrue;
-import static junit.framework.Assert.assertFalse;
import static org.junit.Assert.assertEquals;
import static org.mockito.ArgumentMatchers.any;
@@ -43,12 +42,13 @@
import android.os.UserHandle;
import android.service.notification.NotificationListenerService;
import android.service.notification.StatusBarNotification;
-import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.util.ArraySet;
import android.widget.FrameLayout;
+import androidx.test.filters.SmallTest;
+
import com.android.internal.logging.MetricsLogger;
import com.android.internal.statusbar.IStatusBarService;
import com.android.systemui.ForegroundServiceController;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationGutsManagerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationGutsManagerTest.java
index cba1b54..72e932c 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationGutsManagerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationGutsManagerTest.java
@@ -19,8 +19,8 @@
import static android.app.AppOpsManager.OP_CAMERA;
import static android.app.AppOpsManager.OP_RECORD_AUDIO;
import static android.app.AppOpsManager.OP_SYSTEM_ALERT_WINDOW;
-
import static android.service.notification.NotificationListenerService.Ranking.USER_SENTIMENT_NEGATIVE;
+
import static junit.framework.Assert.assertNotNull;
import static org.junit.Assert.assertEquals;
@@ -32,10 +32,10 @@
import static org.mockito.ArgumentMatchers.isNull;
import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
import static org.mockito.Mockito.spy;
-import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
import android.app.INotificationManager;
import android.app.Notification;
@@ -47,12 +47,13 @@
import android.os.Handler;
import android.provider.Settings;
import android.service.notification.StatusBarNotification;
-import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.util.ArraySet;
import android.view.View;
+import androidx.test.filters.SmallTest;
+
import com.android.systemui.SysuiTestCase;
import com.android.systemui.plugins.statusbar.NotificationMenuRowPlugin;
import com.android.systemui.statusbar.stack.NotificationStackScrollLayout;
@@ -63,11 +64,8 @@
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
import org.mockito.Mock;
-import org.mockito.junit.MockitoRule;
import org.mockito.junit.MockitoJUnit;
-
-import java.util.HashSet;
-import java.util.Set;
+import org.mockito.junit.MockitoRule;
/**
* Tests for {@link NotificationGutsManager}.
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationListenerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationListenerTest.java
index 26f91b3..cab762c 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationListenerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationListenerTest.java
@@ -16,8 +16,6 @@
package com.android.systemui.statusbar;
-import static junit.framework.Assert.assertTrue;
-
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@@ -28,10 +26,11 @@
import android.os.UserHandle;
import android.service.notification.NotificationListenerService;
import android.service.notification.StatusBarNotification;
-import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
+import androidx.test.filters.SmallTest;
+
import com.android.systemui.SysuiTestCase;
import org.junit.Before;
@@ -40,9 +39,6 @@
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
-import java.util.HashSet;
-import java.util.Set;
-
@SmallTest
@RunWith(AndroidTestingRunner.class)
@TestableLooper.RunWithLooper
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationLockscreenUserManagerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationLockscreenUserManagerTest.java
index 2401519..849ae89 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationLockscreenUserManagerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationLockscreenUserManagerTest.java
@@ -36,10 +36,11 @@
import android.os.Looper;
import android.os.UserManager;
import android.provider.Settings;
-import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
+import androidx.test.filters.SmallTest;
+
import com.android.systemui.SysuiTestCase;
import com.android.systemui.statusbar.policy.DeviceProvisionedController;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationLoggerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationLoggerTest.java
index 42bf290..760c66d 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationLoggerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationLoggerTest.java
@@ -30,10 +30,11 @@
import android.os.RemoteException;
import android.os.UserHandle;
import android.service.notification.StatusBarNotification;
-import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
+import androidx.test.filters.SmallTest;
+
import com.android.internal.statusbar.IStatusBarService;
import com.android.internal.statusbar.NotificationVisibility;
import com.android.systemui.SysuiTestCase;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationMenuRowTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationMenuRowTest.java
index 2a5a1ee..088b01d 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationMenuRowTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationMenuRowTest.java
@@ -22,15 +22,14 @@
import android.app.Notification;
import android.service.notification.StatusBarNotification;
-import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.testing.TestableLooper.RunWithLooper;
import android.testing.ViewUtils;
-import android.testing.ViewUtils;
-import android.view.View;
import android.view.ViewGroup;
+import androidx.test.filters.SmallTest;
+
import com.android.systemui.plugins.statusbar.NotificationMenuRowPlugin;
import com.android.systemui.utils.leaks.LeakCheckedTest;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationRemoteInputManagerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationRemoteInputManagerTest.java
index 7a2cb3a..9066b88 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationRemoteInputManagerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationRemoteInputManagerTest.java
@@ -13,10 +13,11 @@
import android.os.UserHandle;
import android.service.notification.NotificationListenerService;
import android.service.notification.StatusBarNotification;
-import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
+import androidx.test.filters.SmallTest;
+
import com.android.systemui.SysuiTestCase;
import com.google.android.collect.Sets;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationTestHelper.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationTestHelper.java
index 2b0c6bf..ae89e5c 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationTestHelper.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationTestHelper.java
@@ -23,11 +23,12 @@
import android.content.Context;
import android.os.UserHandle;
import android.service.notification.StatusBarNotification;
-import android.support.test.InstrumentationRegistry;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.widget.RemoteViews;
+import androidx.test.InstrumentationRegistry;
+
import com.android.systemui.R;
import com.android.systemui.statusbar.notification.NotificationInflaterTest;
import com.android.systemui.statusbar.phone.HeadsUpManagerPhone;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationViewHierarchyManagerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationViewHierarchyManagerTest.java
index 0d0d1f86..a64ca5c 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationViewHierarchyManagerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationViewHierarchyManagerTest.java
@@ -25,13 +25,14 @@
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
-import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
+import androidx.test.filters.SmallTest;
+
import com.android.systemui.SysuiTestCase;
import com.android.systemui.plugins.statusbar.NotificationSwipeActionHelper;
import com.android.systemui.statusbar.notification.VisualStabilityManager;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/ScrimViewTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/ScrimViewTest.java
index 42dad11..0c1fa4e 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/ScrimViewTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/ScrimViewTest.java
@@ -28,13 +28,14 @@
import android.graphics.Rect;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
-import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.testing.TestableLooper.RunWithLooper;
import android.testing.ViewUtils;
import android.view.View;
+import androidx.test.filters.SmallTest;
+
import com.android.internal.colorextraction.ColorExtractor;
import com.android.internal.colorextraction.drawable.GradientDrawable;
import com.android.systemui.statusbar.policy.ConfigurationController;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/SmartReplyControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/SmartReplyControllerTest.java
index e91530d..8d5e381 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/SmartReplyControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/SmartReplyControllerTest.java
@@ -16,6 +16,7 @@
import static junit.framework.Assert.assertFalse;
import static junit.framework.Assert.assertTrue;
+
import static org.mockito.ArgumentMatchers.argThat;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.ArgumentMatchers.isNull;
@@ -26,10 +27,11 @@
import android.app.Notification;
import android.os.RemoteException;
import android.service.notification.StatusBarNotification;
-import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
+import androidx.test.filters.SmallTest;
+
import com.android.internal.statusbar.IStatusBarService;
import com.android.systemui.R;
import com.android.systemui.SysuiTestCase;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/StatusBarIconListTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/StatusBarIconListTest.java
index e529e4c..4c20b61 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/StatusBarIconListTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/StatusBarIconListTest.java
@@ -1,6 +1,7 @@
package com.android.systemui.statusbar;
import static com.android.systemui.statusbar.phone.StatusBarIconController.TAG_PRIMARY;
+
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertNull;
import static junit.framework.Assert.assertTrue;
@@ -8,19 +9,21 @@
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
-import android.support.test.runner.AndroidJUnit4;
import android.test.suitebuilder.annotation.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.systemui.SysuiTestCase;
import com.android.systemui.statusbar.phone.StatusBarIconHolder;
import com.android.systemui.statusbar.phone.StatusBarIconList;
import com.android.systemui.statusbar.phone.StatusBarIconList.Slot;
-import java.util.ArrayList;
-import java.util.List;
import org.junit.Test;
import org.junit.runner.RunWith;
+import java.util.ArrayList;
+import java.util.List;
+
@SmallTest
@RunWith(AndroidJUnit4.class)
public class StatusBarIconListTest extends SysuiTestCase {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/StatusBarIconViewTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/StatusBarIconViewTest.java
index 7b2071c..c995ab2 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/StatusBarIconViewTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/StatusBarIconViewTest.java
@@ -38,8 +38,9 @@
import android.graphics.Color;
import android.graphics.drawable.Icon;
import android.os.UserHandle;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import com.android.internal.statusbar.StatusBarIcon;
import com.android.internal.util.NotificationColorUtil;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/AboveShelfObserverTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/AboveShelfObserverTest.java
index 00e9995..82e4b08 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/AboveShelfObserverTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/AboveShelfObserverTest.java
@@ -19,7 +19,6 @@
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
-import android.support.test.runner.AndroidJUnit4;
import android.test.suitebuilder.annotation.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper.RunWithLooper;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/MediaNotificationProcessorTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/MediaNotificationProcessorTest.java
index 5d3a86d..b03abec 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/MediaNotificationProcessorTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/MediaNotificationProcessorTest.java
@@ -27,10 +27,11 @@
import android.app.Notification;
import android.graphics.Bitmap;
import android.graphics.drawable.Drawable;
-import android.support.test.runner.AndroidJUnit4;
import android.test.suitebuilder.annotation.SmallTest;
import android.widget.RemoteViews;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.systemui.R;
import com.android.systemui.SysuiTestCase;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationInflaterTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationInflaterTest.java
index aa8a08c..a9ee8a8 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationInflaterTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationInflaterTest.java
@@ -29,13 +29,14 @@
import android.os.Handler;
import android.os.Looper;
import android.service.notification.StatusBarNotification;
-import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper.RunWithLooper;
import android.view.View;
import android.view.ViewGroup;
import android.widget.RemoteViews;
+import androidx.test.filters.SmallTest;
+
import com.android.systemui.R;
import com.android.systemui.SysuiTestCase;
import com.android.systemui.statusbar.ExpandableNotificationRow;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationViewWrapperTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationViewWrapperTest.java
index 7e2e505..6071c7b 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationViewWrapperTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationViewWrapperTest.java
@@ -17,18 +17,16 @@
package com.android.systemui.statusbar.notification;
import android.content.Context;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper.RunWithLooper;
import android.view.View;
+import androidx.test.filters.SmallTest;
+
import com.android.systemui.SysuiTestCase;
import com.android.systemui.statusbar.ExpandableNotificationRow;
import com.android.systemui.statusbar.NotificationTestHelper;
-import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/VisualStabilityManagerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/VisualStabilityManagerTest.java
index 95ce0d8..52c8049 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/VisualStabilityManagerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/VisualStabilityManagerTest.java
@@ -16,10 +16,18 @@
package com.android.systemui.statusbar.notification;
+import static junit.framework.Assert.assertEquals;
+
+import static org.mockito.Matchers.anyObject;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
import android.service.notification.StatusBarNotification;
-import android.support.test.runner.AndroidJUnit4;
import android.test.suitebuilder.annotation.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.systemui.SysuiTestCase;
import com.android.systemui.statusbar.ExpandableNotificationRow;
import com.android.systemui.statusbar.NotificationData;
@@ -30,12 +38,6 @@
import org.junit.Test;
import org.junit.runner.RunWith;
-import static junit.framework.Assert.assertEquals;
-import static org.mockito.Matchers.anyObject;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-
@SmallTest
@RunWith(AndroidJUnit4.class)
public class VisualStabilityManagerTest extends SysuiTestCase {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/AutoTileManagerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/AutoTileManagerTest.java
index 23365a4..8a6bdc2 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/AutoTileManagerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/AutoTileManagerTest.java
@@ -20,21 +20,21 @@
import static org.mockito.Mockito.verify;
import android.os.Handler;
-import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.testing.TestableLooper.RunWithLooper;
+
+import androidx.test.filters.SmallTest;
+
import com.android.internal.app.ColorDisplayController;
-import com.android.systemui.Dependency;
-import com.android.systemui.Prefs;
import com.android.systemui.SysuiTestCase;
import com.android.systemui.qs.AutoAddTracker;
import com.android.systemui.qs.QSTileHost;
+
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
-import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
@RunWith(AndroidTestingRunner.class)
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CollapsedStatusBarFragmentTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CollapsedStatusBarFragmentTest.java
index 231cdf5..2e2d4f3 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CollapsedStatusBarFragmentTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CollapsedStatusBarFragmentTest.java
@@ -21,21 +21,21 @@
import static org.mockito.Mockito.when;
import android.app.StatusBarManager;
-import android.support.test.filters.SmallTest;
+import android.testing.AndroidTestingRunner;
+import android.testing.TestableLooper.RunWithLooper;
import android.view.View;
import android.view.ViewPropertyAnimator;
-import com.android.systemui.R;
-import android.testing.AndroidTestingRunner;
+import androidx.test.filters.SmallTest;
+import com.android.systemui.R;
import com.android.systemui.SysuiBaseFragmentTest;
import com.android.systemui.statusbar.CommandQueue;
import com.android.systemui.tuner.TunerService;
-import android.testing.TestableLooper.RunWithLooper;
import org.junit.Before;
-import org.junit.runner.RunWith;
import org.junit.Test;
+import org.junit.runner.RunWith;
import org.mockito.Mockito;
@RunWith(AndroidTestingRunner.class)
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/DozeParametersTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/DozeParametersTest.java
index 532019f..f6f4eb48 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/DozeParametersTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/DozeParametersTest.java
@@ -16,11 +16,21 @@
package com.android.systemui.statusbar.phone;
+import static junit.framework.Assert.assertFalse;
+import static junit.framework.Assert.assertTrue;
+import static junit.framework.Assert.fail;
+
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.reset;
+import static org.mockito.Mockito.verify;
+
import android.content.Context;
import android.os.PowerManager;
-import android.support.test.runner.AndroidJUnit4;
import android.test.suitebuilder.annotation.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.systemui.SysuiTestCase;
import com.android.systemui.doze.DozeScreenState;
import com.android.systemui.statusbar.phone.DozeParameters.IntInOutMatcher;
@@ -29,18 +39,6 @@
import org.junit.Test;
import org.junit.runner.RunWith;
-import static junit.framework.Assert.assertTrue;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.fail;
-
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.ArgumentMatchers.eq;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.never;
-import static org.mockito.Mockito.reset;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-
@SmallTest
@RunWith(AndroidJUnit4.class)
public class DozeParametersTest extends SysuiTestCase {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/DozeScrimControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/DozeScrimControllerTest.java
index 203ebe6..b2128a6 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/DozeScrimControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/DozeScrimControllerTest.java
@@ -23,11 +23,11 @@
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
-import android.os.Debug;
-import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
+import androidx.test.filters.SmallTest;
+
import com.android.systemui.SysuiTestCase;
import com.android.systemui.doze.DozeHost;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/HeadsUpAppearanceControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/HeadsUpAppearanceControllerTest.java
index 952d086..32e1429 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/HeadsUpAppearanceControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/HeadsUpAppearanceControllerTest.java
@@ -17,24 +17,19 @@
package com.android.systemui.statusbar.phone;
import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.ArgumentMatchers.anyObject;
-import static org.mockito.Mockito.atLeast;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.reset;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper.RunWithLooper;
import android.view.View;
import android.widget.TextView;
-import com.android.systemui.Dependency;
+import androidx.test.filters.SmallTest;
+
import com.android.systemui.SysuiTestCase;
-import com.android.systemui.TestableDependency;
-import com.android.systemui.statusbar.CommandQueue;
import com.android.systemui.statusbar.ExpandableNotificationRow;
import com.android.systemui.statusbar.HeadsUpStatusBarView;
import com.android.systemui.statusbar.NotificationTestHelper;
@@ -46,8 +41,6 @@
import org.junit.Test;
import org.junit.runner.RunWith;
-import java.util.HashSet;
-
@SmallTest
@RunWith(AndroidTestingRunner.class)
@RunWithLooper(setAsMainLooper = true)
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/HeadsUpManagerPhoneTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/HeadsUpManagerPhoneTest.java
index aa991cb..d258750 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/HeadsUpManagerPhoneTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/HeadsUpManagerPhoneTest.java
@@ -16,16 +16,26 @@
package com.android.systemui.statusbar.phone;
+import static junit.framework.Assert.assertFalse;
+import static junit.framework.Assert.assertNotNull;
+import static junit.framework.Assert.assertNull;
+import static junit.framework.Assert.assertTrue;
+
+import static org.junit.Assert.assertEquals;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
import android.app.ActivityManager;
import android.app.Instrumentation;
import android.app.Notification;
import android.os.UserHandle;
-import android.view.View;
import android.service.notification.StatusBarNotification;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
+import android.view.View;
+
+import androidx.test.InstrumentationRegistry;
+import androidx.test.filters.SmallTest;
import com.android.systemui.R;
import com.android.systemui.SysuiTestCase;
@@ -42,15 +52,6 @@
import org.mockito.junit.MockitoJUnit;
import org.mockito.junit.MockitoRule;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertNull;
-import static junit.framework.Assert.assertTrue;
-import static junit.framework.Assert.assertFalse;
-
-import static org.junit.Assert.assertEquals;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
@SmallTest
@RunWith(AndroidTestingRunner.class)
@TestableLooper.RunWithLooper
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardBouncerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardBouncerTest.java
index 12b14c8..2832e88 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardBouncerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardBouncerTest.java
@@ -29,13 +29,14 @@
import static org.mockito.Mockito.when;
import android.graphics.Color;
-import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.widget.FrameLayout;
+import androidx.test.filters.SmallTest;
+
import com.android.internal.widget.LockPatternUtils;
import com.android.keyguard.KeyguardHostView;
import com.android.keyguard.KeyguardSecurityModel;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardPresentationTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardPresentationTest.java
index 5429153..d4e8687 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardPresentationTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardPresentationTest.java
@@ -16,16 +16,15 @@
package com.android.systemui.statusbar.phone;
-import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.view.LayoutInflater;
-import android.view.View;
+
+import androidx.test.filters.SmallTest;
import com.android.systemui.R;
import com.android.systemui.SysuiTestCase;
-import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NavigationBarFragmentTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NavigationBarFragmentTest.java
index 17df800..3231be0 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NavigationBarFragmentTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NavigationBarFragmentTest.java
@@ -19,14 +19,16 @@
import android.content.Context;
import android.os.Looper;
-import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.LeakCheck.Tracker;
+import android.testing.TestableLooper.RunWithLooper;
import android.view.Display;
import android.view.WindowManager;
+import android.view.accessibility.AccessibilityManager.AccessibilityServicesStateChangeListener;
+
+import androidx.test.filters.SmallTest;
import com.android.systemui.Dependency;
-
import com.android.systemui.OverviewProxyService;
import com.android.systemui.SysuiBaseFragmentTest;
import com.android.systemui.recents.Recents;
@@ -34,9 +36,6 @@
import com.android.systemui.statusbar.CommandQueue;
import com.android.systemui.statusbar.policy.AccessibilityManagerWrapper;
-import android.testing.TestableLooper.RunWithLooper;
-import android.view.accessibility.AccessibilityManager.AccessibilityServicesStateChangeListener;
-
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NavigationBarTransitionsTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NavigationBarTransitionsTest.java
index 76f57f0..695e26f 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NavigationBarTransitionsTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NavigationBarTransitionsTest.java
@@ -21,11 +21,12 @@
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.when;
-import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper.RunWithLooper;
import android.view.IWindowManager;
+import androidx.test.filters.SmallTest;
+
import com.android.systemui.SysuiTestCase;
import com.android.systemui.statusbar.CommandQueue;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NearestTouchFrameTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NearestTouchFrameTest.java
index 667a508..52b8867 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NearestTouchFrameTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NearestTouchFrameTest.java
@@ -17,19 +17,19 @@
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.doAnswer;
-import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import android.content.res.Configuration;
-import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper.RunWithLooper;
import android.view.MotionEvent;
import android.view.View;
+import androidx.test.filters.SmallTest;
+
import com.android.systemui.SysuiTestCase;
import org.junit.Before;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ScrimControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ScrimControllerTest.java
index 9c55874..ac5ed95 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ScrimControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ScrimControllerTest.java
@@ -37,11 +37,12 @@
import android.graphics.Color;
import android.os.Handler;
import android.os.Looper;
-import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.view.View;
+import androidx.test.filters.SmallTest;
+
import com.android.internal.colorextraction.ColorExtractor.GradientColors;
import com.android.internal.util.function.TriConsumer;
import com.android.systemui.SysuiTestCase;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarIconControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarIconControllerTest.java
index 72b0156..9ccc3522 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarIconControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarIconControllerTest.java
@@ -14,28 +14,26 @@
package com.android.systemui.statusbar.phone;
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertTrue;
-
import static com.android.systemui.statusbar.phone.StatusBarIconHolder.TYPE_ICON;
import static com.android.systemui.statusbar.phone.StatusBarIconHolder.TYPE_MOBILE;
import static com.android.systemui.statusbar.phone.StatusBarIconHolder.TYPE_WIFI;
-import static org.mockito.ArgumentMatchers.eq;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-import android.graphics.Rect;
-import android.support.test.filters.SmallTest;
+import static junit.framework.Assert.assertTrue;
+
+import static org.mockito.Mockito.mock;
+
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper.RunWithLooper;
import android.view.ViewGroup;
import android.widget.LinearLayout;
+import androidx.test.filters.SmallTest;
+
import com.android.internal.statusbar.StatusBarIcon;
-import com.android.systemui.statusbar.StatusIconDisplayable;
import com.android.systemui.statusbar.StatusBarIconView;
import com.android.systemui.statusbar.StatusBarMobileView;
import com.android.systemui.statusbar.StatusBarWifiView;
+import com.android.systemui.statusbar.StatusIconDisplayable;
import com.android.systemui.statusbar.phone.StatusBarIconController.DarkIconManager;
import com.android.systemui.statusbar.phone.StatusBarIconController.IconManager;
import com.android.systemui.statusbar.phone.StatusBarSignalPolicy.MobileIconState;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManagerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManagerTest.java
index 94ab9d2..91c47ca 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManagerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManagerTest.java
@@ -25,11 +25,12 @@
import static org.mockito.Mockito.when;
import android.content.Context;
-import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.view.ViewGroup;
+import androidx.test.filters.SmallTest;
+
import com.android.internal.widget.LockPatternUtils;
import com.android.keyguard.KeyguardHostView;
import com.android.keyguard.ViewMediatorCallback;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarTest.java
index 0a412b9..a2d60c0 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarTest.java
@@ -41,28 +41,25 @@
import android.app.StatusBarManager;
import android.app.trust.TrustManager;
import android.content.Context;
-import android.content.pm.UserInfo;
import android.hardware.fingerprint.FingerprintManager;
import android.metrics.LogMaker;
import android.os.Binder;
import android.os.Handler;
-import android.os.HandlerThread;
import android.os.IPowerManager;
import android.os.Looper;
import android.os.PowerManager;
import android.os.RemoteException;
import android.os.UserHandle;
import android.service.notification.StatusBarNotification;
-import android.support.test.filters.SmallTest;
import android.support.test.metricshelper.MetricsAsserts;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.testing.TestableLooper.RunWithLooper;
import android.util.SparseArray;
-import android.view.Gravity;
-import android.view.View;
import android.view.ViewGroup.LayoutParams;
+import androidx.test.filters.SmallTest;
+
import com.android.internal.logging.MetricsLogger;
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.internal.logging.testing.FakeMetricsLogger;
@@ -72,8 +69,8 @@
import com.android.systemui.R;
import com.android.systemui.SysuiTestCase;
import com.android.systemui.assist.AssistManager;
-import com.android.systemui.keyguard.KeyguardViewMediator;
import com.android.systemui.classifier.FalsingManager;
+import com.android.systemui.keyguard.KeyguardViewMediator;
import com.android.systemui.keyguard.WakefulnessLifecycle;
import com.android.systemui.recents.misc.SystemServicesProxy;
import com.android.systemui.statusbar.ActivatableNotificationView;
@@ -81,7 +78,6 @@
import com.android.systemui.statusbar.CommandQueue;
import com.android.systemui.statusbar.ExpandableNotificationRow;
import com.android.systemui.statusbar.FooterView;
-import com.android.systemui.statusbar.FooterViewButton;
import com.android.systemui.statusbar.KeyguardIndicationController;
import com.android.systemui.statusbar.NotificationData;
import com.android.systemui.statusbar.NotificationData.Entry;
@@ -116,7 +112,6 @@
import java.io.ByteArrayOutputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
-import java.util.function.Predicate;
@SmallTest
@RunWith(AndroidTestingRunner.class)
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarWindowViewTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarWindowViewTest.java
index a068a5e..d915618 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarWindowViewTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarWindowViewTest.java
@@ -20,19 +20,14 @@
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
-import android.content.Context;
import android.os.SystemClock;
-import android.service.notification.StatusBarNotification;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
import android.view.MotionEvent;
-import android.view.View;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import com.android.systemui.SysuiTestCase;
import com.android.systemui.statusbar.DragDownHelper;
-import com.android.systemui.statusbar.ExpandableNotificationRow;
-import com.android.systemui.statusbar.NotificationData;
import com.android.systemui.statusbar.StatusBarState;
import org.junit.Before;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/SystemUIDialogTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/SystemUIDialogTest.java
index dcd531d..b299841 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/SystemUIDialogTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/SystemUIDialogTest.java
@@ -15,6 +15,7 @@
package com.android.systemui.statusbar.phone;
import static junit.framework.Assert.assertTrue;
+
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.verify;
@@ -22,10 +23,11 @@
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
-import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper.RunWithLooper;
+import androidx.test.filters.SmallTest;
+
import com.android.systemui.SysuiTestCase;
import org.junit.Before;
@@ -33,7 +35,6 @@
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
-
@RunWith(AndroidTestingRunner.class)
@RunWithLooper(setAsMainLooper = true)
@SmallTest
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/BluetoothControllerImplTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/BluetoothControllerImplTest.java
index d246350..79db3ac 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/BluetoothControllerImplTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/BluetoothControllerImplTest.java
@@ -15,8 +15,8 @@
package com.android.systemui.statusbar.policy;
import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@@ -25,11 +25,11 @@
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothProfile;
import android.os.Looper;
-import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.testing.TestableLooper.RunWithLooper;
-import android.util.Log;
+
+import androidx.test.filters.SmallTest;
import com.android.settingslib.bluetooth.BluetoothEventManager;
import com.android.settingslib.bluetooth.CachedBluetoothDevice;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/CallbackHandlerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/CallbackHandlerTest.java
index ed0f9ab..85f6033 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/CallbackHandlerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/CallbackHandlerTest.java
@@ -15,29 +15,33 @@
*/
package com.android.systemui.statusbar.policy;
+import static junit.framework.Assert.assertEquals;
+import static junit.framework.Assert.assertTrue;
+
+import static org.mockito.Matchers.eq;
+
import android.os.HandlerThread;
-import android.support.test.runner.AndroidJUnit4;
import android.telephony.SubscriptionInfo;
import android.test.suitebuilder.annotation.SmallTest;
+
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.systemui.R;
import com.android.systemui.SysuiTestCase;
import com.android.systemui.statusbar.policy.NetworkController.EmergencyListener;
import com.android.systemui.statusbar.policy.NetworkController.IconState;
import com.android.systemui.statusbar.policy.NetworkController.SignalCallback;
-import java.util.ArrayList;
-import java.util.List;
+
import org.junit.Before;
-import org.junit.runner.RunWith;
import org.junit.Test;
+import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
-import static junit.framework.Assert.assertTrue;
-import static junit.framework.Assert.assertEquals;
-
-import static org.mockito.Matchers.eq;
+import java.util.ArrayList;
+import java.util.List;
@SmallTest
@RunWith(AndroidJUnit4.class)
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/ExtensionControllerImplTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/ExtensionControllerImplTest.java
index b22a646..97eaad6 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/ExtensionControllerImplTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/ExtensionControllerImplTest.java
@@ -23,11 +23,12 @@
import static org.mockito.Mockito.when;
import android.content.res.Configuration;
-import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.testing.TestableLooper.RunWithLooper;
+import androidx.test.filters.SmallTest;
+
import com.android.systemui.Dependency;
import com.android.systemui.SysuiTestCase;
import com.android.systemui.plugins.OverlayPlugin;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/IconLoggerImplTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/IconLoggerImplTest.java
index 5c34730..7e3507a 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/IconLoggerImplTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/IconLoggerImplTest.java
@@ -31,21 +31,20 @@
import static java.lang.Thread.sleep;
-import android.metrics.LogMaker;
-import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.testing.TestableLooper.MessageHandler;
import android.testing.TestableLooper.RunWithLooper;
import android.util.Log;
+import androidx.test.filters.SmallTest;
+
import com.android.internal.logging.MetricsLogger;
import com.android.systemui.SysuiTestCase;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.ArgumentMatcher;
@RunWith(AndroidTestingRunner.class)
@RunWithLooper
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/KeyButtonViewTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/KeyButtonViewTest.java
index f859235..39bdf20 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/KeyButtonViewTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/KeyButtonViewTest.java
@@ -21,12 +21,13 @@
import static org.mockito.ArgumentMatchers.argThat;
import android.metrics.LogMaker;
-import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.testing.TestableLooper.RunWithLooper;
import android.view.KeyEvent;
+import androidx.test.filters.SmallTest;
+
import com.android.internal.logging.MetricsLogger;
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.systemui.SysuiTestCase;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/LocationControllerImplTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/LocationControllerImplTest.java
index e1b97bda..99023e2 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/LocationControllerImplTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/LocationControllerImplTest.java
@@ -20,11 +20,12 @@
import android.content.Intent;
import android.location.LocationManager;
-import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.testing.TestableLooper.RunWithLooper;
+import androidx.test.filters.SmallTest;
+
import com.android.systemui.SysuiTestCase;
import com.android.systemui.statusbar.policy.LocationController.LocationChangeCallback;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerEthernetTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerEthernetTest.java
index eefdeee..93cf3e8 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerEthernetTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerEthernetTest.java
@@ -1,7 +1,8 @@
package com.android.systemui.statusbar.policy;
+import static junit.framework.Assert.assertEquals;
+
import android.net.NetworkCapabilities;
-import android.support.test.runner.AndroidJUnit4;
import android.test.suitebuilder.annotation.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper.RunWithLooper;
@@ -13,8 +14,6 @@
import org.mockito.ArgumentCaptor;
import org.mockito.Mockito;
-import static junit.framework.Assert.assertEquals;
-
@SmallTest
@RunWith(AndroidTestingRunner.class)
@RunWithLooper
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerSignalTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerSignalTest.java
index c24336d..bcbba8b 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerSignalTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerSignalTest.java
@@ -15,11 +15,16 @@
*/
package com.android.systemui.statusbar.policy;
+import static junit.framework.Assert.assertEquals;
+import static junit.framework.Assert.assertFalse;
+import static junit.framework.Assert.assertTrue;
+
+import static org.mockito.Mockito.mock;
+
import android.content.Intent;
import android.net.ConnectivityManager;
import android.net.NetworkCapabilities;
import android.os.Looper;
-import android.support.test.runner.AndroidJUnit4;
import android.telephony.ServiceState;
import android.telephony.SignalStrength;
import android.telephony.SubscriptionInfo;
@@ -42,11 +47,6 @@
import java.util.ArrayList;
import java.util.List;
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertTrue;
-import static junit.framework.Assert.assertFalse;
-import static org.mockito.Mockito.mock;
-
@SmallTest
@RunWith(AndroidTestingRunner.class)
@RunWithLooper
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/RemoteInputQuickSettingsDisablerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/RemoteInputQuickSettingsDisablerTest.java
index 3b47eae..02c9b92 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/RemoteInputQuickSettingsDisablerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/RemoteInputQuickSettingsDisablerTest.java
@@ -14,9 +14,8 @@
package com.android.systemui.statusbar.policy;
-import static com.google.common.truth.Truth.assertThat;
-
import static junit.framework.TestCase.assertTrue;
+
import static org.junit.Assert.assertFalse;
import static org.mockito.ArgumentMatchers.anyBoolean;
import static org.mockito.Mockito.atLeastOnce;
@@ -24,9 +23,10 @@
import static org.mockito.Mockito.verify;
import android.content.res.Configuration;
-import android.support.test.runner.AndroidJUnit4;
import android.test.suitebuilder.annotation.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.systemui.SysuiTestCase;
import com.android.systemui.statusbar.CommandQueue;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/RemoteInputViewTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/RemoteInputViewTest.java
index a6fa4f5..36c89b8 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/RemoteInputViewTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/RemoteInputViewTest.java
@@ -22,13 +22,14 @@
import android.content.IntentFilter;
import android.content.pm.ShortcutManager;
import android.os.Handler;
-import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.view.View;
import android.widget.EditText;
import android.widget.ImageButton;
+import androidx.test.filters.SmallTest;
+
import com.android.systemui.Dependency;
import com.android.systemui.R;
import com.android.systemui.SysuiTestCase;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/SecurityControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/SecurityControllerTest.java
index f76de5a..552ecc6 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/SecurityControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/SecurityControllerTest.java
@@ -23,11 +23,9 @@
import static org.mockito.Matchers.anyInt;
import static org.mockito.Matchers.argThat;
import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-import static org.mockito.Mockito.doThrow;
-import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
import android.app.admin.DevicePolicyManager;
import android.content.ComponentName;
@@ -37,28 +35,26 @@
import android.content.pm.UserInfo;
import android.net.ConnectivityManager;
import android.net.ConnectivityManager.NetworkCallback;
-import android.net.NetworkCapabilities;
import android.net.NetworkRequest;
import android.os.UserManager;
import android.security.IKeyChainService;
-import android.support.test.runner.AndroidJUnit4;
import android.test.suitebuilder.annotation.SmallTest;
-import com.android.systemui.statusbar.policy.SecurityController.SecurityControllerCallback;
-import com.android.systemui.SysuiTestCase;
+import androidx.test.runner.AndroidJUnit4;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-import java.util.List;
+import com.android.systemui.SysuiTestCase;
+import com.android.systemui.statusbar.policy.SecurityController.SecurityControllerCallback;
import org.junit.After;
import org.junit.Before;
-import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
@SmallTest
@RunWith(AndroidJUnit4.class)
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/SmartReplyViewTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/SmartReplyViewTest.java
index c573ca8..dbc88a0 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/SmartReplyViewTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/SmartReplyViewTest.java
@@ -33,7 +33,6 @@
import android.content.IntentFilter;
import android.content.res.Resources;
import android.service.notification.StatusBarNotification;
-import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.view.View;
@@ -41,6 +40,8 @@
import android.widget.Button;
import android.widget.LinearLayout;
+import androidx.test.filters.SmallTest;
+
import com.android.keyguard.KeyguardHostView.OnDismissAction;
import com.android.systemui.R;
import com.android.systemui.SysuiTestCase;
@@ -48,8 +49,6 @@
import com.android.systemui.statusbar.SmartReplyController;
import com.android.systemui.statusbar.phone.KeyguardDismissUtil;
-import java.util.concurrent.atomic.AtomicReference;
-
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -57,6 +56,8 @@
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
+import java.util.concurrent.atomic.AtomicReference;
+
@RunWith(AndroidTestingRunner.class)
@TestableLooper.RunWithLooper
@SmallTest
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/ZenModeControllerImplTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/ZenModeControllerImplTest.java
index 7437e834..ee5f2ed 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/ZenModeControllerImplTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/ZenModeControllerImplTest.java
@@ -27,10 +27,11 @@
import android.os.Looper;
import android.provider.Settings;
import android.service.notification.ZenModeConfig;
-import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper.RunWithLooper;
+import androidx.test.filters.SmallTest;
+
import com.android.systemui.SysuiTestCase;
import com.android.systemui.statusbar.policy.ZenModeController.Callback;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/stack/NotificationChildrenContainerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/stack/NotificationChildrenContainerTest.java
index 8a74019..2b0ad80 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/stack/NotificationChildrenContainerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/stack/NotificationChildrenContainerTest.java
@@ -16,13 +16,13 @@
package com.android.systemui.statusbar.stack;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper.RunWithLooper;
import android.view.NotificationHeaderView;
import android.view.View;
+import androidx.test.filters.SmallTest;
+
import com.android.systemui.SysuiTestCase;
import com.android.systemui.statusbar.ExpandableNotificationRow;
import com.android.systemui.statusbar.NotificationTestHelper;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/stack/NotificationRoundnessManagerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/stack/NotificationRoundnessManagerTest.java
index 16e69f4..01df783 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/stack/NotificationRoundnessManagerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/stack/NotificationRoundnessManagerTest.java
@@ -20,11 +20,12 @@
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
-import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper.RunWithLooper;
import android.view.View;
+import androidx.test.filters.SmallTest;
+
import com.android.systemui.SysuiTestCase;
import com.android.systemui.statusbar.ExpandableNotificationRow;
import com.android.systemui.statusbar.NotificationTestHelper;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayoutTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayoutTest.java
index 5400e3b..aaa691d 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayoutTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayoutTest.java
@@ -26,9 +26,9 @@
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
-import android.support.test.annotation.UiThreadTest;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+import androidx.test.annotation.UiThreadTest;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import com.android.systemui.ExpandHelper;
import com.android.systemui.R;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/tuner/TunablePaddingTest.java b/packages/SystemUI/tests/src/com/android/systemui/tuner/TunablePaddingTest.java
index 3bfefe7..2af526b 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/tuner/TunablePaddingTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/tuner/TunablePaddingTest.java
@@ -20,14 +20,14 @@
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
-import static org.mockito.Mockito.withSettings;
-import android.support.test.filters.SmallTest;
import android.testing.LeakCheck.Tracker;
import android.util.DisplayMetrics;
import android.view.View;
import android.view.WindowManager;
+import androidx.test.filters.SmallTest;
+
import com.android.systemui.utils.leaks.LeakCheckedTest;
import org.junit.Before;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/util/AsyncSensorManagerTest.java b/packages/SystemUI/tests/src/com/android/systemui/util/AsyncSensorManagerTest.java
index 469bdc0..6b605d7 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/util/AsyncSensorManagerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/util/AsyncSensorManagerTest.java
@@ -24,9 +24,10 @@
import android.hardware.SensorEventListener;
import android.hardware.SensorManager;
-import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
+import androidx.test.filters.SmallTest;
+
import com.android.systemui.SysuiTestCase;
import com.android.systemui.utils.hardware.FakeSensorManager;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/util/ChannelsTest.java b/packages/SystemUI/tests/src/com/android/systemui/util/ChannelsTest.java
index 50b4f3f..f5bcb0b 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/util/ChannelsTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/util/ChannelsTest.java
@@ -15,22 +15,20 @@
package com.android.systemui.util;
import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
-import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.content.Context;
import android.net.Uri;
import android.provider.Settings;
-import android.support.test.runner.AndroidJUnit4;
import android.test.suitebuilder.annotation.SmallTest;
import android.util.ArraySet;
+
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.systemui.SysuiTestCase;
import com.android.systemui.util.NotificationChannels;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/util/leak/GarbageMonitorTest.java b/packages/SystemUI/tests/src/com/android/systemui/util/leak/GarbageMonitorTest.java
index c095472..bcc20c2 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/util/leak/GarbageMonitorTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/util/leak/GarbageMonitorTest.java
@@ -24,11 +24,12 @@
import android.content.Context;
import android.os.Looper;
-import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.testing.TestableLooper.RunWithLooper;
+import androidx.test.filters.SmallTest;
+
import com.android.systemui.SysuiTestCase;
import org.junit.Before;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/util/leak/LeakDetectorTest.java b/packages/SystemUI/tests/src/com/android/systemui/util/leak/LeakDetectorTest.java
index 11bb398..c68c920 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/util/leak/LeakDetectorTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/util/leak/LeakDetectorTest.java
@@ -17,8 +17,8 @@
package com.android.systemui.util.leak;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import com.android.systemui.SysuiTestCase;
import com.android.systemui.util.leak.ReferenceTestUtils.CollectionWaiter;
@@ -28,8 +28,6 @@
import org.junit.Test;
import org.junit.runner.RunWith;
-import java.io.FileDescriptor;
-import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/util/leak/LeakReporterTest.java b/packages/SystemUI/tests/src/com/android/systemui/util/leak/LeakReporterTest.java
index 6711ce8..abec80e 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/util/leak/LeakReporterTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/util/leak/LeakReporterTest.java
@@ -24,8 +24,9 @@
import static org.mockito.Mockito.verify;
import android.app.NotificationManager;
-import android.support.test.filters.MediumTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.filters.MediumTest;
+import androidx.test.runner.AndroidJUnit4;
import com.android.systemui.SysuiTestCase;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/util/leak/ReferenceTestUtilsTest.java b/packages/SystemUI/tests/src/com/android/systemui/util/leak/ReferenceTestUtilsTest.java
index b8a3e39..726187d 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/util/leak/ReferenceTestUtilsTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/util/leak/ReferenceTestUtilsTest.java
@@ -18,8 +18,8 @@
import static org.junit.Assert.assertEquals;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import com.android.systemui.SysuiTestCase;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/util/leak/WeakIdentityHashMapTest.java b/packages/SystemUI/tests/src/com/android/systemui/util/leak/WeakIdentityHashMapTest.java
index ce6212e..2b28e2f 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/util/leak/WeakIdentityHashMapTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/util/leak/WeakIdentityHashMapTest.java
@@ -20,8 +20,8 @@
import static org.junit.Assert.assertNotSame;
import static org.junit.Assert.assertTrue;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import com.android.systemui.SysuiTestCase;
import com.android.systemui.util.leak.ReferenceTestUtils.CollectionWaiter;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/util/wakelock/KeepAwakeAnimationListenerTest.java b/packages/SystemUI/tests/src/com/android/systemui/util/wakelock/KeepAwakeAnimationListenerTest.java
index 43942f7..f91e313 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/util/wakelock/KeepAwakeAnimationListenerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/util/wakelock/KeepAwakeAnimationListenerTest.java
@@ -20,10 +20,11 @@
import static org.mockito.Mockito.verify;
import android.animation.Animator;
-import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
+import androidx.test.filters.SmallTest;
+
import com.android.systemui.SysuiTestCase;
import org.junit.Before;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/util/wakelock/SettableWakeLockTest.java b/packages/SystemUI/tests/src/com/android/systemui/util/wakelock/SettableWakeLockTest.java
index 39316ed..73a9e7e 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/util/wakelock/SettableWakeLockTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/util/wakelock/SettableWakeLockTest.java
@@ -21,8 +21,8 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import com.android.systemui.SysuiTestCase;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/util/wakelock/WakeLockTest.java b/packages/SystemUI/tests/src/com/android/systemui/util/wakelock/WakeLockTest.java
index d925364..4682b86 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/util/wakelock/WakeLockTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/util/wakelock/WakeLockTest.java
@@ -19,11 +19,10 @@
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
-import android.content.Context;
import android.os.PowerManager;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import com.android.systemui.SysuiTestCase;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/volume/UtilTest.java b/packages/SystemUI/tests/src/com/android/systemui/volume/UtilTest.java
index 6b20a1e..fb82b8f 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/volume/UtilTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/volume/UtilTest.java
@@ -16,7 +16,8 @@
package com.android.systemui.volume;
import android.media.MediaMetadata;
-import android.support.test.filters.SmallTest;
+
+import androidx.test.filters.SmallTest;
import com.android.systemui.SysuiTestCase;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/volume/VolumeDialogControllerImplTest.java b/packages/SystemUI/tests/src/com/android/systemui/volume/VolumeDialogControllerImplTest.java
index a4ed459..f4d0854 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/volume/VolumeDialogControllerImplTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/volume/VolumeDialogControllerImplTest.java
@@ -25,7 +25,9 @@
import android.content.Context;
import android.media.AudioManager;
import android.media.session.MediaSession;
-import android.support.test.filters.SmallTest;
+
+import androidx.test.filters.SmallTest;
+
import com.android.systemui.SysuiTestCase;
import com.android.systemui.keyguard.WakefulnessLifecycle;
import com.android.systemui.statusbar.phone.StatusBar;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/volume/VolumeDialogImplTest.java b/packages/SystemUI/tests/src/com/android/systemui/volume/VolumeDialogImplTest.java
index 43d60e4..329bbf4 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/volume/VolumeDialogImplTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/volume/VolumeDialogImplTest.java
@@ -16,32 +16,19 @@
package com.android.systemui.volume;
-import static android.media.AudioManager.RINGER_MODE_NORMAL;
-import static android.media.AudioManager.RINGER_MODE_SILENT;
-import static android.media.AudioManager.RINGER_MODE_VIBRATE;
-import static android.media.AudioManager.STREAM_RING;
-
-import static com.android.systemui.volume.Events.DISMISS_REASON_UNKNOWN;
-import static com.android.systemui.volume.Events.SHOW_REASON_UNKNOWN;
import static com.android.systemui.volume.VolumeDialogControllerImpl.STREAMS;
import static junit.framework.Assert.assertTrue;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-
import android.app.KeyguardManager;
import android.media.AudioManager;
-import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
-import android.text.TextUtils;
import android.view.View;
import android.view.ViewGroup;
-import android.widget.ImageView;
-import com.android.systemui.R;
+import androidx.test.filters.SmallTest;
+
import com.android.systemui.SysuiTestCase;
import com.android.systemui.plugins.VolumeDialogController;
import com.android.systemui.plugins.VolumeDialogController.State;
@@ -49,7 +36,6 @@
import org.junit.Before;
import org.junit.Ignore;
-import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
diff --git a/services/core/java/com/android/server/ConnectivityService.java b/services/core/java/com/android/server/ConnectivityService.java
index 446d186..8390263 100644
--- a/services/core/java/com/android/server/ConnectivityService.java
+++ b/services/core/java/com/android/server/ConnectivityService.java
@@ -1573,8 +1573,7 @@
public boolean isActiveNetworkMetered() {
enforceAccessPermission();
- final int uid = Binder.getCallingUid();
- final NetworkCapabilities caps = getUnfilteredActiveNetworkState(uid).networkCapabilities;
+ final NetworkCapabilities caps = getNetworkCapabilities(getActiveNetwork());
if (caps != null) {
return !caps.hasCapability(NetworkCapabilities.NET_CAPABILITY_NOT_METERED);
} else {
@@ -3759,10 +3758,10 @@
* if it's really needed.
*/
@Override
- public void getLatestTetheringEntitlementValue(int type, ResultReceiver receiver,
+ public void getLatestTetheringEntitlementResult(int type, ResultReceiver receiver,
boolean showEntitlementUi, String callerPkg) {
ConnectivityManager.enforceTetherChangePermission(mContext, callerPkg);
- mTethering.getLatestTetheringEntitlementValue(type, receiver, showEntitlementUi);
+ mTethering.getLatestTetheringEntitlementResult(type, receiver, showEntitlementUi);
}
// Called when we lose the default network and have no replacement yet.
@@ -4096,12 +4095,14 @@
}
/**
- * Return the information of all ongoing VPNs. This method is used by NetworkStatsService
- * and not available in ConnectivityManager.
+ * Return the information of all ongoing VPNs.
+ *
+ * <p>This method is used to update NetworkStatsService.
+ *
+ * <p>Must be called on the handler thread.
*/
- @Override
- public VpnInfo[] getAllVpnInfo() {
- enforceConnectivityInternalPermission();
+ private VpnInfo[] getAllVpnInfo() {
+ ensureRunningOnConnectivityServiceThread();
synchronized (mVpns) {
if (mLockdownEnabled) {
return new VpnInfo[0];
@@ -5563,6 +5564,8 @@
}
public void handleUpdateLinkProperties(NetworkAgentInfo nai, LinkProperties newLp) {
+ ensureRunningOnConnectivityServiceThread();
+
if (getNetworkAgentInfoForNetId(nai.network.netId) != nai) {
// Ignore updates for disconnected networks
return;
@@ -6397,6 +6400,7 @@
* Must be called on the handler thread.
*/
private Network[] getDefaultNetworks() {
+ ensureRunningOnConnectivityServiceThread();
ArrayList<Network> defaultNetworks = new ArrayList<>();
NetworkAgentInfo defaultNetwork = getDefaultNetwork();
for (NetworkAgentInfo nai : mNetworkAgentInfos.values()) {
@@ -6412,8 +6416,15 @@
* properties tracked by NetworkStatsService on an active iface has changed.
*/
private void notifyIfacesChangedForNetworkStats() {
+ ensureRunningOnConnectivityServiceThread();
+ String activeIface = null;
+ LinkProperties activeLinkProperties = getActiveLinkProperties();
+ if (activeLinkProperties != null) {
+ activeIface = activeLinkProperties.getInterfaceName();
+ }
try {
- mStatsService.forceUpdateIfaces(getDefaultNetworks());
+ mStatsService.forceUpdateIfaces(
+ getDefaultNetworks(), getAllVpnInfo(), getAllNetworkState(), activeIface);
} catch (Exception ignored) {
}
}
diff --git a/services/core/java/com/android/server/DynamicAndroidService.java b/services/core/java/com/android/server/DynamicAndroidService.java
index 12a3f02..8488941 100644
--- a/services/core/java/com/android/server/DynamicAndroidService.java
+++ b/services/core/java/com/android/server/DynamicAndroidService.java
@@ -118,7 +118,9 @@
if (gsiService.isGsiRunning()) {
return gsiService.disableGsiInstall();
} else {
- return gsiService.setGsiBootable() == 0;
+ final int status = gsiService.getGsiBootStatus();
+ final boolean singleBoot = (status == IGsiService.BOOT_STATUS_SINGLE_BOOT);
+ return gsiService.setGsiBootable(singleBoot) == 0;
}
}
@@ -129,6 +131,6 @@
@Override
public boolean commit() throws RemoteException {
- return getGsiService().setGsiBootable() == 0;
+ return getGsiService().setGsiBootable(true) == 0;
}
}
diff --git a/services/core/java/com/android/server/NetworkManagementService.java b/services/core/java/com/android/server/NetworkManagementService.java
index a4fda8e..a9645c4 100644
--- a/services/core/java/com/android/server/NetworkManagementService.java
+++ b/services/core/java/com/android/server/NetworkManagementService.java
@@ -2506,6 +2506,10 @@
modifyRoute(MODIFY_OPERATION_ADD, INetd.LOCAL_NET_ID, route);
}
}
+
+ // IPv6 link local should be activated always.
+ modifyRoute(MODIFY_OPERATION_ADD, INetd.LOCAL_NET_ID,
+ new RouteInfo(new IpPrefix("fe80::/64"), null, iface));
}
@Override
diff --git a/services/core/java/com/android/server/TelephonyRegistry.java b/services/core/java/com/android/server/TelephonyRegistry.java
index b4d45d4..14181eb 100644
--- a/services/core/java/com/android/server/TelephonyRegistry.java
+++ b/services/core/java/com/android/server/TelephonyRegistry.java
@@ -238,6 +238,8 @@
private PhoneCapability mPhoneCapability = null;
+ private int mActiveDataSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
+
@TelephonyManager.RadioPowerState
private int mRadioPowerState = TelephonyManager.RADIO_POWER_UNAVAILABLE;
@@ -258,7 +260,8 @@
static final int ENFORCE_PHONE_STATE_PERMISSION_MASK =
PhoneStateListener.LISTEN_CALL_FORWARDING_INDICATOR
| PhoneStateListener.LISTEN_MESSAGE_WAITING_INDICATOR
- | PhoneStateListener.LISTEN_EMERGENCY_NUMBER_LIST;
+ | PhoneStateListener.LISTEN_EMERGENCY_NUMBER_LIST
+ | PhoneStateListener.LISTEN_ACTIVE_DATA_SUBID_CHANGE;
static final int PRECISE_PHONE_STATE_PERMISSION_MASK =
PhoneStateListener.LISTEN_PRECISE_CALL_STATE |
@@ -818,9 +821,9 @@
remove(r.binder);
}
}
- if ((events & PhoneStateListener.LISTEN_PREFERRED_DATA_SUBID_CHANGE) != 0) {
+ if ((events & PhoneStateListener.LISTEN_ACTIVE_DATA_SUBID_CHANGE) != 0) {
try {
- r.callback.onPreferredDataSubIdChanged(mPreferredDataSubId);
+ r.callback.onActiveDataSubIdChanged(mActiveDataSubId);
} catch (RemoteException ex) {
remove(r.binder);
}
@@ -1454,7 +1457,7 @@
synchronized (mRecords) {
mPreciseDataConnectionState = new PreciseDataConnectionState(
TelephonyManager.DATA_UNKNOWN,TelephonyManager.NETWORK_TYPE_UNKNOWN,
- ApnSetting.getApnTypesBitmaskFromString(apnType), "", null,
+ ApnSetting.getApnTypesBitmaskFromString(apnType), null, null,
DataFailCause.NONE);
for (Record r : mRecords) {
if (r.matchPhoneStateListenerEvent(
@@ -1470,7 +1473,7 @@
}
broadcastDataConnectionFailed(apnType, subId);
broadcastPreciseDataConnectionStateChanged(TelephonyManager.DATA_UNKNOWN,
- TelephonyManager.NETWORK_TYPE_UNKNOWN, apnType, "", null,
+ TelephonyManager.NETWORK_TYPE_UNKNOWN, apnType, null, null,
DataFailCause.NONE);
}
@@ -1549,6 +1552,13 @@
log("notifyPreciseCallState: mCallQuality is null, skipping call attributes");
notifyCallAttributes = false;
} else {
+ // If the precise call state is no longer active, reset the call network type and
+ // call quality.
+ if (mPreciseCallState.getForegroundCallState()
+ != PreciseCallState.PRECISE_CALL_STATE_ACTIVE) {
+ mCallNetworkType = TelephonyManager.NETWORK_TYPE_UNKNOWN;
+ mCallQuality = new CallQuality();
+ }
mCallAttributes = new CallAttributes(mPreciseCallState, mCallNetworkType,
mCallQuality);
}
@@ -1733,23 +1743,23 @@
}
}
- public void notifyPreferredDataSubIdChanged(int preferredSubId) {
- if (!checkNotifyPermission("notifyPreferredDataSubIdChanged()")) {
+ public void notifyActiveDataSubIdChanged(int activeDataSubId) {
+ if (!checkNotifyPermission("notifyActiveDataSubIdChanged()")) {
return;
}
if (VDBG) {
- log("notifyPreferredDataSubIdChanged: preferredSubId=" + preferredSubId);
+ log("notifyActiveDataSubIdChanged: activeDataSubId=" + activeDataSubId);
}
synchronized (mRecords) {
- mPreferredDataSubId = preferredSubId;
+ mActiveDataSubId = activeDataSubId;
for (Record r : mRecords) {
if (r.matchPhoneStateListenerEvent(
- PhoneStateListener.LISTEN_PREFERRED_DATA_SUBID_CHANGE)) {
+ PhoneStateListener.LISTEN_ACTIVE_DATA_SUBID_CHANGE)) {
try {
- r.callback.onPreferredDataSubIdChanged(preferredSubId);
+ r.callback.onActiveDataSubIdChanged(activeDataSubId);
} catch (RemoteException ex) {
mRemoveList.add(r.binder);
}
@@ -1886,7 +1896,7 @@
pw.println("mBackgroundCallState=" + mBackgroundCallState);
pw.println("mSrvccState=" + mSrvccState);
pw.println("mPhoneCapability=" + mPhoneCapability);
- pw.println("mPreferredDataSubId=" + mPreferredDataSubId);
+ pw.println("mActiveDataSubId=" + mActiveDataSubId);
pw.println("mRadioPowerState=" + mRadioPowerState);
pw.println("mEmergencyNumberList=" + mEmergencyNumberList);
pw.println("mCallQuality=" + mCallQuality);
@@ -2158,14 +2168,6 @@
android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, null);
}
- if ((events & PhoneStateListener.LISTEN_PREFERRED_DATA_SUBID_CHANGE) != 0) {
- // It can have either READ_PHONE_STATE or READ_PRIVILEGED_PHONE_STATE.
- TelephonyPermissions.checkReadPhoneState(mContext,
- SubscriptionManager.INVALID_SUBSCRIPTION_ID, Binder.getCallingPid(),
- Binder.getCallingUid(), callingPackage, "listen to "
- + "LISTEN_PREFERRED_DATA_SUBID_CHANGE");
- }
-
if ((events & PhoneStateListener.LISTEN_CALL_DISCONNECT_CAUSES) != 0) {
mContext.enforceCallingOrSelfPermission(
android.Manifest.permission.READ_PRECISE_PHONE_STATE, null);
diff --git a/services/core/java/com/android/server/TestNetworkService.java b/services/core/java/com/android/server/TestNetworkService.java
new file mode 100644
index 0000000..e64ab78
--- /dev/null
+++ b/services/core/java/com/android/server/TestNetworkService.java
@@ -0,0 +1,338 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.server;
+
+import static com.android.internal.util.Preconditions.checkNotNull;
+
+import android.annotation.NonNull;
+import android.content.Context;
+import android.net.ConnectivityManager;
+import android.net.INetd;
+import android.net.ITestNetworkManager;
+import android.net.IpPrefix;
+import android.net.LinkAddress;
+import android.net.LinkProperties;
+import android.net.NetworkAgent;
+import android.net.NetworkCapabilities;
+import android.net.NetworkInfo;
+import android.net.NetworkInfo.DetailedState;
+import android.net.RouteInfo;
+import android.net.StringNetworkSpecifier;
+import android.net.TestNetworkInterface;
+import android.net.util.NetdService;
+import android.os.Binder;
+import android.os.Handler;
+import android.os.HandlerThread;
+import android.os.IBinder;
+import android.os.INetworkManagementService;
+import android.os.Looper;
+import android.os.ParcelFileDescriptor;
+import android.os.RemoteException;
+import android.util.SparseArray;
+
+import com.android.internal.annotations.GuardedBy;
+import com.android.internal.annotations.VisibleForTesting;
+
+import java.io.UncheckedIOException;
+import java.net.Inet4Address;
+import java.net.Inet6Address;
+import java.net.InterfaceAddress;
+import java.net.NetworkInterface;
+import java.net.SocketException;
+import java.util.concurrent.atomic.AtomicInteger;
+
+/** @hide */
+class TestNetworkService extends ITestNetworkManager.Stub {
+ @NonNull private static final String TAG = TestNetworkService.class.getSimpleName();
+ @NonNull private static final String TEST_NETWORK_TYPE = "TEST_NETWORK";
+ @NonNull private static final String TEST_TUN_PREFIX = "testtun";
+ @NonNull private static final AtomicInteger sTestTunIndex = new AtomicInteger();
+
+ @NonNull private final Context mContext;
+ @NonNull private final INetworkManagementService mNMS;
+ @NonNull private final INetd mNetd;
+
+ @NonNull private final HandlerThread mHandlerThread;
+ @NonNull private final Handler mHandler;
+
+ // Native method stubs
+ private static native int jniCreateTun(@NonNull String iface);
+
+ @VisibleForTesting
+ protected TestNetworkService(
+ @NonNull Context context, @NonNull INetworkManagementService netManager) {
+ mHandlerThread = new HandlerThread("TestNetworkServiceThread");
+ mHandlerThread.start();
+ mHandler = new Handler(mHandlerThread.getLooper());
+
+ mContext = checkNotNull(context, "missing Context");
+ mNMS = checkNotNull(netManager, "missing INetworkManagementService");
+ mNetd = checkNotNull(NetdService.getInstance(), "could not get netd instance");
+ }
+
+ /**
+ * Create a TUN interface with the given interface name and link addresses
+ *
+ * <p>This method will return the FileDescriptor to the TUN interface. Close it to tear down the
+ * TUN interface.
+ */
+ @Override
+ public TestNetworkInterface createTunInterface(@NonNull LinkAddress[] linkAddrs) {
+ enforceTestNetworkPermissions(mContext);
+
+ checkNotNull(linkAddrs, "missing linkAddrs");
+
+ String iface = TEST_TUN_PREFIX + sTestTunIndex.getAndIncrement();
+ return Binder.withCleanCallingIdentity(
+ () -> {
+ try {
+ ParcelFileDescriptor tunIntf =
+ ParcelFileDescriptor.adoptFd(jniCreateTun(iface));
+ for (LinkAddress addr : linkAddrs) {
+ mNetd.interfaceAddAddress(
+ iface,
+ addr.getAddress().getHostAddress(),
+ addr.getPrefixLength());
+ }
+
+ return new TestNetworkInterface(tunIntf, iface);
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ });
+ }
+
+ // Tracker for TestNetworkAgents
+ @GuardedBy("mTestNetworkTracker")
+ @NonNull
+ private final SparseArray<TestNetworkAgent> mTestNetworkTracker = new SparseArray<>();
+
+ public class TestNetworkAgent extends NetworkAgent implements IBinder.DeathRecipient {
+ private static final int NETWORK_SCORE = 1; // Use a low, non-zero score.
+
+ private final int mUid;
+ @NonNull private final NetworkInfo mNi;
+ @NonNull private final NetworkCapabilities mNc;
+ @NonNull private final LinkProperties mLp;
+
+ @GuardedBy("mBinderLock")
+ @NonNull
+ private IBinder mBinder;
+
+ @NonNull private final Object mBinderLock = new Object();
+
+ private TestNetworkAgent(
+ @NonNull Looper looper,
+ @NonNull Context context,
+ @NonNull NetworkInfo ni,
+ @NonNull NetworkCapabilities nc,
+ @NonNull LinkProperties lp,
+ int uid,
+ @NonNull IBinder binder)
+ throws RemoteException {
+ super(looper, context, TEST_NETWORK_TYPE, ni, nc, lp, NETWORK_SCORE);
+
+ mUid = uid;
+ mNi = ni;
+ mNc = nc;
+ mLp = lp;
+
+ synchronized (mBinderLock) {
+ mBinder = binder; // Binder null-checks in create()
+
+ try {
+ mBinder.linkToDeath(this, 0);
+ } catch (RemoteException e) {
+ binderDied();
+ throw e; // Abort, signal failure up the stack.
+ }
+ }
+ }
+
+ /**
+ * If the Binder object dies, this function is called to free the resources of this
+ * TestNetworkAgent
+ */
+ @Override
+ public void binderDied() {
+ teardown();
+ }
+
+ @Override
+ protected void unwanted() {
+ teardown();
+ }
+
+ private void teardown() {
+ mNi.setDetailedState(DetailedState.DISCONNECTED, null, null);
+ mNi.setIsAvailable(false);
+ sendNetworkInfo(mNi);
+
+ // Synchronize on mBinderLock to ensure that unlinkToDeath is never called more than
+ // once (otherwise it could throw an exception)
+ synchronized (mBinderLock) {
+ // If mBinder is null, this Test Network has already been cleaned up.
+ if (mBinder == null) return;
+ mBinder.unlinkToDeath(this, 0);
+ mBinder = null;
+ }
+
+ // Has to be in TestNetworkAgent to ensure all teardown codepaths properly clean up
+ // resources, even for binder death or unwanted calls.
+ synchronized (mTestNetworkTracker) {
+ mTestNetworkTracker.remove(netId);
+ }
+ }
+ }
+
+ private TestNetworkAgent registerTestNetworkAgent(
+ @NonNull Looper looper,
+ @NonNull Context context,
+ @NonNull String iface,
+ int callingUid,
+ @NonNull IBinder binder)
+ throws RemoteException, SocketException {
+ checkNotNull(looper, "missing Looper");
+ checkNotNull(context, "missing Context");
+ // iface and binder validity checked by caller
+
+ // Build network info with special testing type
+ NetworkInfo ni = new NetworkInfo(ConnectivityManager.TYPE_TEST, 0, TEST_NETWORK_TYPE, "");
+ ni.setDetailedState(DetailedState.CONNECTED, null, null);
+ ni.setIsAvailable(true);
+
+ // Build narrow set of NetworkCapabilities, useful only for testing
+ NetworkCapabilities nc = new NetworkCapabilities();
+ nc.clearAll(); // Remove default capabilities.
+ nc.addTransportType(NetworkCapabilities.TRANSPORT_TEST);
+ nc.addCapability(NetworkCapabilities.NET_CAPABILITY_NOT_SUSPENDED);
+ nc.addCapability(NetworkCapabilities.NET_CAPABILITY_NOT_RESTRICTED);
+ nc.setNetworkSpecifier(new StringNetworkSpecifier(iface));
+
+ // Build LinkProperties
+ LinkProperties lp = new LinkProperties();
+ lp.setInterfaceName(iface);
+
+ // Find the currently assigned addresses, and add them to LinkProperties
+ boolean allowIPv4 = false, allowIPv6 = false;
+ NetworkInterface netIntf = NetworkInterface.getByName(iface);
+ checkNotNull(netIntf, "No such network interface found: " + netIntf);
+
+ for (InterfaceAddress intfAddr : netIntf.getInterfaceAddresses()) {
+ lp.addLinkAddress(
+ new LinkAddress(intfAddr.getAddress(), intfAddr.getNetworkPrefixLength()));
+
+ if (intfAddr.getAddress() instanceof Inet6Address) {
+ allowIPv6 |= !intfAddr.getAddress().isLinkLocalAddress();
+ } else if (intfAddr.getAddress() instanceof Inet4Address) {
+ allowIPv4 = true;
+ }
+ }
+
+ // Add global routes (but as non-default, non-internet providing network)
+ if (allowIPv4) {
+ lp.addRoute(new RouteInfo(new IpPrefix(Inet4Address.ANY, 0), null, iface));
+ }
+ if (allowIPv6) {
+ lp.addRoute(new RouteInfo(new IpPrefix(Inet6Address.ANY, 0), null, iface));
+ }
+
+ return new TestNetworkAgent(looper, context, ni, nc, lp, callingUid, binder);
+ }
+
+ /**
+ * Sets up a Network with extremely limited privileges, guarded by the MANAGE_TEST_NETWORKS
+ * permission.
+ *
+ * <p>This method provides a Network that is useful only for testing.
+ */
+ @Override
+ public void setupTestNetwork(@NonNull String iface, @NonNull IBinder binder) {
+ enforceTestNetworkPermissions(mContext);
+
+ checkNotNull(iface, "missing Iface");
+ checkNotNull(binder, "missing IBinder");
+
+ if (!(iface.startsWith(INetd.IPSEC_INTERFACE_PREFIX)
+ || iface.startsWith(TEST_TUN_PREFIX))) {
+ throw new IllegalArgumentException(
+ "Cannot create network for non ipsec, non-testtun interface");
+ }
+
+ // Setup needs to be done with NETWORK_STACK privileges.
+ int callingUid = Binder.getCallingUid();
+ Binder.withCleanCallingIdentity(
+ () -> {
+ try {
+ mNMS.setInterfaceUp(iface);
+
+ // Synchronize all accesses to mTestNetworkTracker to prevent the case
+ // where:
+ // 1. TestNetworkAgent successfully binds to death of binder
+ // 2. Before it is added to the mTestNetworkTracker, binder dies,
+ // binderDied() is called (on a different thread)
+ // 3. This thread is pre-empted, put() is called after remove()
+ synchronized (mTestNetworkTracker) {
+ TestNetworkAgent agent =
+ registerTestNetworkAgent(
+ mHandler.getLooper(),
+ mContext,
+ iface,
+ callingUid,
+ binder);
+
+ mTestNetworkTracker.put(agent.netId, agent);
+ }
+ } catch (SocketException e) {
+ throw new UncheckedIOException(e);
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ });
+ }
+
+ /** Teardown a test network */
+ @Override
+ public void teardownTestNetwork(int netId) {
+ enforceTestNetworkPermissions(mContext);
+
+ TestNetworkAgent agent;
+ synchronized (mTestNetworkTracker) {
+ agent = mTestNetworkTracker.get(netId);
+ }
+
+ if (agent == null) {
+ return; // Already torn down
+ } else if (agent.mUid != Binder.getCallingUid()) {
+ throw new SecurityException("Attempted to modify other user's test networks");
+ }
+
+ // Safe to be called multiple times.
+ agent.teardown();
+ }
+
+ // STOPSHIP: Change this back to android.Manifest.permission.MANAGE_TEST_NETWORKS
+ private static final String PERMISSION_NAME = "dummy";
+
+ public static void enforceTestNetworkPermissions(@NonNull Context context) {
+ // STOPSHIP: Re-enable these checks. Disabled until adoptShellPermissionIdentity() can be
+ // called from CTS test code.
+ if (false) {
+ context.enforceCallingOrSelfPermission(PERMISSION_NAME, "TestNetworkService");
+ }
+ }
+}
diff --git a/services/core/java/com/android/server/connectivity/TcpKeepaliveController.java b/services/core/java/com/android/server/connectivity/TcpKeepaliveController.java
index 8a9ac23..65de83b 100644
--- a/services/core/java/com/android/server/connectivity/TcpKeepaliveController.java
+++ b/services/core/java/com/android/server/connectivity/TcpKeepaliveController.java
@@ -16,10 +16,12 @@
package com.android.server.connectivity;
import static android.net.SocketKeepalive.DATA_RECEIVED;
+import static android.net.SocketKeepalive.ERROR_HARDWARE_UNSUPPORTED;
import static android.net.SocketKeepalive.ERROR_INVALID_SOCKET;
import static android.net.SocketKeepalive.ERROR_SOCKET_NOT_IDLE;
import static android.os.MessageQueue.OnFileDescriptorEventListener.EVENT_ERROR;
import static android.os.MessageQueue.OnFileDescriptorEventListener.EVENT_INPUT;
+import static android.system.OsConstants.ENOPROTOOPT;
import static android.system.OsConstants.FIONREAD;
import static android.system.OsConstants.IPPROTO_TCP;
import static android.system.OsConstants.TIOCOUTQ;
@@ -179,12 +181,13 @@
trw = NetworkUtils.getTcpRepairWindow(fd);
} catch (ErrnoException e) {
Log.e(TAG, "Exception reading TCP state from socket", e);
- try {
- Os.setsockoptInt(fd, IPPROTO_TCP, TCP_REPAIR, TCP_REPAIR_OFF);
- } catch (ErrnoException ex) {
- Log.e(TAG, "Exception while turning off repair mode due to exception", ex);
+ if (e.errno == ENOPROTOOPT) {
+ // ENOPROTOOPT may happen in kernel version lower than 4.8.
+ // Treat it as ERROR_HARDWARE_UNSUPPORTED.
+ throw new InvalidSocketException(ERROR_HARDWARE_UNSUPPORTED, e);
+ } else {
+ throw new InvalidSocketException(ERROR_INVALID_SOCKET, e);
}
- throw new InvalidSocketException(ERROR_INVALID_SOCKET, e);
} finally {
dropAllIncomingPackets(fd, false);
}
diff --git a/services/core/java/com/android/server/connectivity/Tethering.java b/services/core/java/com/android/server/connectivity/Tethering.java
index c91e1a1..3b4b6f8 100644
--- a/services/core/java/com/android/server/connectivity/Tethering.java
+++ b/services/core/java/com/android/server/connectivity/Tethering.java
@@ -289,8 +289,8 @@
}
private void maybeUpdateConfiguration() {
- final int dunCheck = TetheringConfiguration.checkDunRequired(mContext);
- if (dunCheck == mConfig.dunCheck) return;
+ final boolean isDunRequired = TetheringConfiguration.checkDunRequired(mContext);
+ if (isDunRequired == mConfig.isDunRequired) return;
updateConfiguration();
}
@@ -1677,10 +1677,10 @@
}
/** Get the latest value of the tethering entitlement check. */
- public void getLatestTetheringEntitlementValue(int type, ResultReceiver receiver,
+ public void getLatestTetheringEntitlementResult(int type, ResultReceiver receiver,
boolean showEntitlementUi) {
if (receiver != null) {
- mEntitlementMgr.getLatestTetheringEntitlementValue(type, receiver, showEntitlementUi);
+ mEntitlementMgr.getLatestTetheringEntitlementResult(type, receiver, showEntitlementUi);
}
}
diff --git a/services/core/java/com/android/server/connectivity/Vpn.java b/services/core/java/com/android/server/connectivity/Vpn.java
index 205fc77..1b44f79 100644
--- a/services/core/java/com/android/server/connectivity/Vpn.java
+++ b/services/core/java/com/android/server/connectivity/Vpn.java
@@ -1840,6 +1840,7 @@
config.interfaze = iface;
config.session = profile.name;
config.isMetered = false;
+ config.proxyInfo = profile.proxy;
config.addLegacyRoutes(profile.routes);
if (!profile.dnsServers.isEmpty()) {
diff --git a/services/core/java/com/android/server/connectivity/tethering/EntitlementManager.java b/services/core/java/com/android/server/connectivity/tethering/EntitlementManager.java
index 75aac10..65cc516 100644
--- a/services/core/java/com/android/server/connectivity/tethering/EntitlementManager.java
+++ b/services/core/java/com/android/server/connectivity/tethering/EntitlementManager.java
@@ -291,7 +291,7 @@
}
/** Get the last value of the tethering entitlement check. */
- public void getLatestTetheringEntitlementValue(int downstream, ResultReceiver receiver,
+ public void getLatestTetheringEntitlementResult(int downstream, ResultReceiver receiver,
boolean showEntitlementUi) {
if (!isTetherProvisioningRequired()) {
receiver.send(TETHER_ERROR_NO_ERROR, null);
diff --git a/services/core/java/com/android/server/connectivity/tethering/TetheringConfiguration.java b/services/core/java/com/android/server/connectivity/tethering/TetheringConfiguration.java
index 8a46ff1..935b795 100644
--- a/services/core/java/com/android/server/connectivity/tethering/TetheringConfiguration.java
+++ b/services/core/java/com/android/server/connectivity/tethering/TetheringConfiguration.java
@@ -67,11 +67,6 @@
private static final String[] EMPTY_STRING_ARRAY = new String[0];
- @VisibleForTesting
- public static final int DUN_NOT_REQUIRED = 0;
- public static final int DUN_REQUIRED = 1;
- public static final int DUN_UNSPECIFIED = 2;
-
// Default ranges used for the legacy DHCP server.
// USB is 192.168.42.1 and 255.255.255.0
// Wifi is 192.168.43.1 and 255.255.255.0
@@ -90,7 +85,6 @@
public final String[] tetherableUsbRegexs;
public final String[] tetherableWifiRegexs;
public final String[] tetherableBluetoothRegexs;
- public final int dunCheck;
public final boolean isDunRequired;
public final boolean chooseUpstreamAutomatically;
public final Collection<Integer> preferredUpstreamIfaceTypes;
@@ -116,12 +110,10 @@
tetherableWifiRegexs = getResourceStringArray(res, config_tether_wifi_regexs);
tetherableBluetoothRegexs = getResourceStringArray(res, config_tether_bluetooth_regexs);
- dunCheck = checkDunRequired(ctx);
- configLog.log("DUN check returned: " + dunCheckString(dunCheck));
+ isDunRequired = checkDunRequired(ctx);
chooseUpstreamAutomatically = getResourceBoolean(res, config_tether_upstream_automatic);
- preferredUpstreamIfaceTypes = getUpstreamIfaceTypes(res, dunCheck);
- isDunRequired = preferredUpstreamIfaceTypes.contains(TYPE_MOBILE_DUN);
+ preferredUpstreamIfaceTypes = getUpstreamIfaceTypes(res, isDunRequired);
legacyDhcpRanges = getLegacyDhcpRanges(res);
defaultIPv4DNS = copy(DEFAULT_IPV4_DNS);
@@ -230,53 +222,43 @@
return upstreamNames;
}
- public static int checkDunRequired(Context ctx) {
+ /** Check whether dun is required. */
+ public static boolean checkDunRequired(Context ctx) {
final TelephonyManager tm = (TelephonyManager) ctx.getSystemService(TELEPHONY_SERVICE);
- return (tm != null) ? tm.getTetherApnRequired() : DUN_UNSPECIFIED;
+ return (tm != null) ? tm.getTetherApnRequired() : false;
}
- private static String dunCheckString(int dunCheck) {
- switch (dunCheck) {
- case DUN_NOT_REQUIRED: return "DUN_NOT_REQUIRED";
- case DUN_REQUIRED: return "DUN_REQUIRED";
- case DUN_UNSPECIFIED: return "DUN_UNSPECIFIED";
- default:
- return String.format("UNKNOWN (%s)", dunCheck);
- }
- }
-
- private static Collection<Integer> getUpstreamIfaceTypes(Resources res, int dunCheck) {
+ private static Collection<Integer> getUpstreamIfaceTypes(Resources res, boolean dunRequired) {
final int[] ifaceTypes = res.getIntArray(config_tether_upstream_types);
final ArrayList<Integer> upstreamIfaceTypes = new ArrayList<>(ifaceTypes.length);
for (int i : ifaceTypes) {
switch (i) {
case TYPE_MOBILE:
case TYPE_MOBILE_HIPRI:
- if (dunCheck == DUN_REQUIRED) continue;
+ if (dunRequired) continue;
break;
case TYPE_MOBILE_DUN:
- if (dunCheck == DUN_NOT_REQUIRED) continue;
+ if (!dunRequired) continue;
break;
}
upstreamIfaceTypes.add(i);
}
// Fix up upstream interface types for DUN or mobile. NOTE: independent
- // of the value of |dunCheck|, cell data of one form or another is
+ // of the value of |dunRequired|, cell data of one form or another is
// *always* an upstream, regardless of the upstream interface types
// specified by configuration resources.
- if (dunCheck == DUN_REQUIRED) {
+ if (dunRequired) {
appendIfNotPresent(upstreamIfaceTypes, TYPE_MOBILE_DUN);
- } else if (dunCheck == DUN_NOT_REQUIRED) {
- appendIfNotPresent(upstreamIfaceTypes, TYPE_MOBILE);
- appendIfNotPresent(upstreamIfaceTypes, TYPE_MOBILE_HIPRI);
} else {
- // Fix upstream interface types for case DUN_UNSPECIFIED.
// Do not modify if a cellular interface type is already present in the
// upstream interface types. Add TYPE_MOBILE and TYPE_MOBILE_HIPRI if no
// cellular interface types are found in the upstream interface types.
- if (!(containsOneOf(upstreamIfaceTypes,
- TYPE_MOBILE_DUN, TYPE_MOBILE, TYPE_MOBILE_HIPRI))) {
+ // This preserves backwards compatibility and prevents the DUN and default
+ // mobile types incorrectly appearing together, which could happen on
+ // previous releases in the common case where checkDunRequired returned
+ // DUN_UNSPECIFIED.
+ if (!containsOneOf(upstreamIfaceTypes, TYPE_MOBILE, TYPE_MOBILE_HIPRI)) {
upstreamIfaceTypes.add(TYPE_MOBILE);
upstreamIfaceTypes.add(TYPE_MOBILE_HIPRI);
}
diff --git a/services/core/java/com/android/server/net/NetworkStatsService.java b/services/core/java/com/android/server/net/NetworkStatsService.java
index 2e7cbc6..8fa435c 100644
--- a/services/core/java/com/android/server/net/NetworkStatsService.java
+++ b/services/core/java/com/android/server/net/NetworkStatsService.java
@@ -82,7 +82,6 @@
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.net.DataUsageRequest;
-import android.net.IConnectivityManager;
import android.net.INetworkManagementEventObserver;
import android.net.INetworkStatsService;
import android.net.INetworkStatsSession;
@@ -195,8 +194,6 @@
private final boolean mUseBpfTrafficStats;
- private IConnectivityManager mConnManager;
-
@VisibleForTesting
public static final String ACTION_NETWORK_STATS_POLL =
"com.android.server.action.NETWORK_STATS_POLL";
@@ -258,6 +255,7 @@
private final ArrayMap<String, NetworkIdentitySet> mActiveUidIfaces = new ArrayMap<>();
/** Current default active iface. */
+ @GuardedBy("mStatsLock")
private String mActiveIface;
/** Set of any ifaces associated with mobile networks since boot. */
@@ -268,6 +266,10 @@
@GuardedBy("mStatsLock")
private Network[] mDefaultNetworks = new Network[0];
+ /** Set containing info about active VPNs and their underlying networks. */
+ @GuardedBy("mStatsLock")
+ private VpnInfo[] mVpnInfos = new VpnInfo[0];
+
private final DropBoxNonMonotonicObserver mNonMonotonicObserver =
new DropBoxNonMonotonicObserver();
@@ -375,10 +377,6 @@
mHandlerCallback = callback;
}
- public void bindConnectivityManager(IConnectivityManager connManager) {
- mConnManager = checkNotNull(connManager, "missing IConnectivityManager");
- }
-
public void systemReady() {
mSystemReady = true;
@@ -857,13 +855,17 @@
}
@Override
- public void forceUpdateIfaces(Network[] defaultNetworks) {
+ public void forceUpdateIfaces(
+ Network[] defaultNetworks,
+ VpnInfo[] vpnArray,
+ NetworkState[] networkStates,
+ String activeIface) {
mContext.enforceCallingOrSelfPermission(READ_NETWORK_USAGE_HISTORY, TAG);
assertBandwidthControlEnabled();
final long token = Binder.clearCallingIdentity();
try {
- updateIfaces(defaultNetworks);
+ updateIfaces(defaultNetworks, vpnArray, networkStates, activeIface);
} finally {
Binder.restoreCallingIdentity(token);
}
@@ -1127,11 +1129,17 @@
}
};
- private void updateIfaces(Network[] defaultNetworks) {
+ private void updateIfaces(
+ Network[] defaultNetworks,
+ VpnInfo[] vpnArray,
+ NetworkState[] networkStates,
+ String activeIface) {
synchronized (mStatsLock) {
mWakeLock.acquire();
try {
- updateIfacesLocked(defaultNetworks);
+ mVpnInfos = vpnArray;
+ mActiveIface = activeIface;
+ updateIfacesLocked(defaultNetworks, networkStates);
} finally {
mWakeLock.release();
}
@@ -1145,7 +1153,7 @@
* {@link NetworkIdentitySet}.
*/
@GuardedBy("mStatsLock")
- private void updateIfacesLocked(Network[] defaultNetworks) {
+ private void updateIfacesLocked(Network[] defaultNetworks, NetworkState[] states) {
if (!mSystemReady) return;
if (LOGV) Slog.v(TAG, "updateIfacesLocked()");
@@ -1157,18 +1165,6 @@
// will be persisted during next alarm poll event.
performPollLocked(FLAG_PERSIST_NETWORK);
- final NetworkState[] states;
- final LinkProperties activeLink;
- try {
- states = mConnManager.getAllNetworkState();
- activeLink = mConnManager.getActiveLinkProperties();
- } catch (RemoteException e) {
- // ignored; service lives in system_server
- return;
- }
-
- mActiveIface = activeLink != null ? activeLink.getInterfaceName() : null;
-
// Rebuild active interfaces based on connected networks
mActiveIfaces.clear();
mActiveUidIfaces.clear();
@@ -1280,7 +1276,7 @@
Trace.traceEnd(TRACE_TAG_NETWORK);
// For per-UID stats, pass the VPN info so VPN traffic is reattributed to responsible apps.
- VpnInfo[] vpnArray = mConnManager.getAllVpnInfo();
+ VpnInfo[] vpnArray = mVpnInfos;
Trace.traceBegin(TRACE_TAG_NETWORK, "recordUid");
mUidRecorder.recordSnapshotLocked(uidSnapshot, mActiveUidIfaces, vpnArray, currentTime);
Trace.traceEnd(TRACE_TAG_NETWORK);
diff --git a/services/core/java/com/android/server/net/OWNERS b/services/core/java/com/android/server/net/OWNERS
index 2e91f99..28ae6a4 100644
--- a/services/core/java/com/android/server/net/OWNERS
+++ b/services/core/java/com/android/server/net/OWNERS
@@ -1,12 +1,11 @@
set noparent
codewiz@google.com
-ek@google.com
jchalard@google.com
jsharkey@android.com
+junyulai@google.com
lorenzo@google.com
reminv@google.com
satk@google.com
-silberst@google.com
sudheersai@google.com
yamasani@google.com
diff --git a/services/core/java/com/android/server/pm/OWNERS b/services/core/java/com/android/server/pm/OWNERS
index 8ce2568..3c1ee3e 100644
--- a/services/core/java/com/android/server/pm/OWNERS
+++ b/services/core/java/com/android/server/pm/OWNERS
@@ -14,72 +14,72 @@
per-file StagingManager.java = dariofreni@google.com, narayan@google.com, toddke@android.com, toddke@google.com
# dex
-per-file AbstractStatsBase.java = agampe@google.com
-per-file AbstractStatsBase.java = calin@google.com
-per-file AbstractStatsBase.java = ngeoffray@google.com
-per-file BackgroundDexOptService.java = agampe@google.com
-per-file BackgroundDexOptService.java = calin@google.com
-per-file BackgroundDexOptService.java = ngeoffray@google.com
-per-file CompilerStats.java = agampe@google.com
-per-file CompilerStats.java = calin@google.com
-per-file CompilerStats.java = ngeoffray@google.com
-per-file DynamicCodeLoggingService.java = agampe@google.com
-per-file DynamicCodeLoggingService.java = calin@google.com
-per-file DynamicCodeLoggingService.java = ngeoffray@google.com
-per-file InstructionSets.java = agampe@google.com
-per-file InstructionSets.java = calin@google.com
-per-file InstructionSets.java = ngeoffray@google.com
-per-file OtaDexoptService.java = agampe@google.com
-per-file OtaDexoptService.java = calin@google.com
-per-file OtaDexoptService.java = ngeoffray@google.com
-per-file OtaDexoptShellCommand.java = agampe@google.com
-per-file OtaDexoptShellCommand.java = calin@google.com
-per-file OtaDexoptShellCommand.java = ngeoffray@google.com
-per-file PackageDexOptimizer.java = agampe@google.com
-per-file PackageDexOptimizer.java = calin@google.com
-per-file PackageDexOptimizer.java = ngeoffray@google.com
-per-file PackageManagerServiceCompilerMapping.java = agampe@google.com
-per-file PackageManagerServiceCompilerMapping.java = calin@google.com
-per-file PackageManagerServiceCompilerMapping.java = ngeoffray@google.com
-per-file PackageUsage.java = agampe@google.com
-per-file PackageUsage.java = calin@google.com
-per-file PackageUsage.java = ngeoffray@google.com
+per-file AbstractStatsBase.java = agampe@google.com, toddke@google.com, svetoslavganov@google.com
+per-file AbstractStatsBase.java = calin@google.com, toddke@google.com, svetoslavganov@google.com
+per-file AbstractStatsBase.java = ngeoffray@google.com, toddke@google.com, svetoslavganov@google.com
+per-file BackgroundDexOptService.java = agampe@google.com, toddke@google.com, svetoslavganov@google.com
+per-file BackgroundDexOptService.java = calin@google.com, toddke@google.com, svetoslavganov@google.com
+per-file BackgroundDexOptService.java = ngeoffray@google.com, toddke@google.com, svetoslavganov@google.com
+per-file CompilerStats.java = agampe@google.com, toddke@google.com, svetoslavganov@google.com
+per-file CompilerStats.java = calin@google.com, toddke@google.com, svetoslavganov@google.com
+per-file CompilerStats.java = ngeoffray@google.com, toddke@google.com, svetoslavganov@google.com
+per-file DynamicCodeLoggingService.java = agampe@google.com, toddke@google.com, svetoslavganov@google.com
+per-file DynamicCodeLoggingService.java = calin@google.com, toddke@google.com, svetoslavganov@google.com
+per-file DynamicCodeLoggingService.java = ngeoffray@google.com, toddke@google.com, svetoslavganov@google.com
+per-file InstructionSets.java = agampe@google.com, toddke@google.com, svetoslavganov@google.com
+per-file InstructionSets.java = calin@google.com, toddke@google.com, svetoslavganov@google.com
+per-file InstructionSets.java = ngeoffray@google.com, toddke@google.com, svetoslavganov@google.com
+per-file OtaDexoptService.java = agampe@google.com, toddke@google.com, svetoslavganov@google.com
+per-file OtaDexoptService.java = calin@google.com, toddke@google.com, svetoslavganov@google.com
+per-file OtaDexoptService.java = ngeoffray@google.com, toddke@google.com, svetoslavganov@google.com
+per-file OtaDexoptShellCommand.java = agampe@google.com, toddke@google.com, svetoslavganov@google.com
+per-file OtaDexoptShellCommand.java = calin@google.com, toddke@google.com, svetoslavganov@google.com
+per-file OtaDexoptShellCommand.java = ngeoffray@google.com, toddke@google.com, svetoslavganov@google.com
+per-file PackageDexOptimizer.java = agampe@google.com, toddke@google.com, svetoslavganov@google.com
+per-file PackageDexOptimizer.java = calin@google.com, toddke@google.com, svetoslavganov@google.com
+per-file PackageDexOptimizer.java = ngeoffray@google.com, toddke@google.com, svetoslavganov@google.com
+per-file PackageManagerServiceCompilerMapping.java = agampe@google.com, toddke@google.com, svetoslavganov@google.com
+per-file PackageManagerServiceCompilerMapping.java = calin@google.com, toddke@google.com, svetoslavganov@google.com
+per-file PackageManagerServiceCompilerMapping.java = ngeoffray@google.com, toddke@google.com, svetoslavganov@google.com
+per-file PackageUsage.java = agampe@google.com, toddke@google.com, svetoslavganov@google.com
+per-file PackageUsage.java = calin@google.com, toddke@google.com, svetoslavganov@google.com
+per-file PackageUsage.java = ngeoffray@google.com, toddke@google.com, svetoslavganov@google.com
# multi user / cross profile
-per-file CrossProfileAppsServiceImpl.java = omakoto@google.com
-per-file CrossProfileAppsServiceImpl.java = yamasani@google.com
-per-file CrossProfileAppsService.java = omakoto@google.com
-per-file CrossProfileAppsService.java = yamasani@google.com
-per-file CrossProfileIntentFilter.java = omakoto@google.com
-per-file CrossProfileIntentFilter.java = yamasani@google.com
-per-file CrossProfileIntentResolver.java = omakoto@google.com
-per-file CrossProfileIntentResolver.java = yamasani@google.com
-per-file UserManagerService.java = omakoto@google.com
-per-file UserManagerService.java = yamasani@google.com
-per-file UserRestrictionsUtils.java = omakoto@google.com
-per-file UserRestrictionsUtils.java = yamasani@google.com
-per-file UserRestrictionsUtils.java = rubinxu@google.com
-per-file UserRestrictionsUtils.java = sandness@google.com
+per-file CrossProfileAppsServiceImpl.java = omakoto@google.com, yamasani@google.com, hackbod@google.com
+per-file CrossProfileAppsServiceImpl.java = yamasani@google.com, omakoto@google.com, hackbod@google.com
+per-file CrossProfileAppsService.java = omakoto@google.com, yamasani@google.com, hackbod@google.com
+per-file CrossProfileAppsService.java = yamasani@google.com, omakoto@google.com, hackbod@google.com
+per-file CrossProfileIntentFilter.java = omakoto@google.com, yamasani@google.com, hackbod@google.com
+per-file CrossProfileIntentFilter.java = yamasani@google.com, omakoto@google.com, hackbod@google.com
+per-file CrossProfileIntentResolver.java = omakoto@google.com, yamasani@google.com, hackbod@google.com
+per-file CrossProfileIntentResolver.java = yamasani@google.com, omakoto@google.com, hackbod@google.com
+per-file UserManagerService.java = omakoto@google.com, yamasani@google.com, hackbod@google.com
+per-file UserManagerService.java = yamasani@google.com, omakoto@google.com, hackbod@google.com
+per-file UserRestrictionsUtils.java = omakoto@google.com, yamasani@google.com, hackbod@google.com
+per-file UserRestrictionsUtils.java = yamasani@google.com, omakoto@google.com, hackbod@google.com
+per-file UserRestrictionsUtils.java = rubinxu@google.com, yamasani@google.com, hackbod@google.com
+per-file UserRestrictionsUtils.java = sandness@google.com, yamasani@google.com, hackbod@google.com
# security
-per-file KeySetHandle.java = cbrubaker@google.com
-per-file KeySetManagerService.java = cbrubaker@google.com
-per-file PackageKeySetData.java = cbrubaker@google.com
-per-file PackageSignatures.java = cbrubaker@google.com
-per-file SELinuxMMAC.java = cbrubaker@google.com
+per-file KeySetHandle.java = cbrubaker@google.com, svetoslavganov@google.com, hackbod@google.com
+per-file KeySetManagerService.java = cbrubaker@google.com, svetoslavganov@google.com, hackbod@google.com
+per-file PackageKeySetData.java = cbrubaker@google.com, svetoslavganov@google.com, hackbod@google.com
+per-file PackageSignatures.java = cbrubaker@google.com, svetoslavganov@google.com, hackbod@google.com
+per-file SELinuxMMAC.java = cbrubaker@google.com, svetoslavganov@google.com, hackbod@google.com
# shortcuts
-per-file LauncherAppsService.java = omakoto@google.com
-per-file ShareTargetInfo.java = omakoto@google.com
-per-file ShortcutBitmapSaver.java = omakoto@google.com
-per-file ShortcutDumpFiles.java = omakoto@google.com
-per-file ShortcutLauncher.java = omakoto@google.com
-per-file ShortcutNonPersistentUser.java = omakoto@google.com
-per-file ShortcutPackage.java = omakoto@google.com
-per-file ShortcutPackageInfo.java = omakoto@google.com
-per-file ShortcutPackageItem.java = omakoto@google.com
-per-file ShortcutParser.java = omakoto@google.com
-per-file ShortcutRequestPinProcessor.java = omakoto@google.com
-per-file ShortcutService.java = omakoto@google.com
-per-file ShortcutUser.java = omakoto@google.com
+per-file LauncherAppsService.java = omakoto@google.com, yamasani@google.com, hackbod@google.com
+per-file ShareTargetInfo.java = omakoto@google.com, yamasani@google.com, hackbod@google.com
+per-file ShortcutBitmapSaver.java = omakoto@google.com, yamasani@google.com, hackbod@google.com
+per-file ShortcutDumpFiles.java = omakoto@google.com, yamasani@google.com, hackbod@google.com
+per-file ShortcutLauncher.java = omakoto@google.com, yamasani@google.com, hackbod@google.com
+per-file ShortcutNonPersistentUser.java = omakoto@google.com, yamasani@google.com, hackbod@google.com
+per-file ShortcutPackage.java = omakoto@google.com, yamasani@google.com, hackbod@google.com
+per-file ShortcutPackageInfo.java = omakoto@google.com, yamasani@google.com, hackbod@google.com
+per-file ShortcutPackageItem.java = omakoto@google.com, yamasani@google.com, hackbod@google.com
+per-file ShortcutParser.java = omakoto@google.com, yamasani@google.com, hackbod@google.com
+per-file ShortcutRequestPinProcessor.java = omakoto@google.com, yamasani@google.com, hackbod@google.com
+per-file ShortcutService.java = omakoto@google.com, yamasani@google.com, hackbod@google.com
+per-file ShortcutUser.java = omakoto@google.com, yamasani@google.com, hackbod@google.com
diff --git a/services/core/java/com/android/server/pm/PackageDexOptimizer.java b/services/core/java/com/android/server/pm/PackageDexOptimizer.java
index 248a2f6..8018c2b 100644
--- a/services/core/java/com/android/server/pm/PackageDexOptimizer.java
+++ b/services/core/java/com/android/server/pm/PackageDexOptimizer.java
@@ -25,10 +25,12 @@
import android.content.pm.dex.DexMetadataHelper;
import android.os.FileUtils;
import android.os.PowerManager;
+import android.os.Process;
import android.os.SystemClock;
import android.os.SystemProperties;
import android.os.UserHandle;
import android.os.WorkSource;
+import android.os.storage.StorageManager;
import android.util.Log;
import android.util.Slog;
@@ -148,6 +150,51 @@
}
}
+ int performDexOpt(SharedLibraryInfo info, String[] instructionSets, DexoptOptions options) {
+ String classLoaderContext = DexoptUtils.getClassLoaderContext(info);
+ final String[] dexCodeInstructionSets = getDexCodeInstructionSets(instructionSets);
+ String compilerFilter = PackageManagerServiceCompilerMapping.getCompilerFilterForReason(
+ PackageManagerService.REASON_SHARED);
+ int result = DEX_OPT_SKIPPED;
+ for (String instructionSet : dexCodeInstructionSets) {
+ int dexoptNeeded = getDexoptNeeded(
+ info.getPath(), instructionSet, compilerFilter,
+ classLoaderContext, false /* newProfile */,
+ false /* downgrade */);
+ if (Math.abs(dexoptNeeded) == DexFile.NO_DEXOPT_NEEDED) {
+ continue;
+ }
+ // Special string recognized by installd.
+ final String packageName = "*";
+ final String outputPath = null;
+ int dexFlags = DEXOPT_PUBLIC
+ | (options.isBootComplete() ? DEXOPT_BOOTCOMPLETE : 0)
+ | (options.isDexoptIdleBackgroundJob() ? DEXOPT_IDLE_BACKGROUND_JOB : 0);
+ dexFlags = adjustDexoptFlags(dexFlags);
+ final String uuid = StorageManager.UUID_SYSTEM;
+ final String seInfo = null;
+ final int targetSdkVersion = 0; // Builtin libraries targets the system's SDK version
+ try {
+ mInstaller.dexopt(info.getPath(), Process.SYSTEM_UID, packageName,
+ instructionSet, dexoptNeeded, outputPath, dexFlags, compilerFilter,
+ uuid, classLoaderContext, seInfo, false /* downgrade */,
+ targetSdkVersion, /*profileName*/ null, /*dexMetadataPath*/ null,
+ getReasonName(options.getCompilationReason()));
+ // The end result is:
+ // - FAILED if any path failed,
+ // - PERFORMED if at least one path needed compilation,
+ // - SKIPPED when all paths are up to date
+ if (result != DEX_OPT_FAILED) {
+ result = DEX_OPT_PERFORMED;
+ }
+ } catch (InstallerException e) {
+ Slog.w(TAG, "Failed to dexopt", e);
+ result = DEX_OPT_FAILED;
+ }
+ }
+ return result;
+ }
+
/**
* Performs dexopt on all code paths of the given package.
* It assumes the install lock is held.
diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java
index 96441c5..a98e2d3 100644
--- a/services/core/java/com/android/server/pm/PackageManagerService.java
+++ b/services/core/java/com/android/server/pm/PackageManagerService.java
@@ -9443,18 +9443,27 @@
// at boot, or background job), the passed 'targetCompilerFilter' stays the same,
// and the first package that uses the library will dexopt it. The
// others will see that the compiled code for the library is up to date.
- Collection<PackageParser.Package> deps = findSharedNonSystemLibraries(p);
+ Collection<SharedLibraryInfo> deps = findSharedLibraries(p);
final String[] instructionSets = getAppDexInstructionSets(p.applicationInfo);
if (!deps.isEmpty()) {
DexoptOptions libraryOptions = new DexoptOptions(options.getPackageName(),
options.getCompilationReason(), options.getCompilerFilter(),
options.getSplitName(),
options.getFlags() | DexoptOptions.DEXOPT_AS_SHARED_LIBRARY);
- for (PackageParser.Package depPackage : deps) {
- // TODO: Analyze and investigate if we (should) profile libraries.
- pdo.performDexOpt(depPackage, instructionSets,
- getOrCreateCompilerPackageStats(depPackage),
- mDexManager.getPackageUseInfoOrDefault(depPackage.packageName), libraryOptions);
+ for (SharedLibraryInfo info : deps) {
+ PackageParser.Package depPackage = null;
+ synchronized (mPackages) {
+ depPackage = mPackages.get(info.getPackageName());
+ }
+ if (depPackage != null) {
+ // TODO: Analyze and investigate if we (should) profile libraries.
+ pdo.performDexOpt(depPackage, instructionSets,
+ getOrCreateCompilerPackageStats(depPackage),
+ mDexManager.getPackageUseInfoOrDefault(depPackage.packageName),
+ libraryOptions);
+ } else {
+ pdo.performDexOpt(info, instructionSets, libraryOptions);
+ }
}
}
return pdo.performDexOpt(p, instructionSets,
@@ -9494,63 +9503,48 @@
return BackgroundDexOptService.runIdleOptimizationsNow(this, mContext, packageNames);
}
- List<PackageParser.Package> findSharedNonSystemLibraries(PackageParser.Package p) {
- if (p.usesLibraries != null || p.usesOptionalLibraries != null
- || p.usesStaticLibraries != null) {
- ArrayList<PackageParser.Package> retValue = new ArrayList<>();
+ private static List<SharedLibraryInfo> findSharedLibraries(PackageParser.Package p) {
+ if (p.usesLibraryInfos != null) {
+ ArrayList<SharedLibraryInfo> retValue = new ArrayList<>();
Set<String> collectedNames = new HashSet<>();
- findSharedNonSystemLibrariesRecursive(p, retValue, collectedNames);
-
- retValue.remove(p);
-
+ for (SharedLibraryInfo info : p.usesLibraryInfos) {
+ findSharedLibrariesRecursive(info, retValue, collectedNames);
+ }
return retValue;
} else {
return Collections.emptyList();
}
}
- private void findSharedNonSystemLibrariesRecursive(PackageParser.Package p,
- ArrayList<PackageParser.Package> collected, Set<String> collectedNames) {
- if (!collectedNames.contains(p.packageName)) {
- collectedNames.add(p.packageName);
- collected.add(p);
+ private static void findSharedLibrariesRecursive(SharedLibraryInfo info,
+ ArrayList<SharedLibraryInfo> collected, Set<String> collectedNames) {
+ if (!collectedNames.contains(info.getName())) {
+ collectedNames.add(info.getName());
+ collected.add(info);
- if (p.usesLibraries != null) {
- findSharedNonSystemLibrariesRecursive(p.usesLibraries,
- null, collected, collectedNames);
- }
- if (p.usesOptionalLibraries != null) {
- findSharedNonSystemLibrariesRecursive(p.usesOptionalLibraries,
- null, collected, collectedNames);
- }
- if (p.usesStaticLibraries != null) {
- findSharedNonSystemLibrariesRecursive(p.usesStaticLibraries,
- p.usesStaticLibrariesVersions, collected, collectedNames);
+ if (info.getDependencies() != null) {
+ for (SharedLibraryInfo dep : info.getDependencies()) {
+ findSharedLibrariesRecursive(dep, collected, collectedNames);
+ }
}
}
}
- private void findSharedNonSystemLibrariesRecursive(ArrayList<String> libs, long[] versions,
- ArrayList<PackageParser.Package> collected, Set<String> collectedNames) {
- final int libNameCount = libs.size();
- for (int i = 0; i < libNameCount; i++) {
- String libName = libs.get(i);
- long version = (versions != null && versions.length == libNameCount)
- ? versions[i] : PackageManager.VERSION_CODE_HIGHEST;
- PackageParser.Package libPkg = findSharedNonSystemLibrary(libName, version);
- if (libPkg != null) {
- findSharedNonSystemLibrariesRecursive(libPkg, collected, collectedNames);
+ List<PackageParser.Package> findSharedNonSystemLibraries(PackageParser.Package pkg) {
+ List<SharedLibraryInfo> deps = findSharedLibraries(pkg);
+ if (!deps.isEmpty()) {
+ ArrayList<PackageParser.Package> retValue = new ArrayList<>();
+ synchronized (mPackages) {
+ for (SharedLibraryInfo info : deps) {
+ PackageParser.Package depPackage = mPackages.get(info.getPackageName());
+ if (depPackage != null) {
+ retValue.add(depPackage);
+ }
+ }
}
- }
- }
-
- private PackageParser.Package findSharedNonSystemLibrary(String name, long version) {
- synchronized (mPackages) {
- SharedLibraryInfo libraryInfo = getSharedLibraryInfoLPr(name, version);
- if (libraryInfo != null) {
- return mPackages.get(libraryInfo.getPackageName());
- }
- return null;
+ return retValue;
+ } else {
+ return Collections.emptyList();
}
}
diff --git a/services/core/java/com/android/server/pm/dex/DexoptUtils.java b/services/core/java/com/android/server/pm/dex/DexoptUtils.java
index 91ad11e..5a473c1 100644
--- a/services/core/java/com/android/server/pm/dex/DexoptUtils.java
+++ b/services/core/java/com/android/server/pm/dex/DexoptUtils.java
@@ -174,6 +174,18 @@
}
/**
+ * Creates the class loader context for the given shared library.
+ */
+ public static String getClassLoaderContext(SharedLibraryInfo info) {
+ String sharedLibrariesContext = "";
+ if (info.getDependencies() != null) {
+ sharedLibrariesContext = encodeSharedLibraries(info.getDependencies());
+ }
+ return encodeClassLoader(
+ "", SHARED_LIBRARY_LOADER_TYPE, sharedLibrariesContext);
+ }
+
+ /**
* Recursive method to generate the class loader context dependencies for the split with the
* given index. {@param classLoaderContexts} acts as an accumulator. Upton return
* {@code classLoaderContexts[index]} will contain the split dependency.
diff --git a/services/core/jni/Android.bp b/services/core/jni/Android.bp
index 6735ab4..07a6c70 100644
--- a/services/core/jni/Android.bp
+++ b/services/core/jni/Android.bp
@@ -38,6 +38,7 @@
"com_android_server_SerialService.cpp",
"com_android_server_storage_AppFuseBridge.cpp",
"com_android_server_SystemServer.cpp",
+ "com_android_server_TestNetworkService.cpp",
"com_android_server_tv_TvUinputBridge.cpp",
"com_android_server_tv_TvInputHal.cpp",
"com_android_server_vr_VrManagerService.cpp",
diff --git a/services/core/jni/com_android_server_TestNetworkService.cpp b/services/core/jni/com_android_server_TestNetworkService.cpp
new file mode 100644
index 0000000..b90ff23
--- /dev/null
+++ b/services/core/jni/com_android_server_TestNetworkService.cpp
@@ -0,0 +1,107 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_NDEBUG 0
+
+#define LOG_TAG "TestNetworkServiceJni"
+
+#include <arpa/inet.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <linux/if.h>
+#include <linux/if_tun.h>
+#include <linux/ipv6_route.h>
+#include <linux/route.h>
+#include <netinet/in.h>
+#include <stdio.h>
+#include <string.h>
+#include <sys/ioctl.h>
+#include <sys/socket.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+
+#include <log/log.h>
+
+#include "netutils/ifc.h"
+
+#include "jni.h"
+#include <android-base/stringprintf.h>
+#include <android-base/unique_fd.h>
+#include <nativehelper/JNIHelp.h>
+#include <nativehelper/ScopedUtfChars.h>
+
+namespace android {
+
+//------------------------------------------------------------------------------
+
+static void throwException(JNIEnv* env, int error, const char* action, const char* iface) {
+ const std::string& msg =
+ android::base::StringPrintf("Error %s %s: %s", action, iface, strerror(error));
+
+ jniThrowException(env, "java/lang/IllegalStateException", msg.c_str());
+}
+
+static int createTunInterface(JNIEnv* env, const char* iface) {
+ base::unique_fd tun(open("/dev/tun", O_RDWR | O_NONBLOCK));
+ ifreq ifr{};
+
+ // Allocate interface.
+ ifr.ifr_flags = IFF_TUN | IFF_NO_PI;
+ strlcpy(ifr.ifr_name, iface, IFNAMSIZ);
+ if (ioctl(tun.get(), TUNSETIFF, &ifr)) {
+ throwException(env, errno, "allocating", ifr.ifr_name);
+ return -1;
+ }
+
+ // Activate interface using an unconnected datagram socket.
+ base::unique_fd inet6CtrlSock(socket(AF_INET6, SOCK_DGRAM, 0));
+ ifr.ifr_flags = IFF_UP;
+
+ if (ioctl(inet6CtrlSock.get(), SIOCSIFFLAGS, &ifr)) {
+ throwException(env, errno, "activating", ifr.ifr_name);
+ return -1;
+ }
+
+ return tun.release();
+}
+
+//------------------------------------------------------------------------------
+
+static jint create(JNIEnv* env, jobject /* thiz */, jstring jIface) {
+ ScopedUtfChars iface(env, jIface);
+ if (!iface.c_str()) {
+ jniThrowNullPointerException(env, "iface");
+ return -1;
+ }
+
+ int tun = createTunInterface(env, iface.c_str());
+
+ // Any exceptions will be thrown from the createTunInterface call
+ return tun;
+}
+
+//------------------------------------------------------------------------------
+
+static const JNINativeMethod gMethods[] = {
+ {"jniCreateTun", "(Ljava/lang/String;)I", (void*)create},
+};
+
+int register_android_server_TestNetworkService(JNIEnv* env) {
+ return jniRegisterNativeMethods(env, "com/android/server/TestNetworkService", gMethods,
+ NELEM(gMethods));
+}
+
+}; // namespace android
diff --git a/services/core/jni/onload.cpp b/services/core/jni/onload.cpp
index bb6e684..83347bb 100644
--- a/services/core/jni/onload.cpp
+++ b/services/core/jni/onload.cpp
@@ -43,6 +43,7 @@
int register_android_server_location_GnssLocationProvider(JNIEnv* env);
int register_android_server_connectivity_Vpn(JNIEnv* env);
int register_android_server_connectivity_tethering_OffloadHardwareInterface(JNIEnv*);
+int register_android_server_TestNetworkService(JNIEnv* env);
int register_android_server_devicepolicy_CryptoTestHelper(JNIEnv*);
int register_android_server_hdmi_HdmiCecController(JNIEnv* env);
int register_android_server_tv_TvUinputBridge(JNIEnv* env);
@@ -88,6 +89,7 @@
register_android_server_location_GnssLocationProvider(env);
register_android_server_connectivity_Vpn(env);
register_android_server_connectivity_tethering_OffloadHardwareInterface(env);
+ register_android_server_TestNetworkService(env);
register_android_server_devicepolicy_CryptoTestHelper(env);
register_android_server_ConsumerIrService(env);
register_android_server_BatteryStatsService(env);
diff --git a/services/core/xsd/Android.bp b/services/core/xsd/Android.bp
new file mode 100644
index 0000000..5e1ea89
--- /dev/null
+++ b/services/core/xsd/Android.bp
@@ -0,0 +1,6 @@
+xsd_config {
+ name: "default-permissions",
+ srcs: ["default-permissions.xsd"],
+ api_dir: "schema",
+ package_name: "com.android.server.pm.permission",
+}
diff --git a/services/core/xsd/default-permissions.xsd b/services/core/xsd/default-permissions.xsd
new file mode 100644
index 0000000..d800a26
--- /dev/null
+++ b/services/core/xsd/default-permissions.xsd
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright (C) 2019 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- TODO: define a targetNamespace. Note that it will break retrocompatibility -->
+<xs:schema version="2.0"
+ elementFormDefault="qualified"
+ attributeFormDefault="unqualified"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema">
+ <xs:element name="exceptions">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="exception" type="exception" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:complexType name="exception">
+ <xs:sequence>
+ <xs:element name="permission" type="permission"/>
+ </xs:sequence>
+ <xs:attribute name="package" type="xs:string"/>
+ <xs:attribute name="sha256-cert-digest" type="xs:string"/>
+ <xs:attribute name="brand" type="xs:string"/>
+ </xs:complexType>
+ <xs:complexType name="permission">
+ <xs:attribute name="name" type="xs:string"/>
+ <xs:attribute name="fixed" type="xs:boolean"/>
+ </xs:complexType>
+</xs:schema>
diff --git a/services/core/xsd/schema/README.md b/services/core/xsd/schema/README.md
new file mode 100644
index 0000000..f52d93d
--- /dev/null
+++ b/services/core/xsd/schema/README.md
@@ -0,0 +1 @@
+Please see the [README](https://android.googlesource.com/platform/system/tools/xsdc/+/refs/heads/master/README.md) for details regarding the Configfile as API.
diff --git a/services/core/xsd/schema/current.txt b/services/core/xsd/schema/current.txt
new file mode 100644
index 0000000..4e67e5c
--- /dev/null
+++ b/services/core/xsd/schema/current.txt
@@ -0,0 +1,37 @@
+// Signature format: 2.0
+package com.android.server.pm.permission {
+
+ public class Exception {
+ ctor public Exception();
+ method public String getBrand();
+ method public com.android.server.pm.permission.Permission getPermission();
+ method public String getSha256CertDigest();
+ method public String get_package();
+ method public void setBrand(String);
+ method public void setPermission(com.android.server.pm.permission.Permission);
+ method public void setSha256CertDigest(String);
+ method public void set_package(String);
+ }
+
+ public class Exceptions {
+ ctor public Exceptions();
+ method public java.util.List<com.android.server.pm.permission.Exception> getException();
+ }
+
+ public class Permission {
+ ctor public Permission();
+ method public boolean getFixed();
+ method public String getName();
+ method public void setFixed(boolean);
+ method public void setName(String);
+ }
+
+ public class XmlParser {
+ ctor public XmlParser();
+ method public static com.android.server.pm.permission.Exceptions read(java.io.InputStream) throws javax.xml.datatype.DatatypeConfigurationException, java.io.IOException, org.xmlpull.v1.XmlPullParserException;
+ method public static String readText(org.xmlpull.v1.XmlPullParser) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
+ method public static void skip(org.xmlpull.v1.XmlPullParser) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
+ }
+
+}
+
diff --git a/services/core/xsd/schema/last_current.txt b/services/core/xsd/schema/last_current.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/services/core/xsd/schema/last_current.txt
diff --git a/services/core/xsd/schema/last_removed.txt b/services/core/xsd/schema/last_removed.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/services/core/xsd/schema/last_removed.txt
diff --git a/services/core/xsd/schema/removed.txt b/services/core/xsd/schema/removed.txt
new file mode 100644
index 0000000..d802177
--- /dev/null
+++ b/services/core/xsd/schema/removed.txt
@@ -0,0 +1 @@
+// Signature format: 2.0
diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java
index 2733da9..d288910 100644
--- a/services/java/com/android/server/SystemServer.java
+++ b/services/java/com/android/server/SystemServer.java
@@ -1235,7 +1235,6 @@
ServiceManager.addService(Context.CONNECTIVITY_SERVICE, connectivity,
/* allowIsolated= */ false,
DUMP_FLAG_PRIORITY_HIGH | DUMP_FLAG_PRIORITY_NORMAL);
- networkStats.bindConnectivityManager(connectivity);
networkPolicy.bindConnectivityManager(connectivity);
} catch (Throwable e) {
reportWtf("starting Connectivity Service", e);
@@ -1683,19 +1682,6 @@
mSystemServiceManager.startService(StatsCompanionService.Lifecycle.class);
traceEnd();
- if (safeMode) {
- traceBeginAndSlog("EnterSafeModeAndDisableJitCompilation");
- mActivityManagerService.enterSafeMode();
- // Disable the JIT for the system_server process
- VMRuntime.getRuntime().disableJitCompilation();
- traceEnd();
- } else {
- // Enable the JIT for the system_server process
- traceBeginAndSlog("StartJitCompilation");
- VMRuntime.getRuntime().startJitCompilation();
- traceEnd();
- }
-
// MMS service broker
traceBeginAndSlog("StartMmsService");
mmsService = mSystemServiceManager.startService(MmsServiceBroker.class);
diff --git a/services/net/OWNERS b/services/net/OWNERS
index 7311eee..d3836d4 100644
--- a/services/net/OWNERS
+++ b/services/net/OWNERS
@@ -1,8 +1,8 @@
set noparent
codewiz@google.com
-ek@google.com
jchalard@google.com
+junyulai@google.com
lorenzo@google.com
reminv@google.com
satk@google.com
diff --git a/services/net/java/android/net/NetworkStackClient.java b/services/net/java/android/net/NetworkStackClient.java
index 830dbbe..eed01ae 100644
--- a/services/net/java/android/net/NetworkStackClient.java
+++ b/services/net/java/android/net/NetworkStackClient.java
@@ -289,7 +289,8 @@
private void requestConnector(@NonNull NetworkStackCallback request) {
// TODO: PID check.
final int caller = Binder.getCallingUid();
- if (caller != Process.SYSTEM_UID && !UserHandle.isSameApp(caller, Process.BLUETOOTH_UID)) {
+ if (caller != Process.SYSTEM_UID && !UserHandle.isSameApp(caller, Process.BLUETOOTH_UID)
+ && !UserHandle.isSameApp(caller, Process.PHONE_UID)) {
// Don't even attempt to obtain the connector and give a nice error message
throw new SecurityException(
"Only the system server should try to bind to the network stack.");
diff --git a/services/net/java/android/net/ip/IpServer.java b/services/net/java/android/net/ip/IpServer.java
index 34fc735..0e44f88 100644
--- a/services/net/java/android/net/ip/IpServer.java
+++ b/services/net/java/android/net/ip/IpServer.java
@@ -87,7 +87,6 @@
return "UNKNOWN: " + state;
}
- private static final IpPrefix LINK_LOCAL_PREFIX = new IpPrefix("fe80::/64");
private static final byte DOUG_ADAMS = (byte) 42;
private static final String USB_NEAR_IFACE_ADDR = "192.168.42.129";
@@ -557,16 +556,6 @@
addedPrefixes.removeAll(mLastRaParams.prefixes);
}
- if (mLastRaParams == null || mLastRaParams.prefixes.isEmpty()) {
- // We need to be able to send unicast RAs, and clients might
- // like to ping the default router's link-local address. Note
- // that we never remove the link-local route from the network
- // until Tethering disables tethering on the interface. We
- // only need to add the link-local prefix once, but in the
- // event we add it more than once netd silently ignores EEXIST.
- addedPrefixes.add(LINK_LOCAL_PREFIX);
- }
-
if (!addedPrefixes.isEmpty()) {
final ArrayList<RouteInfo> toBeAdded =
getLocalRoutesFor(mIfaceName, addedPrefixes);
diff --git a/services/net/java/android/net/netlink/NetlinkSocket.java b/services/net/java/android/net/netlink/NetlinkSocket.java
index 16f72bd..4240d24 100644
--- a/services/net/java/android/net/netlink/NetlinkSocket.java
+++ b/services/net/java/android/net/netlink/NetlinkSocket.java
@@ -109,7 +109,7 @@
}
public static void connectToKernel(FileDescriptor fd) throws ErrnoException, SocketException {
- SocketUtils.connectSocket(fd, makeNetlinkSocketAddress(0, 0));
+ Os.connect(fd, makeNetlinkSocketAddress(0, 0));
}
private static void checkTimeout(long timeoutMs) {
diff --git a/services/tests/servicestests/Android.bp b/services/tests/servicestests/Android.bp
index d2d6e32..d148ea1 100644
--- a/services/tests/servicestests/Android.bp
+++ b/services/tests/servicestests/Android.bp
@@ -27,7 +27,7 @@
"services.net",
"services.usage",
"guava",
- "android-support-test",
+ "androidx.test.rules",
"mockito-target-minus-junit4",
"platform-test-annotations",
"ShortcutManagerTestUtils",
@@ -85,7 +85,7 @@
"utils/**/*.java",
],
static_libs: [
- "android-support-test",
+ "androidx.test.rules",
"mockito-target-minus-junit4",
],
libs: [
diff --git a/services/tests/servicestests/AndroidManifest.xml b/services/tests/servicestests/AndroidManifest.xml
index 13ba229..5a0f3a4 100644
--- a/services/tests/servicestests/AndroidManifest.xml
+++ b/services/tests/servicestests/AndroidManifest.xml
@@ -222,7 +222,7 @@
</application>
<instrumentation
- android:name="android.support.test.runner.AndroidJUnitRunner"
+ android:name="androidx.test.runner.AndroidJUnitRunner"
android:targetPackage="com.android.frameworks.servicestests"
android:label="Frameworks Services Tests" />
</manifest>
diff --git a/services/tests/servicestests/AndroidTest.xml b/services/tests/servicestests/AndroidTest.xml
index 5ac68d4..4d653b9 100644
--- a/services/tests/servicestests/AndroidTest.xml
+++ b/services/tests/servicestests/AndroidTest.xml
@@ -28,7 +28,7 @@
<option name="test-tag" value="FrameworksServicesTests" />
<test class="com.android.tradefed.testtype.AndroidJUnitTest" >
<option name="package" value="com.android.frameworks.servicestests" />
- <option name="runner" value="android.support.test.runner.AndroidJUnitRunner" />
+ <option name="runner" value="androidx.test.runner.AndroidJUnitRunner" />
<option name="hidden-api-checks" value="false"/>
</test>
</configuration>
diff --git a/services/tests/servicestests/src/com/android/server/AlarmManagerServiceTest.java b/services/tests/servicestests/src/com/android/server/AlarmManagerServiceTest.java
index 918807d..1f63d61 100644
--- a/services/tests/servicestests/src/com/android/server/AlarmManagerServiceTest.java
+++ b/services/tests/servicestests/src/com/android/server/AlarmManagerServiceTest.java
@@ -20,10 +20,11 @@
import static org.junit.Assert.assertEquals;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
import android.util.SparseArray;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.internal.util.ObjectUtils;
import com.android.server.AlarmManagerService.Alarm;
diff --git a/services/tests/servicestests/src/com/android/server/AppOpsUpgradeTest.java b/services/tests/servicestests/src/com/android/server/AppOpsUpgradeTest.java
index 4d77fab..aac96a1 100644
--- a/services/tests/servicestests/src/com/android/server/AppOpsUpgradeTest.java
+++ b/services/tests/servicestests/src/com/android/server/AppOpsUpgradeTest.java
@@ -25,13 +25,14 @@
import android.content.res.AssetManager;
import android.os.Handler;
import android.os.HandlerThread;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
import android.util.Log;
import android.util.SparseArray;
import android.util.Xml;
+import androidx.test.InstrumentationRegistry;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
diff --git a/services/tests/servicestests/src/com/android/server/BatteryServiceTest.java b/services/tests/servicestests/src/com/android/server/BatteryServiceTest.java
index 106f9e8..cb12ba7 100644
--- a/services/tests/servicestests/src/com/android/server/BatteryServiceTest.java
+++ b/services/tests/servicestests/src/com/android/server/BatteryServiceTest.java
@@ -17,28 +17,25 @@
package com.android.server;
import static junit.framework.Assert.*;
+
import static org.mockito.Mockito.*;
import android.hardware.health.V2_0.IHealth;
import android.hidl.manager.V1_0.IServiceManager;
import android.hidl.manager.V1_0.IServiceNotification;
-import android.os.RemoteException;
-import android.support.test.filters.SmallTest;
import android.test.AndroidTestCase;
-import android.util.Slog;
+
+import androidx.test.filters.SmallTest;
+
+import org.mockito.ArgumentMatcher;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+import org.mockito.invocation.InvocationOnMock;
import java.util.Arrays;
import java.util.Collection;
import java.util.NoSuchElementException;
-import org.junit.runner.RunWith;
-import org.mockito.ArgumentMatcher;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-import org.mockito.Spy;
-import org.mockito.invocation.InvocationOnMock;
-
-
public class BatteryServiceTest extends AndroidTestCase {
@Mock IServiceManager mMockedManager;
diff --git a/services/tests/servicestests/src/com/android/server/BootReceiverFixFsckFsStatTest.java b/services/tests/servicestests/src/com/android/server/BootReceiverFixFsckFsStatTest.java
index 69c1499..9ba3308 100644
--- a/services/tests/servicestests/src/com/android/server/BootReceiverFixFsckFsStatTest.java
+++ b/services/tests/servicestests/src/com/android/server/BootReceiverFixFsckFsStatTest.java
@@ -18,10 +18,8 @@
import static junit.framework.Assert.*;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
-
-import junit.framework.Assert;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
diff --git a/services/tests/servicestests/src/com/android/server/GestureLauncherServiceTest.java b/services/tests/servicestests/src/com/android/server/GestureLauncherServiceTest.java
index 33e4165..2ec6830 100644
--- a/services/tests/servicestests/src/com/android/server/GestureLauncherServiceTest.java
+++ b/services/tests/servicestests/src/com/android/server/GestureLauncherServiceTest.java
@@ -33,12 +33,13 @@
import android.os.UserHandle;
import android.platform.test.annotations.Presubmit;
import android.provider.Settings;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
import android.test.mock.MockContentResolver;
-import android.view.KeyEvent;
import android.util.MutableBoolean;
+import android.view.KeyEvent;
+
+import androidx.test.InstrumentationRegistry;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import com.android.internal.logging.MetricsLogger;
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
@@ -46,17 +47,16 @@
import com.android.server.LocalServices;
import com.android.server.statusbar.StatusBarManagerInternal;
-import java.util.List;
-
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.junit.runners.JUnit4;
import org.mockito.ArgumentCaptor;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
+import java.util.List;
+
/**
* Unit tests for {@link GestureLauncherService}.
* runtest frameworks-services -c com.android.server.GestureLauncherServiceTest
diff --git a/services/tests/servicestests/src/com/android/server/NetworkManagementInternalTest.java b/services/tests/servicestests/src/com/android/server/NetworkManagementInternalTest.java
index a5ac20e..ebbebcb 100644
--- a/services/tests/servicestests/src/com/android/server/NetworkManagementInternalTest.java
+++ b/services/tests/servicestests/src/com/android/server/NetworkManagementInternalTest.java
@@ -29,10 +29,11 @@
import static org.junit.Assert.assertTrue;
import android.net.NetworkPolicyManager;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
import android.util.ArrayMap;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -52,7 +53,7 @@
* Install: adb install -r \
* ${ANDROID_PRODUCT_OUT}/data/app/FrameworksServicesTests/FrameworksServicesTests.apk
* Run: adb shell am instrument -e class com.android.server.NetworkManagementInternalTest -w \
- * com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
+ * com.android.frameworks.servicestests/androidx.test.runner.AndroidJUnitRunner
*/
@SmallTest
@RunWith(AndroidJUnit4.class)
diff --git a/services/tests/servicestests/src/com/android/server/NetworkPolicyManagerServiceTest.java b/services/tests/servicestests/src/com/android/server/NetworkPolicyManagerServiceTest.java
index 39b6391..85d0c4c 100644
--- a/services/tests/servicestests/src/com/android/server/NetworkPolicyManagerServiceTest.java
+++ b/services/tests/servicestests/src/com/android/server/NetworkPolicyManagerServiceTest.java
@@ -122,8 +122,6 @@
import android.os.SimpleClock;
import android.os.SystemClock;
import android.os.UserHandle;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.runner.AndroidJUnit4;
import android.telephony.CarrierConfigManager;
import android.telephony.SubscriptionManager;
import android.telephony.SubscriptionPlan;
@@ -137,6 +135,9 @@
import android.util.Range;
import android.util.RecurrenceRule;
+import androidx.test.InstrumentationRegistry;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.internal.telephony.PhoneConstants;
import com.android.internal.util.test.BroadcastInterceptingContext;
import com.android.internal.util.test.BroadcastInterceptingContext.FutureIntent;
@@ -144,11 +145,11 @@
import com.android.server.net.NetworkPolicyManagerService;
import com.android.server.net.NetworkStatsManagerInternal;
+import com.google.common.util.concurrent.AbstractFuture;
+
import libcore.io.IoUtils;
import libcore.io.Streams;
-import com.google.common.util.concurrent.AbstractFuture;
-
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
@@ -200,7 +201,7 @@
m -j32 FrameworksServicesTests && adb install -r -g \
${ANDROID_PRODUCT_OUT}/data/app/FrameworksServicesTests/FrameworksServicesTests.apk && \
adb shell am instrument -e class "com.android.server.NetworkPolicyManagerServiceTest" -w \
- "com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner"
+ "com.android.frameworks.servicestests/androidx.test.runner.AndroidJUnitRunner"
* </code></pre>
*/
@RunWith(AndroidJUnit4.class)
diff --git a/services/tests/servicestests/src/com/android/server/NetworkScoreServiceTest.java b/services/tests/servicestests/src/com/android/server/NetworkScoreServiceTest.java
index 4176d2a..e9e96c9 100644
--- a/services/tests/servicestests/src/com/android/server/NetworkScoreServiceTest.java
+++ b/services/tests/servicestests/src/com/android/server/NetworkScoreServiceTest.java
@@ -24,14 +24,12 @@
import static junit.framework.Assert.fail;
import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyBoolean;
import static org.mockito.Matchers.anyListOf;
import static org.mockito.Matchers.anyString;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.atLeastOnce;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.never;
-import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.timeout;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
@@ -47,7 +45,6 @@
import android.content.pm.PackageManager;
import android.content.pm.PackageManagerInternal;
import android.content.res.Resources;
-import android.database.ContentObserver;
import android.net.INetworkRecommendationProvider;
import android.net.INetworkScoreCache;
import android.net.NetworkKey;
@@ -69,9 +66,10 @@
import android.os.RemoteException;
import android.os.UserHandle;
import android.provider.Settings;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.filters.MediumTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.InstrumentationRegistry;
+import androidx.test.filters.MediumTest;
+import androidx.test.runner.AndroidJUnit4;
import com.android.server.devicepolicy.MockUtils;
diff --git a/services/tests/servicestests/src/com/android/server/NetworkScorerAppManagerTest.java b/services/tests/servicestests/src/com/android/server/NetworkScorerAppManagerTest.java
index 6874624..52428e8 100644
--- a/services/tests/servicestests/src/com/android/server/NetworkScorerAppManagerTest.java
+++ b/services/tests/servicestests/src/com/android/server/NetworkScorerAppManagerTest.java
@@ -34,7 +34,6 @@
import android.app.AppOpsManager;
import android.content.ComponentName;
import android.content.Context;
-import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
@@ -45,14 +44,14 @@
import android.net.NetworkScorerAppData;
import android.os.Bundle;
import android.provider.Settings;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.runner.AndroidJUnit4;
import com.android.internal.R;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.ArgumentMatcher;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
diff --git a/services/tests/servicestests/src/com/android/server/WatchdogDiagnosticsTest.java b/services/tests/servicestests/src/com/android/server/WatchdogDiagnosticsTest.java
index 6e76b67..4d229ef 100644
--- a/services/tests/servicestests/src/com/android/server/WatchdogDiagnosticsTest.java
+++ b/services/tests/servicestests/src/com/android/server/WatchdogDiagnosticsTest.java
@@ -18,14 +18,14 @@
import static org.junit.Assert.assertEquals;
-import android.support.test.runner.AndroidJUnit4;
-
-import java.io.PrintWriter;
-import java.io.StringWriter;
+import androidx.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+
/**
* Unit tests for {@link WatchdogDiagnostics}
*/
diff --git a/services/tests/servicestests/src/com/android/server/accessibility/AccessibilityManagerTest.java b/services/tests/servicestests/src/com/android/server/accessibility/AccessibilityManagerTest.java
index 5d09e31..4c0f38a 100644
--- a/services/tests/servicestests/src/com/android/server/accessibility/AccessibilityManagerTest.java
+++ b/services/tests/servicestests/src/com/android/server/accessibility/AccessibilityManagerTest.java
@@ -18,6 +18,7 @@
import static junit.framework.TestCase.assertFalse;
import static junit.framework.TestCase.assertSame;
+
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
@@ -30,13 +31,14 @@
import android.app.Instrumentation;
import android.os.Looper;
import android.os.UserHandle;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.runner.AndroidJUnit4;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityManager;
import android.view.accessibility.IAccessibilityManager;
import android.view.accessibility.IAccessibilityManagerClient;
+import androidx.test.InstrumentationRegistry;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.internal.util.IntPair;
import org.junit.Before;
diff --git a/services/tests/servicestests/src/com/android/server/accessibility/KeyEventDispatcherTest.java b/services/tests/servicestests/src/com/android/server/accessibility/KeyEventDispatcherTest.java
index 1819398..236b458 100644
--- a/services/tests/servicestests/src/com/android/server/accessibility/KeyEventDispatcherTest.java
+++ b/services/tests/servicestests/src/com/android/server/accessibility/KeyEventDispatcherTest.java
@@ -19,6 +19,7 @@
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertFalse;
import static junit.framework.TestCase.assertTrue;
+
import static org.mockito.Matchers.anyInt;
import static org.mockito.Matchers.anyLong;
import static org.mockito.Matchers.anyObject;
@@ -30,11 +31,6 @@
import static org.mockito.Mockito.when;
import static org.mockito.hamcrest.MockitoHamcrest.argThat;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
import android.content.Context;
import android.os.Handler;
import android.os.IPowerManager;
@@ -42,9 +38,10 @@
import android.os.Message;
import android.os.PowerManager;
import android.os.RemoteException;
-import android.support.test.runner.AndroidJUnit4;
import android.view.KeyEvent;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.server.accessibility.KeyEventDispatcher.KeyEventFilter;
import com.android.server.policy.WindowManagerPolicy;
@@ -56,6 +53,11 @@
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
/**
* Tests for KeyEventDispatcher
*/
diff --git a/services/tests/servicestests/src/com/android/server/accessibility/KeyboardInterceptorTest.java b/services/tests/servicestests/src/com/android/server/accessibility/KeyboardInterceptorTest.java
index ceb3f9d..851e221 100644
--- a/services/tests/servicestests/src/com/android/server/accessibility/KeyboardInterceptorTest.java
+++ b/services/tests/servicestests/src/com/android/server/accessibility/KeyboardInterceptorTest.java
@@ -23,14 +23,19 @@
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Matchers.anyInt;
import static org.mockito.Matchers.anyObject;
-import static org.mockito.Matchers.isNull;
-import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import static org.mockito.hamcrest.MockitoHamcrest.argThat;
-import org.hamcrest.BaseMatcher;
+import android.os.Looper;
+import android.view.KeyEvent;
+
+import androidx.test.runner.AndroidJUnit4;
+
+import com.android.server.policy.WindowManagerPolicy;
+import com.android.server.policy.WindowManagerPolicy.WindowState;
+
import org.hamcrest.Description;
import org.hamcrest.TypeSafeMatcher;
import org.junit.Before;
@@ -42,13 +47,6 @@
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
-import android.os.Looper;
-import android.support.test.runner.AndroidJUnit4;
-import android.view.KeyEvent;
-
-import com.android.server.policy.WindowManagerPolicy;
-import com.android.server.policy.WindowManagerPolicy.WindowState;
-
/**
* Tests for KeyboardInterceptor
*/
diff --git a/services/tests/servicestests/src/com/android/server/accessibility/MagnificationControllerTest.java b/services/tests/servicestests/src/com/android/server/accessibility/MagnificationControllerTest.java
index d3a30909..cda4a4b 100644
--- a/services/tests/servicestests/src/com/android/server/accessibility/MagnificationControllerTest.java
+++ b/services/tests/servicestests/src/com/android/server/accessibility/MagnificationControllerTest.java
@@ -17,9 +17,9 @@
package com.android.server.accessibility;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.assertFalse;
import static org.mockito.ArgumentMatchers.anyFloat;
import static org.mockito.Matchers.anyObject;
import static org.mockito.Matchers.eq;
@@ -43,9 +43,10 @@
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
-import android.support.test.runner.AndroidJUnit4;
import android.view.MagnificationSpec;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.internal.R;
import com.android.server.wm.WindowManagerInternal;
import com.android.server.wm.WindowManagerInternal.MagnificationCallbacks;
diff --git a/services/tests/servicestests/src/com/android/server/accessibility/MagnificationGestureHandlerTest.java b/services/tests/servicestests/src/com/android/server/accessibility/MagnificationGestureHandlerTest.java
index 23fe0ff..79e4d70 100644
--- a/services/tests/servicestests/src/com/android/server/accessibility/MagnificationGestureHandlerTest.java
+++ b/services/tests/servicestests/src/com/android/server/accessibility/MagnificationGestureHandlerTest.java
@@ -35,12 +35,13 @@
import android.annotation.NonNull;
import android.content.Context;
import android.os.Message;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.runner.AndroidJUnit4;
import android.util.DebugUtils;
import android.view.InputDevice;
import android.view.MotionEvent;
+import androidx.test.InstrumentationRegistry;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.server.testutils.OffsettableClock;
import com.android.server.testutils.TestHandler;
@@ -50,7 +51,6 @@
import java.util.function.IntConsumer;
-
/**
* Tests the state transitions of {@link MagnificationGestureHandler}
*
diff --git a/services/tests/servicestests/src/com/android/server/accessibility/MotionEventInjectorTest.java b/services/tests/servicestests/src/com/android/server/accessibility/MotionEventInjectorTest.java
index 6cacb1f..5f0fa87 100644
--- a/services/tests/servicestests/src/com/android/server/accessibility/MotionEventInjectorTest.java
+++ b/services/tests/servicestests/src/com/android/server/accessibility/MotionEventInjectorTest.java
@@ -19,6 +19,7 @@
import static android.view.MotionEvent.ACTION_DOWN;
import static android.view.MotionEvent.ACTION_UP;
import static android.view.WindowManagerPolicyConstants.FLAG_PASS_TO_USER;
+
import static org.hamcrest.CoreMatchers.allOf;
import static org.hamcrest.CoreMatchers.anyOf;
import static org.hamcrest.CoreMatchers.everyItem;
@@ -45,18 +46,14 @@
import android.os.Looper;
import android.os.Message;
import android.os.RemoteException;
-import android.support.test.runner.AndroidJUnit4;
import android.util.Log;
-import android.util.Pair;
import android.view.InputDevice;
import android.view.KeyEvent;
import android.view.MotionEvent;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
import android.view.accessibility.AccessibilityEvent;
+
+import androidx.test.runner.AndroidJUnit4;
+
import org.hamcrest.Description;
import org.hamcrest.Matcher;
import org.hamcrest.TypeSafeMatcher;
@@ -66,6 +63,10 @@
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
/**
* Tests for MotionEventInjector
*/
diff --git a/services/tests/servicestests/src/com/android/server/accounts/AccountManagerServiceTest.java b/services/tests/servicestests/src/com/android/server/accounts/AccountManagerServiceTest.java
index f2057c5..7a96f4c 100644
--- a/services/tests/servicestests/src/com/android/server/accounts/AccountManagerServiceTest.java
+++ b/services/tests/servicestests/src/com/android/server/accounts/AccountManagerServiceTest.java
@@ -17,6 +17,7 @@
package com.android.server.accounts;
import static android.database.sqlite.SQLiteDatabase.deleteDatabase;
+
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyBoolean;
import static org.mockito.Matchers.anyInt;
@@ -25,7 +26,6 @@
import static org.mockito.Mockito.atLeast;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.nullable;
-import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@@ -35,11 +35,10 @@
import android.accounts.CantAddAccountActivity;
import android.accounts.IAccountManagerResponse;
import android.app.AppOpsManager;
+import android.app.INotificationManager;
import android.app.admin.DevicePolicyManager;
import android.app.admin.DevicePolicyManagerInternal;
-import android.app.INotificationManager;
import android.content.BroadcastReceiver;
-import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
@@ -68,7 +67,6 @@
import android.test.suitebuilder.annotation.SmallTest;
import android.util.Log;
-import com.android.frameworks.servicestests.R;
import com.android.server.LocalServices;
import org.mockito.ArgumentCaptor;
@@ -91,7 +89,6 @@
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicLong;
-
/**
* Tests for {@link AccountManagerService}.
* <p>Run with:<pre>
@@ -99,7 +96,7 @@
* adb install -r ${OUT}/data/app/FrameworksServicesTests/FrameworksServicesTests.apk
* adb shell am instrument -w -e package com.android.server.accounts \
* com.android.frameworks.servicestests\
- * /android.support.test.runner.AndroidJUnitRunner
+ * /androidx.test.runner.AndroidJUnitRunner
* </pre>
*/
public class AccountManagerServiceTest extends AndroidTestCase {
diff --git a/services/tests/servicestests/src/com/android/server/accounts/AccountsDbTest.java b/services/tests/servicestests/src/com/android/server/accounts/AccountsDbTest.java
index 65920fd..6b53002 100644
--- a/services/tests/servicestests/src/com/android/server/accounts/AccountsDbTest.java
+++ b/services/tests/servicestests/src/com/android/server/accounts/AccountsDbTest.java
@@ -30,11 +30,12 @@
import android.database.Cursor;
import android.database.sqlite.SQLiteStatement;
import android.os.Build;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.runner.AndroidJUnit4;
import android.test.suitebuilder.annotation.SmallTest;
import android.util.Pair;
+import androidx.test.InstrumentationRegistry;
+import androidx.test.runner.AndroidJUnit4;
+
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -55,7 +56,7 @@
* adb install \
* -r out/target/product/marlin/data/app/FrameworksServicesTests/FrameworksServicesTests.apk &&
* adb shell am instrument -e class com.android.server.accounts.AccountsDbTest \
- * -w com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
+ * -w com.android.frameworks.servicestests/androidx.test.runner.AndroidJUnitRunner
* </pre>
*/
@RunWith(AndroidJUnit4.class)
diff --git a/services/tests/servicestests/src/com/android/server/am/ActivityLaunchParamsModifierTests.java b/services/tests/servicestests/src/com/android/server/am/ActivityLaunchParamsModifierTests.java
index f741c70..d75a3fc 100644
--- a/services/tests/servicestests/src/com/android/server/am/ActivityLaunchParamsModifierTests.java
+++ b/services/tests/servicestests/src/com/android/server/am/ActivityLaunchParamsModifierTests.java
@@ -16,28 +16,29 @@
package com.android.server.am;
+import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
+import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
+
+import static com.android.server.am.LaunchParamsController.LaunchParamsModifier.RESULT_DONE;
+import static com.android.server.am.LaunchParamsController.LaunchParamsModifier.RESULT_SKIP;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
import android.app.ActivityOptions;
import android.content.pm.ActivityInfo;
import android.graphics.Rect;
import android.platform.test.annotations.Presubmit;
-import android.support.test.filters.MediumTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.filters.MediumTest;
+import androidx.test.runner.AndroidJUnit4;
import com.android.server.am.LaunchParamsController.LaunchParams;
-import org.junit.runner.RunWith;
+
import org.junit.Before;
import org.junit.Test;
-
-import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
-import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
-import static com.android.server.am.LaunchParamsController.LaunchParamsModifier.RESULT_DONE;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Mockito.spy;
-import static org.mockito.Mockito.doAnswer;
-
-import static com.android.server.am.LaunchParamsController.LaunchParamsModifier.RESULT_SKIP;
+import org.junit.runner.RunWith;
/**
* Tests for exercising resizing bounds due to activity options.
diff --git a/services/tests/servicestests/src/com/android/server/am/ActivityManagerInternalTest.java b/services/tests/servicestests/src/com/android/server/am/ActivityManagerInternalTest.java
index bce87dc..9a7488e 100644
--- a/services/tests/servicestests/src/com/android/server/am/ActivityManagerInternalTest.java
+++ b/services/tests/servicestests/src/com/android/server/am/ActivityManagerInternalTest.java
@@ -21,8 +21,9 @@
import android.app.ActivityManagerInternal;
import android.os.SystemClock;
-import android.support.test.filters.MediumTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.filters.MediumTest;
+import androidx.test.runner.AndroidJUnit4;
import org.junit.Before;
import org.junit.Test;
@@ -43,7 +44,7 @@
* Install: adb install -r \
* ${ANDROID_PRODUCT_OUT}/data/app/FrameworksServicesTests/FrameworksServicesTests.apk
* Run: adb shell am instrument -e class com.android.server.am.ActivityManagerInternalTest -w \
- * com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
+ * com.android.frameworks.servicestests/androidx.test.runner.AndroidJUnitRunner
*/
@RunWith(AndroidJUnit4.class)
public class ActivityManagerInternalTest {
diff --git a/services/tests/servicestests/src/com/android/server/am/ActivityManagerServiceTest.java b/services/tests/servicestests/src/com/android/server/am/ActivityManagerServiceTest.java
index 7ca06f9..c1df6af 100644
--- a/services/tests/servicestests/src/com/android/server/am/ActivityManagerServiceTest.java
+++ b/services/tests/servicestests/src/com/android/server/am/ActivityManagerServiceTest.java
@@ -28,6 +28,7 @@
import static android.app.ActivityManager.PROCESS_STATE_SERVICE;
import static android.app.ActivityManager.PROCESS_STATE_TOP;
import static android.util.DebugUtils.valueToString;
+
import static com.android.server.am.ActivityManagerInternalTest.CustomThread;
import static com.android.server.am.ActivityManagerService.DISPATCH_UIDS_CHANGED_UI_MSG;
import static com.android.server.am.ActivityManagerService.Injector;
@@ -62,10 +63,11 @@
import android.os.Process;
import android.os.RemoteException;
import android.os.SystemClock;
-import android.support.test.filters.FlakyTest;
-import android.support.test.filters.MediumTest;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.filters.FlakyTest;
+import androidx.test.filters.MediumTest;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import com.android.internal.os.BatteryStatsImpl;
import com.android.server.AppOpsService;
@@ -99,7 +101,7 @@
* Install: adb install -r \
* ${ANDROID_PRODUCT_OUT}/data/app/FrameworksServicesTests/FrameworksServicesTests.apk
* Run: adb shell am instrument -e class com.android.server.am.ActivityManagerServiceTest -w \
- * com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
+ * com.android.frameworks.servicestests/androidx.test.runner.AndroidJUnitRunner
*/
@SmallTest
@FlakyTest(bugId = 113616538)
diff --git a/services/tests/servicestests/src/com/android/server/am/ActivityRecordTests.java b/services/tests/servicestests/src/com/android/server/am/ActivityRecordTests.java
index 5ee1c40..5ee7477 100644
--- a/services/tests/servicestests/src/com/android/server/am/ActivityRecordTests.java
+++ b/services/tests/servicestests/src/com/android/server/am/ActivityRecordTests.java
@@ -22,11 +22,7 @@
import static android.content.pm.ActivityInfo.RESIZE_MODE_UNRESIZEABLE;
import static android.view.Display.DEFAULT_DISPLAY;
-import static com.android.server.am.ActivityStack.ActivityState.DESTROYED;
-import static com.android.server.am.ActivityStack.ActivityState.DESTROYING;
-import static com.android.server.am.ActivityStack.ActivityState.FINISHING;
import static com.android.server.am.ActivityStack.ActivityState.INITIALIZING;
-import static com.android.server.am.ActivityStack.ActivityState.PAUSED;
import static com.android.server.am.ActivityStack.ActivityState.PAUSING;
import static com.android.server.am.ActivityStack.ActivityState.STOPPED;
import static com.android.server.am.ActivityStack.REMOVE_TASK_MODE_MOVING;
@@ -53,14 +49,14 @@
import android.app.servertransaction.PauseActivityItem;
import android.graphics.Rect;
import android.platform.test.annotations.Presubmit;
-import android.support.test.filters.MediumTest;
-import android.support.test.runner.AndroidJUnit4;
import android.util.MutableBoolean;
-import org.junit.runner.RunWith;
+import androidx.test.filters.MediumTest;
+import androidx.test.runner.AndroidJUnit4;
+
import org.junit.Before;
-import org.junit.Ignore;
import org.junit.Test;
+import org.junit.runner.RunWith;
import org.mockito.invocation.InvocationOnMock;
/**
diff --git a/services/tests/servicestests/src/com/android/server/am/ActivityStackSupervisorTests.java b/services/tests/servicestests/src/com/android/server/am/ActivityStackSupervisorTests.java
index 1ce41a6..f36c5797 100644
--- a/services/tests/servicestests/src/com/android/server/am/ActivityStackSupervisorTests.java
+++ b/services/tests/servicestests/src/com/android/server/am/ActivityStackSupervisorTests.java
@@ -47,10 +47,11 @@
import android.app.WaitResult;
import android.graphics.Rect;
import android.platform.test.annotations.Presubmit;
-import android.support.test.filters.MediumTest;
-import android.support.test.runner.AndroidJUnit4;
import android.util.SparseIntArray;
+import androidx.test.filters.MediumTest;
+import androidx.test.runner.AndroidJUnit4;
+
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
diff --git a/services/tests/servicestests/src/com/android/server/am/ActivityStackTests.java b/services/tests/servicestests/src/com/android/server/am/ActivityStackTests.java
index e2b7c06..be0c689 100644
--- a/services/tests/servicestests/src/com/android/server/am/ActivityStackTests.java
+++ b/services/tests/servicestests/src/com/android/server/am/ActivityStackTests.java
@@ -33,23 +33,20 @@
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.anyInt;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
import android.content.pm.ActivityInfo;
import android.os.UserHandle;
import android.platform.test.annotations.Presubmit;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
-import org.junit.runner.RunWith;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import org.junit.Before;
import org.junit.Test;
+import org.junit.runner.RunWith;
/**
* Tests for the {@link ActivityStack} class.
diff --git a/services/tests/servicestests/src/com/android/server/am/ActivityStartControllerTests.java b/services/tests/servicestests/src/com/android/server/am/ActivityStartControllerTests.java
index 7948e4c..3464ac2 100644
--- a/services/tests/servicestests/src/com/android/server/am/ActivityStartControllerTests.java
+++ b/services/tests/servicestests/src/com/android/server/am/ActivityStartControllerTests.java
@@ -19,23 +19,24 @@
import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
-import android.content.Intent;
-import android.platform.test.annotations.Presubmit;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
-
-import com.android.server.am.ActivityStackSupervisor.PendingActivityLaunch;
-import com.android.server.am.ActivityStarter.Factory;
-
-import org.junit.runner.RunWith;
-import org.junit.Test;
-
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.spy;
-import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+
+import android.content.Intent;
+import android.platform.test.annotations.Presubmit;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
+import com.android.server.am.ActivityStackSupervisor.PendingActivityLaunch;
+import com.android.server.am.ActivityStarter.Factory;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
import java.util.Random;
diff --git a/services/tests/servicestests/src/com/android/server/am/ActivityStartInterceptorTest.java b/services/tests/servicestests/src/com/android/server/am/ActivityStartInterceptorTest.java
index b4b34c5..d1550d7 100644
--- a/services/tests/servicestests/src/com/android/server/am/ActivityStartInterceptorTest.java
+++ b/services/tests/servicestests/src/com/android/server/am/ActivityStartInterceptorTest.java
@@ -37,9 +37,10 @@
import android.content.pm.UserInfo;
import android.os.UserHandle;
import android.os.UserManager;
-import android.support.test.filters.SmallTest;
import android.testing.DexmakerShareClassLoaderRule;
+import androidx.test.filters.SmallTest;
+
import com.android.internal.app.SuspendedAppActivity;
import com.android.internal.app.UnlaunchableAppActivity;
import com.android.server.LocalServices;
diff --git a/services/tests/servicestests/src/com/android/server/am/ActivityStarterTests.java b/services/tests/servicestests/src/com/android/server/am/ActivityStarterTests.java
index 8d056fc..f956a36 100644
--- a/services/tests/servicestests/src/com/android/server/am/ActivityStarterTests.java
+++ b/services/tests/servicestests/src/com/android/server/am/ActivityStarterTests.java
@@ -32,29 +32,9 @@
import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED;
import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_PRIMARY;
import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_SECONDARY;
-
-import android.app.ActivityOptions;
-import android.app.IApplicationThread;
-import android.content.ComponentName;
-import android.content.Intent;
-import android.content.pm.ActivityInfo;
-import android.content.pm.ActivityInfo.WindowLayout;
-import android.content.pm.ApplicationInfo;
-import android.content.pm.IPackageManager;
-import android.graphics.Rect;
-import android.os.IBinder;
-import android.os.RemoteException;
-import android.platform.test.annotations.Presubmit;
-import android.service.voice.IVoiceInteractionSession;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
-import android.view.Gravity;
-
-import org.junit.runner.RunWith;
-import org.junit.Test;
-
import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK;
import static android.content.Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED;
+
import static com.android.server.am.ActivityManagerService.ANIMATE;
import static org.junit.Assert.assertEquals;
@@ -65,21 +45,37 @@
import static org.mockito.Mockito.anyObject;
import static org.mockito.Mockito.clearInvocations;
import static org.mockito.Mockito.doAnswer;
-import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.spy;
-import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+
+import android.app.ActivityOptions;
+import android.app.IApplicationThread;
+import android.content.Intent;
+import android.content.pm.ActivityInfo;
+import android.content.pm.ActivityInfo.WindowLayout;
+import android.content.pm.ApplicationInfo;
+import android.content.pm.IPackageManager;
+import android.graphics.Rect;
+import android.os.IBinder;
+import android.os.RemoteException;
+import android.platform.test.annotations.Presubmit;
+import android.service.voice.IVoiceInteractionSession;
+import android.view.Gravity;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import com.android.internal.os.BatteryStatsImpl;
-import com.android.server.am.ActivityStarter.Factory;
import com.android.server.am.LaunchParamsController.LaunchParamsModifier;
import com.android.server.am.TaskRecord.TaskRecordFactory;
-import java.util.ArrayList;
+import org.junit.Test;
+import org.junit.runner.RunWith;
/**
* Tests for the {@link ActivityStarter} class.
diff --git a/services/tests/servicestests/src/com/android/server/am/ActivityTestsBase.java b/services/tests/servicestests/src/com/android/server/am/ActivityTestsBase.java
index 1cd111f..deb9f62 100644
--- a/services/tests/servicestests/src/com/android/server/am/ActivityTestsBase.java
+++ b/services/tests/servicestests/src/com/android/server/am/ActivityTestsBase.java
@@ -21,21 +21,17 @@
import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED;
import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_PRIMARY;
import static android.view.Display.DEFAULT_DISPLAY;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.doNothing;
-import static org.mockito.Mockito.doReturn;
+
import static org.mockito.Mockito.any;
import static org.mockito.Mockito.anyBoolean;
import static org.mockito.Mockito.anyInt;
import static org.mockito.Mockito.doAnswer;
+import static org.mockito.Mockito.doNothing;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.spy;
import android.app.ActivityOptions;
-import com.android.server.wm.DisplayWindowController;
-
-import org.junit.Rule;
-import org.mockito.invocation.InvocationOnMock;
-
import android.app.IApplicationThread;
import android.content.ComponentName;
import android.content.Context;
@@ -49,23 +45,25 @@
import android.os.HandlerThread;
import android.os.Looper;
import android.service.voice.IVoiceInteractionSession;
-import android.support.test.InstrumentationRegistry;
import android.testing.DexmakerShareClassLoaderRule;
+import androidx.test.InstrumentationRegistry;
import com.android.internal.app.IVoiceInteractor;
-
import com.android.server.AttributeCache;
import com.android.server.wm.AppWindowContainerController;
+import com.android.server.wm.DisplayWindowController;
import com.android.server.wm.PinnedStackWindowController;
import com.android.server.wm.StackWindowController;
import com.android.server.wm.TaskWindowContainerController;
import com.android.server.wm.WindowManagerService;
import com.android.server.wm.WindowTestUtils;
+
import org.junit.After;
import org.junit.Before;
+import org.junit.Rule;
import org.mockito.MockitoAnnotations;
-
+import org.mockito.invocation.InvocationOnMock;
/**
* A base class to handle common operations in activity related unit tests.
diff --git a/services/tests/servicestests/src/com/android/server/am/AppErrorDialogTest.java b/services/tests/servicestests/src/com/android/server/am/AppErrorDialogTest.java
index eee8ef3..d08cac1 100644
--- a/services/tests/servicestests/src/com/android/server/am/AppErrorDialogTest.java
+++ b/services/tests/servicestests/src/com/android/server/am/AppErrorDialogTest.java
@@ -18,11 +18,12 @@
import android.content.Context;
import android.os.Handler;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.annotation.UiThreadTest;
-import android.support.test.filters.FlakyTest;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.InstrumentationRegistry;
+import androidx.test.annotation.UiThreadTest;
+import androidx.test.filters.FlakyTest;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import com.android.server.AppOpsService;
diff --git a/services/tests/servicestests/src/com/android/server/am/AssistDataRequesterTest.java b/services/tests/servicestests/src/com/android/server/am/AssistDataRequesterTest.java
index 5b1c260..d985364 100644
--- a/services/tests/servicestests/src/com/android/server/am/AssistDataRequesterTest.java
+++ b/services/tests/servicestests/src/com/android/server/am/AssistDataRequesterTest.java
@@ -41,13 +41,14 @@
import android.os.Handler;
import android.os.IBinder;
import android.os.Looper;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.filters.FlakyTest;
-import android.support.test.filters.MediumTest;
-import android.support.test.runner.AndroidJUnit4;
import android.util.Log;
import android.view.IWindowManager;
+import androidx.test.InstrumentationRegistry;
+import androidx.test.filters.FlakyTest;
+import androidx.test.filters.MediumTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.server.am.AssistDataRequester.AssistDataRequesterCallbacks;
import org.junit.Before;
diff --git a/services/tests/servicestests/src/com/android/server/am/ClientLifecycleManagerTests.java b/services/tests/servicestests/src/com/android/server/am/ClientLifecycleManagerTests.java
index ef6d5e8..b4ad183 100644
--- a/services/tests/servicestests/src/com/android/server/am/ClientLifecycleManagerTests.java
+++ b/services/tests/servicestests/src/com/android/server/am/ClientLifecycleManagerTests.java
@@ -9,8 +9,9 @@
import android.app.servertransaction.ClientTransaction;
import android.os.Binder;
import android.platform.test.annotations.Presubmit;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
diff --git a/services/tests/servicestests/src/com/android/server/am/CoreSettingsObserverTest.java b/services/tests/servicestests/src/com/android/server/am/CoreSettingsObserverTest.java
index da30c11..fe8256e 100644
--- a/services/tests/servicestests/src/com/android/server/am/CoreSettingsObserverTest.java
+++ b/services/tests/servicestests/src/com/android/server/am/CoreSettingsObserverTest.java
@@ -26,18 +26,18 @@
import android.os.Bundle;
import android.os.Handler;
import android.provider.Settings;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
import android.test.mock.MockContentResolver;
+import androidx.test.InstrumentationRegistry;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.internal.util.test.FakeSettingsProvider;
import com.android.server.AppOpsService;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
-import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
@@ -58,7 +58,7 @@
* Install: adb install -r \
* ${ANDROID_PRODUCT_OUT}/data/app/FrameworksServicesTests/FrameworksServicesTests.apk
* Run: adb shell am instrument -e class com.android.server.am.CoreSettingsObserverTest -w \
- * com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
+ * com.android.frameworks.servicestests/androidx.test.runner.AndroidJUnitRunner
*/
@SmallTest
@RunWith(AndroidJUnit4.class)
diff --git a/services/tests/servicestests/src/com/android/server/am/GlobalSettingsToPropertiesMapperTest.java b/services/tests/servicestests/src/com/android/server/am/GlobalSettingsToPropertiesMapperTest.java
index d9b3e1c..765aaad 100644
--- a/services/tests/servicestests/src/com/android/server/am/GlobalSettingsToPropertiesMapperTest.java
+++ b/services/tests/servicestests/src/com/android/server/am/GlobalSettingsToPropertiesMapperTest.java
@@ -18,11 +18,12 @@
import android.content.ContentResolver;
import android.provider.Settings;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
import android.test.mock.MockContentResolver;
+import androidx.test.InstrumentationRegistry;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.internal.util.Preconditions;
import com.android.internal.util.test.FakeSettingsProvider;
diff --git a/services/tests/servicestests/src/com/android/server/am/LaunchParamsControllerTests.java b/services/tests/servicestests/src/com/android/server/am/LaunchParamsControllerTests.java
index 161c287..8d675dd 100644
--- a/services/tests/servicestests/src/com/android/server/am/LaunchParamsControllerTests.java
+++ b/services/tests/servicestests/src/com/android/server/am/LaunchParamsControllerTests.java
@@ -16,20 +16,14 @@
package com.android.server.am;
-import android.app.ActivityOptions;
-import android.content.pm.ActivityInfo.WindowLayout;
-import android.platform.test.annotations.Presubmit;
-import android.support.test.filters.MediumTest;
-import android.support.test.runner.AndroidJUnit4;
-
-import com.android.server.am.LaunchParamsController.LaunchParams;
-import org.junit.runner.RunWith;
-import org.junit.Before;
-import org.junit.Test;
-
-import com.android.server.am.LaunchParamsController.LaunchParamsModifier;
-
import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM;
+
+import static com.android.server.am.LaunchParamsController.LaunchParamsModifier.RESULT_CONTINUE;
+import static com.android.server.am.LaunchParamsController.LaunchParamsModifier.RESULT_DONE;
+import static com.android.server.am.LaunchParamsController.LaunchParamsModifier.RESULT_SKIP;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotEquals;
import static org.mockito.Mockito.any;
import static org.mockito.Mockito.anyInt;
import static org.mockito.Mockito.doNothing;
@@ -40,12 +34,19 @@
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
-import static com.android.server.am.LaunchParamsController.LaunchParamsModifier.RESULT_DONE;
-import static com.android.server.am.LaunchParamsController.LaunchParamsModifier.RESULT_CONTINUE;
-import static com.android.server.am.LaunchParamsController.LaunchParamsModifier.RESULT_SKIP;
+import android.app.ActivityOptions;
+import android.content.pm.ActivityInfo.WindowLayout;
+import android.platform.test.annotations.Presubmit;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotEquals;
+import androidx.test.filters.MediumTest;
+import androidx.test.runner.AndroidJUnit4;
+
+import com.android.server.am.LaunchParamsController.LaunchParams;
+import com.android.server.am.LaunchParamsController.LaunchParamsModifier;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
/**
* Tests for exercising {@link LaunchParamsController}.
diff --git a/services/tests/servicestests/src/com/android/server/am/LockTaskControllerTest.java b/services/tests/servicestests/src/com/android/server/am/LockTaskControllerTest.java
index f46d712..863a0d8 100644
--- a/services/tests/servicestests/src/com/android/server/am/LockTaskControllerTest.java
+++ b/services/tests/servicestests/src/com/android/server/am/LockTaskControllerTest.java
@@ -52,12 +52,13 @@
import android.os.UserHandle;
import android.platform.test.annotations.Presubmit;
import android.provider.Settings;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.filters.SmallTest;
import android.telecom.TelecomManager;
import android.testing.DexmakerShareClassLoaderRule;
import android.util.Pair;
+import androidx.test.InstrumentationRegistry;
+import androidx.test.filters.SmallTest;
+
import com.android.internal.statusbar.IStatusBarService;
import com.android.internal.widget.LockPatternUtils;
import com.android.server.LocalServices;
diff --git a/services/tests/servicestests/src/com/android/server/am/MemoryStatUtilTest.java b/services/tests/servicestests/src/com/android/server/am/MemoryStatUtilTest.java
index 5518ca5..06c7437 100644
--- a/services/tests/servicestests/src/com/android/server/am/MemoryStatUtilTest.java
+++ b/services/tests/servicestests/src/com/android/server/am/MemoryStatUtilTest.java
@@ -16,15 +16,15 @@
package com.android.server.am;
+import static com.android.server.am.MemoryStatUtil.MemoryStat;
import static com.android.server.am.MemoryStatUtil.parseMemoryStatFromMemcg;
import static com.android.server.am.MemoryStatUtil.parseMemoryStatFromProcfs;
-import static com.android.server.am.MemoryStatUtil.MemoryStat;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
diff --git a/services/tests/servicestests/src/com/android/server/am/PendingRemoteAnimationRegistryTest.java b/services/tests/servicestests/src/com/android/server/am/PendingRemoteAnimationRegistryTest.java
index 2baf995..f5f507f 100644
--- a/services/tests/servicestests/src/com/android/server/am/PendingRemoteAnimationRegistryTest.java
+++ b/services/tests/servicestests/src/com/android/server/am/PendingRemoteAnimationRegistryTest.java
@@ -20,16 +20,14 @@
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
-import android.annotation.Nullable;
import android.app.ActivityOptions;
-import android.os.Handler;
import android.platform.test.annotations.Presubmit;
-import android.support.test.filters.FlakyTest;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
-import android.util.ArrayMap;
import android.view.RemoteAnimationAdapter;
+import androidx.test.filters.FlakyTest;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.server.testutils.OffsettableClock;
import com.android.server.testutils.TestHandler;
diff --git a/services/tests/servicestests/src/com/android/server/am/RecentTasksTest.java b/services/tests/servicestests/src/com/android/server/am/RecentTasksTest.java
index b73ac89..aa9123b 100644
--- a/services/tests/servicestests/src/com/android/server/am/RecentTasksTest.java
+++ b/services/tests/servicestests/src/com/android/server/am/RecentTasksTest.java
@@ -35,16 +35,10 @@
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.spy;
-import static java.lang.Integer.MAX_VALUE;
-
-import android.annotation.TestApi;
import android.app.ActivityManager;
import android.app.ActivityManager.RecentTaskInfo;
import android.app.ActivityManager.RunningTaskInfo;
-import android.app.WindowConfiguration;
import android.content.ComponentName;
import android.content.Context;
import android.content.pm.PackageManager;
@@ -53,24 +47,26 @@
import android.content.res.Configuration;
import android.graphics.Rect;
import android.os.Bundle;
-import android.os.Debug;
import android.os.Looper;
import android.os.RemoteException;
import android.os.SystemClock;
import android.platform.test.annotations.Presubmit;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.filters.MediumTest;
-import android.support.test.runner.AndroidJUnit4;
import android.util.MutableLong;
import android.util.SparseArray;
import android.util.SparseBooleanArray;
+import androidx.test.InstrumentationRegistry;
+import androidx.test.filters.MediumTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.server.am.RecentTasks.Callbacks;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
+import static java.lang.Integer.MAX_VALUE;
+
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
diff --git a/services/tests/servicestests/src/com/android/server/am/RecentsAnimationTest.java b/services/tests/servicestests/src/com/android/server/am/RecentsAnimationTest.java
index eefd973..fa6a95c 100644
--- a/services/tests/servicestests/src/com/android/server/am/RecentsAnimationTest.java
+++ b/services/tests/servicestests/src/com/android/server/am/RecentsAnimationTest.java
@@ -16,15 +16,13 @@
package com.android.server.am;
-import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME;
import static android.app.WindowConfiguration.ACTIVITY_TYPE_RECENTS;
import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
-import static android.content.Intent.FLAG_ACTIVITY_MULTIPLE_TASK;
-import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK;
+
import static com.android.server.wm.RecentsAnimationController.REORDER_KEEP_IN_PLACE;
+
import static org.mockito.Mockito.any;
-import static org.mockito.Mockito.anyInt;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.eq;
import static org.mockito.Mockito.mock;
@@ -35,11 +33,14 @@
import android.content.Context;
import android.content.Intent;
import android.platform.test.annotations.Presubmit;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.filters.MediumTest;
-import android.support.test.runner.AndroidJUnit4;
import android.view.IRecentsAnimationRunner;
+
+import androidx.test.InstrumentationRegistry;
+import androidx.test.filters.MediumTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.server.AttributeCache;
+
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
diff --git a/services/tests/servicestests/src/com/android/server/am/RunningTasksTest.java b/services/tests/servicestests/src/com/android/server/am/RunningTasksTest.java
index c6ce7e1..19288a9 100644
--- a/services/tests/servicestests/src/com/android/server/am/RunningTasksTest.java
+++ b/services/tests/servicestests/src/com/android/server/am/RunningTasksTest.java
@@ -30,11 +30,12 @@
import android.content.ComponentName;
import android.content.Context;
import android.platform.test.annotations.Presubmit;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.filters.MediumTest;
-import android.support.test.runner.AndroidJUnit4;
import android.util.SparseArray;
+import androidx.test.InstrumentationRegistry;
+import androidx.test.filters.MediumTest;
+import androidx.test.runner.AndroidJUnit4;
+
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
diff --git a/services/tests/servicestests/src/com/android/server/am/SafeActivityOptionsTest.java b/services/tests/servicestests/src/com/android/server/am/SafeActivityOptionsTest.java
index 168bc17..8e4e7e6 100644
--- a/services/tests/servicestests/src/com/android/server/am/SafeActivityOptionsTest.java
+++ b/services/tests/servicestests/src/com/android/server/am/SafeActivityOptionsTest.java
@@ -20,9 +20,10 @@
import android.app.ActivityOptions;
import android.platform.test.annotations.Presubmit;
-import android.support.test.filters.FlakyTest;
-import android.support.test.filters.MediumTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.filters.FlakyTest;
+import androidx.test.filters.MediumTest;
+import androidx.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
diff --git a/services/tests/servicestests/src/com/android/server/am/TaskLaunchParamsModifierTests.java b/services/tests/servicestests/src/com/android/server/am/TaskLaunchParamsModifierTests.java
index 3d323f0..eec55b1 100644
--- a/services/tests/servicestests/src/com/android/server/am/TaskLaunchParamsModifierTests.java
+++ b/services/tests/servicestests/src/com/android/server/am/TaskLaunchParamsModifierTests.java
@@ -16,31 +16,24 @@
package com.android.server.am;
-import android.content.pm.ActivityInfo.WindowLayout;
-import android.graphics.Rect;
-import android.platform.test.annotations.Presubmit;
-import android.support.test.filters.MediumTest;
-import android.support.test.runner.AndroidJUnit4;
-
-import android.view.Gravity;
-
-import org.junit.runner.RunWith;
-import org.junit.Before;
-import org.junit.Test;
-
-import org.mockito.invocation.InvocationOnMock;
-
import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM;
import static com.android.server.am.LaunchParamsController.LaunchParamsModifier.RESULT_CONTINUE;
-import static org.mockito.Mockito.any;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-import static org.mockito.Mockito.doAnswer;
import static org.junit.Assert.assertEquals;
+import android.content.pm.ActivityInfo.WindowLayout;
+import android.graphics.Rect;
+import android.platform.test.annotations.Presubmit;
+import android.view.Gravity;
+
+import androidx.test.filters.MediumTest;
+import androidx.test.runner.AndroidJUnit4;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
/**
* Tests for exercising resizing task bounds.
diff --git a/services/tests/servicestests/src/com/android/server/am/TaskRecordTests.java b/services/tests/servicestests/src/com/android/server/am/TaskRecordTests.java
index 057fdc8..5aecec0 100644
--- a/services/tests/servicestests/src/com/android/server/am/TaskRecordTests.java
+++ b/services/tests/servicestests/src/com/android/server/am/TaskRecordTests.java
@@ -29,20 +29,17 @@
import android.content.ComponentName;
import android.content.Intent;
import android.content.pm.ActivityInfo;
-import android.content.res.XmlResourceParser;
import android.graphics.Rect;
import android.platform.test.annotations.Presubmit;
import android.service.voice.IVoiceInteractionSession;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.filters.MediumTest;
-import android.support.test.runner.AndroidJUnit4;
import android.util.Xml;
-import com.android.frameworks.servicestests.R;
+import androidx.test.filters.MediumTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.internal.app.IVoiceInteractor;
import com.android.server.am.TaskRecord.TaskRecordFactory;
-import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -57,9 +54,7 @@
import java.io.IOException;
import java.io.OutputStream;
import java.io.Reader;
-import java.nio.file.Files;
import java.util.ArrayList;
-import java.util.Comparator;
/**
* Tests for exercising {@link TaskRecord}.
diff --git a/services/tests/servicestests/src/com/android/server/am/TaskStackChangedListenerTest.java b/services/tests/servicestests/src/com/android/server/am/TaskStackChangedListenerTest.java
index 0359096..9406160 100644
--- a/services/tests/servicestests/src/com/android/server/am/TaskStackChangedListenerTest.java
+++ b/services/tests/servicestests/src/com/android/server/am/TaskStackChangedListenerTest.java
@@ -16,7 +16,8 @@
package com.android.server.am;
-import static android.support.test.InstrumentationRegistry.getInstrumentation;
+import static androidx.test.InstrumentationRegistry.getInstrumentation;
+
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
@@ -32,23 +33,25 @@
import android.content.Context;
import android.content.Intent;
import android.content.pm.ActivityInfo;
-import android.content.res.Resources.Theme;
import android.os.RemoteException;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.filters.MediumTest;
-import android.support.test.runner.AndroidJUnit4;
import android.support.test.uiautomator.UiDevice;
import android.text.TextUtils;
-import android.util.Pair;
+
+import androidx.test.InstrumentationRegistry;
+import androidx.test.filters.MediumTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.internal.annotations.GuardedBy;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
+
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+
@MediumTest
@RunWith(AndroidJUnit4.class)
public class TaskStackChangedListenerTest {
diff --git a/services/tests/servicestests/src/com/android/server/appops/AppOpsActiveWatcherTest.java b/services/tests/servicestests/src/com/android/server/appops/AppOpsActiveWatcherTest.java
index 7f397d6..7e0dfcf 100644
--- a/services/tests/servicestests/src/com/android/server/appops/AppOpsActiveWatcherTest.java
+++ b/services/tests/servicestests/src/com/android/server/appops/AppOpsActiveWatcherTest.java
@@ -31,9 +31,10 @@
import android.app.AppOpsManager.OnOpActiveChangedListener;
import android.content.Context;
import android.os.Process;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.InstrumentationRegistry;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
diff --git a/services/tests/servicestests/src/com/android/server/appops/AppOpsServiceTest.java b/services/tests/servicestests/src/com/android/server/appops/AppOpsServiceTest.java
index ad21a78..2c255cb 100644
--- a/services/tests/servicestests/src/com/android/server/appops/AppOpsServiceTest.java
+++ b/services/tests/servicestests/src/com/android/server/appops/AppOpsServiceTest.java
@@ -29,9 +29,10 @@
import android.os.Handler;
import android.os.HandlerThread;
import android.os.Process;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.InstrumentationRegistry;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import org.junit.Before;
import org.junit.Test;
diff --git a/services/tests/servicestests/src/com/android/server/appwidget/AppWidgetServiceImplTest.java b/services/tests/servicestests/src/com/android/server/appwidget/AppWidgetServiceImplTest.java
index 1bb93cc..f3c76b6 100644
--- a/services/tests/servicestests/src/com/android/server/appwidget/AppWidgetServiceImplTest.java
+++ b/services/tests/servicestests/src/com/android/server/appwidget/AppWidgetServiceImplTest.java
@@ -53,7 +53,6 @@
import java.util.Random;
import java.util.concurrent.CountDownLatch;
-
/**
* Tests for {@link AppWidgetManager} and {@link AppWidgetServiceImpl}.
*
@@ -61,7 +60,7 @@
adb install \
-r -g ${ANDROID_PRODUCT_OUT}/data/app/FrameworksServicesTests/FrameworksServicesTests.apk &&
adb shell am instrument -e class com.android.server.appwidget.AppWidgetServiceImplTest \
- -w com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
+ -w com.android.frameworks.servicestests/androidx.test.runner.AndroidJUnitRunner
*/
@SmallTest
public class AppWidgetServiceImplTest extends InstrumentationTestCase {
diff --git a/services/tests/servicestests/src/com/android/server/backup/BackupPasswordManagerTest.java b/services/tests/servicestests/src/com/android/server/backup/BackupPasswordManagerTest.java
index bc16297..bcf4c08 100644
--- a/services/tests/servicestests/src/com/android/server/backup/BackupPasswordManagerTest.java
+++ b/services/tests/servicestests/src/com/android/server/backup/BackupPasswordManagerTest.java
@@ -25,8 +25,9 @@
import android.content.Context;
import android.platform.test.annotations.Presubmit;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import com.android.server.backup.utils.PasswordUtils;
diff --git a/services/tests/servicestests/src/com/android/server/backup/DataChangedJournalTest.java b/services/tests/servicestests/src/com/android/server/backup/DataChangedJournalTest.java
index c27fd07..ff450af 100644
--- a/services/tests/servicestests/src/com/android/server/backup/DataChangedJournalTest.java
+++ b/services/tests/servicestests/src/com/android/server/backup/DataChangedJournalTest.java
@@ -19,8 +19,9 @@
import static com.google.common.truth.Truth.assertThat;
import android.platform.test.annotations.Presubmit;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import org.junit.Before;
import org.junit.Rule;
diff --git a/services/tests/servicestests/src/com/android/server/backup/ProcessedPackagesJournalTest.java b/services/tests/servicestests/src/com/android/server/backup/ProcessedPackagesJournalTest.java
index b4a1f18..cf4f975 100644
--- a/services/tests/servicestests/src/com/android/server/backup/ProcessedPackagesJournalTest.java
+++ b/services/tests/servicestests/src/com/android/server/backup/ProcessedPackagesJournalTest.java
@@ -19,8 +19,9 @@
import static com.google.common.truth.Truth.assertThat;
import android.platform.test.annotations.Presubmit;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import com.google.android.collect.Sets;
diff --git a/services/tests/servicestests/src/com/android/server/backup/TrampolineTest.java b/services/tests/servicestests/src/com/android/server/backup/TrampolineTest.java
index bbd999b..79eba68 100644
--- a/services/tests/servicestests/src/com/android/server/backup/TrampolineTest.java
+++ b/services/tests/servicestests/src/com/android/server/backup/TrampolineTest.java
@@ -43,8 +43,9 @@
import android.os.RemoteException;
import android.os.UserHandle;
import android.platform.test.annotations.Presubmit;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import org.junit.Before;
import org.junit.Test;
diff --git a/services/tests/servicestests/src/com/android/server/backup/restore/PerformAdbRestoreTaskTest.java b/services/tests/servicestests/src/com/android/server/backup/restore/PerformAdbRestoreTaskTest.java
index 05f4c13..00c6391 100644
--- a/services/tests/servicestests/src/com/android/server/backup/restore/PerformAdbRestoreTaskTest.java
+++ b/services/tests/servicestests/src/com/android/server/backup/restore/PerformAdbRestoreTaskTest.java
@@ -20,9 +20,10 @@
import android.content.Context;
import android.platform.test.annotations.Presubmit;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.InstrumentationRegistry;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import com.android.frameworks.servicestests.R;
diff --git a/services/tests/servicestests/src/com/android/server/backup/utils/AppBackupUtilsTest.java b/services/tests/servicestests/src/com/android/server/backup/utils/AppBackupUtilsTest.java
index 4f18be7..944a558 100644
--- a/services/tests/servicestests/src/com/android/server/backup/utils/AppBackupUtilsTest.java
+++ b/services/tests/servicestests/src/com/android/server/backup/utils/AppBackupUtilsTest.java
@@ -20,7 +20,6 @@
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
@@ -31,8 +30,9 @@
import android.content.pm.SigningInfo;
import android.os.Process;
import android.platform.test.annotations.Presubmit;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import com.android.server.backup.BackupManagerService;
import com.android.server.backup.testutils.PackageManagerStub;
diff --git a/services/tests/servicestests/src/com/android/server/backup/utils/BackupManagerMonitorUtilsTest.java b/services/tests/servicestests/src/com/android/server/backup/utils/BackupManagerMonitorUtilsTest.java
index c40b411..d3fd89c 100644
--- a/services/tests/servicestests/src/com/android/server/backup/utils/BackupManagerMonitorUtilsTest.java
+++ b/services/tests/servicestests/src/com/android/server/backup/utils/BackupManagerMonitorUtilsTest.java
@@ -18,9 +18,9 @@
import static android.app.backup.BackupManagerMonitor.EXTRA_LOG_EVENT_CATEGORY;
import static android.app.backup.BackupManagerMonitor.EXTRA_LOG_EVENT_ID;
+import static android.app.backup.BackupManagerMonitor.EXTRA_LOG_EVENT_PACKAGE_LONG_VERSION;
import static android.app.backup.BackupManagerMonitor.EXTRA_LOG_EVENT_PACKAGE_NAME;
import static android.app.backup.BackupManagerMonitor.EXTRA_LOG_EVENT_PACKAGE_VERSION;
-import static android.app.backup.BackupManagerMonitor.EXTRA_LOG_EVENT_PACKAGE_LONG_VERSION;
import static com.google.common.truth.Truth.assertThat;
@@ -33,8 +33,9 @@
import android.os.Bundle;
import android.os.RemoteException;
import android.platform.test.annotations.Presubmit;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import org.junit.Before;
import org.junit.Test;
diff --git a/services/tests/servicestests/src/com/android/server/backup/utils/BackupObserverUtilsTest.java b/services/tests/servicestests/src/com/android/server/backup/utils/BackupObserverUtilsTest.java
index ebe6133..cdffd35 100644
--- a/services/tests/servicestests/src/com/android/server/backup/utils/BackupObserverUtilsTest.java
+++ b/services/tests/servicestests/src/com/android/server/backup/utils/BackupObserverUtilsTest.java
@@ -23,8 +23,9 @@
import android.app.backup.IBackupObserver;
import android.os.RemoteException;
import android.platform.test.annotations.Presubmit;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import org.junit.Before;
import org.junit.Test;
diff --git a/services/tests/servicestests/src/com/android/server/backup/utils/DataStreamFileCodecTest.java b/services/tests/servicestests/src/com/android/server/backup/utils/DataStreamFileCodecTest.java
index bfb95c1..efd4603 100644
--- a/services/tests/servicestests/src/com/android/server/backup/utils/DataStreamFileCodecTest.java
+++ b/services/tests/servicestests/src/com/android/server/backup/utils/DataStreamFileCodecTest.java
@@ -19,8 +19,10 @@
import static com.google.common.truth.Truth.assertThat;
import android.platform.test.annotations.Presubmit;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
diff --git a/services/tests/servicestests/src/com/android/server/backup/utils/FullBackupRestoreObserverUtilsTest.java b/services/tests/servicestests/src/com/android/server/backup/utils/FullBackupRestoreObserverUtilsTest.java
index 2f56598..9b861a4 100644
--- a/services/tests/servicestests/src/com/android/server/backup/utils/FullBackupRestoreObserverUtilsTest.java
+++ b/services/tests/servicestests/src/com/android/server/backup/utils/FullBackupRestoreObserverUtilsTest.java
@@ -24,8 +24,9 @@
import android.app.backup.IFullBackupRestoreObserver;
import android.os.RemoteException;
import android.platform.test.annotations.Presubmit;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import org.junit.Before;
import org.junit.Test;
diff --git a/services/tests/servicestests/src/com/android/server/backup/utils/FullBackupUtilsTest.java b/services/tests/servicestests/src/com/android/server/backup/utils/FullBackupUtilsTest.java
index 4e3de64..ae0452a 100644
--- a/services/tests/servicestests/src/com/android/server/backup/utils/FullBackupUtilsTest.java
+++ b/services/tests/servicestests/src/com/android/server/backup/utils/FullBackupUtilsTest.java
@@ -25,8 +25,9 @@
import android.os.ParcelFileDescriptor;
import android.platform.test.annotations.Presubmit;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import org.junit.After;
import org.junit.Before;
@@ -40,7 +41,6 @@
import java.io.EOFException;
import java.io.File;
import java.io.FileOutputStream;
-import java.io.IOException;
import java.io.OutputStream;
import java.util.Random;
diff --git a/services/tests/servicestests/src/com/android/server/backup/utils/SparseArrayUtilsTest.java b/services/tests/servicestests/src/com/android/server/backup/utils/SparseArrayUtilsTest.java
index db55120..679e098 100644
--- a/services/tests/servicestests/src/com/android/server/backup/utils/SparseArrayUtilsTest.java
+++ b/services/tests/servicestests/src/com/android/server/backup/utils/SparseArrayUtilsTest.java
@@ -19,10 +19,11 @@
import static com.google.common.truth.Truth.assertThat;
import android.platform.test.annotations.Presubmit;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
import android.util.SparseArray;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.google.android.collect.Sets;
import org.junit.Test;
diff --git a/services/tests/servicestests/src/com/android/server/backup/utils/TarBackupReaderTest.java b/services/tests/servicestests/src/com/android/server/backup/utils/TarBackupReaderTest.java
index 2830a74..12f2991 100644
--- a/services/tests/servicestests/src/com/android/server/backup/utils/TarBackupReaderTest.java
+++ b/services/tests/servicestests/src/com/android/server/backup/utils/TarBackupReaderTest.java
@@ -29,8 +29,6 @@
import static com.google.common.truth.Truth.assertThat;
import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;
import static org.mockito.Mockito.verifyZeroInteractions;
@@ -47,13 +45,14 @@
import android.os.Bundle;
import android.os.Process;
import android.platform.test.annotations.Presubmit;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.InstrumentationRegistry;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import com.android.frameworks.servicestests.R;
-import com.android.server.backup.FileMetadata;
import com.android.server.backup.BackupManagerService;
+import com.android.server.backup.FileMetadata;
import com.android.server.backup.restore.PerformAdbRestoreTask;
import com.android.server.backup.restore.RestorePolicy;
import com.android.server.backup.testutils.PackageManagerStub;
diff --git a/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyConstantsTest.java b/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyConstantsTest.java
index 175fdd8..be05245 100644
--- a/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyConstantsTest.java
+++ b/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyConstantsTest.java
@@ -28,7 +28,7 @@
-w com.android.frameworks.servicestests
- -w com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
+ -w com.android.frameworks.servicestests/androidx.test.runner.AndroidJUnitRunner
*/
@SmallTest
public class DevicePolicyConstantsTest extends AndroidTestCase {
diff --git a/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerServiceTestable.java b/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerServiceTestable.java
index cd39285..3f47054 100644
--- a/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerServiceTestable.java
+++ b/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerServiceTestable.java
@@ -37,12 +37,13 @@
import android.os.UserManager;
import android.os.UserManagerInternal;
import android.security.KeyChain;
-import android.support.annotation.NonNull;
import android.telephony.TelephonyManager;
import android.util.ArrayMap;
import android.util.Pair;
import android.view.IWindowManager;
+import androidx.annotation.NonNull;
+
import com.android.internal.util.FunctionalUtils.ThrowingRunnable;
import com.android.internal.widget.LockPatternUtils;
import com.android.server.net.NetworkPolicyManagerInternal;
diff --git a/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerTest.java b/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerTest.java
index 26ce7e4..7c2c841 100644
--- a/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerTest.java
+++ b/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerTest.java
@@ -117,7 +117,7 @@
adb install \
-r ${ANDROID_PRODUCT_OUT}/data/app/FrameworksServicesTests/FrameworksServicesTests.apk &&
adb shell am instrument -e class com.android.server.devicepolicy.DevicePolicyManagerTest \
- -w com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
+ -w com.android.frameworks.servicestests/androidx.test.runner.AndroidJUnitRunner
(mmma frameworks/base/services/tests/servicestests/ for non-ninja build)
*
diff --git a/services/tests/servicestests/src/com/android/server/devicepolicy/DpmMockContext.java b/services/tests/servicestests/src/com/android/server/devicepolicy/DpmMockContext.java
index 213961c..be00bb6 100644
--- a/services/tests/servicestests/src/com/android/server/devicepolicy/DpmMockContext.java
+++ b/services/tests/servicestests/src/com/android/server/devicepolicy/DpmMockContext.java
@@ -30,11 +30,12 @@
import android.os.Handler;
import android.os.UserHandle;
import android.os.UserManagerInternal;
-import android.support.annotation.NonNull;
import android.test.mock.MockContext;
import android.util.ArrayMap;
import android.util.ExceptionUtils;
+import androidx.annotation.NonNull;
+
import com.android.internal.util.FunctionalUtils;
import org.junit.Assert;
diff --git a/services/tests/servicestests/src/com/android/server/devicepolicy/OverlayPackagesProviderTest.java b/services/tests/servicestests/src/com/android/server/devicepolicy/OverlayPackagesProviderTest.java
index 939a272..34edd9f 100644
--- a/services/tests/servicestests/src/com/android/server/devicepolicy/OverlayPackagesProviderTest.java
+++ b/services/tests/servicestests/src/com/android/server/devicepolicy/OverlayPackagesProviderTest.java
@@ -33,11 +33,12 @@
import android.content.pm.ServiceInfo;
import android.content.res.Resources;
import android.os.RemoteException;
-import android.support.test.InstrumentationRegistry;
import android.test.AndroidTestCase;
import android.test.mock.MockPackageManager;
import android.view.inputmethod.InputMethodInfo;
+import androidx.test.InstrumentationRegistry;
+
import com.android.internal.R;
import com.android.internal.view.IInputMethodManager;
diff --git a/services/tests/servicestests/src/com/android/server/devicepolicy/OwnersTest.java b/services/tests/servicestests/src/com/android/server/devicepolicy/OwnersTest.java
index cb6a747..5899bb0 100644
--- a/services/tests/servicestests/src/com/android/server/devicepolicy/OwnersTest.java
+++ b/services/tests/servicestests/src/com/android/server/devicepolicy/OwnersTest.java
@@ -16,12 +16,12 @@
package com.android.server.devicepolicy;
-import com.android.server.devicepolicy.DevicePolicyManagerServiceTestable.OwnersTestable;
-
import android.content.ComponentName;
import android.os.UserHandle;
import android.test.suitebuilder.annotation.SmallTest;
+import com.android.server.devicepolicy.DevicePolicyManagerServiceTestable.OwnersTestable;
+
/**
* Tests for the DeviceOwner object that saves & loads device and policy owner information.
* run this test with:
@@ -29,7 +29,7 @@
adb install \
-r out/target/product/hammerhead/data/app/FrameworksServicesTests/FrameworksServicesTests.apk &&
adb shell am instrument -e class com.android.server.devicepolicy.OwnersTest \
- -w com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
+ -w com.android.frameworks.servicestests/androidx.test.runner.AndroidJUnitRunner
(mmma frameworks/base/services/tests/servicestests/ for non-ninja build)
*/
diff --git a/services/tests/servicestests/src/com/android/server/devicepolicy/SystemUpdatePolicyTest.java b/services/tests/servicestests/src/com/android/server/devicepolicy/SystemUpdatePolicyTest.java
index e4e9701..e51859b 100644
--- a/services/tests/servicestests/src/com/android/server/devicepolicy/SystemUpdatePolicyTest.java
+++ b/services/tests/servicestests/src/com/android/server/devicepolicy/SystemUpdatePolicyTest.java
@@ -20,6 +20,7 @@
import static android.app.admin.SystemUpdatePolicy.ValidationFailedException.ERROR_DUPLICATE_OR_OVERLAP;
import static android.app.admin.SystemUpdatePolicy.ValidationFailedException.ERROR_NEW_FREEZE_PERIOD_TOO_CLOSE;
import static android.app.admin.SystemUpdatePolicy.ValidationFailedException.ERROR_NEW_FREEZE_PERIOD_TOO_LONG;
+
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
@@ -27,10 +28,10 @@
import android.app.admin.FreezePeriod;
import android.app.admin.SystemUpdatePolicy;
import android.os.Parcel;
-import android.support.test.runner.AndroidJUnit4;
-import android.util.Pair;
import android.util.Xml;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.internal.util.FastXmlSerializer;
import org.junit.Test;
@@ -50,7 +51,6 @@
import java.util.List;
import java.util.concurrent.TimeUnit;
-
/**
* Unit tests for {@link android.app.admin.SystemUpdatePolicy}.
* Throughout this test, we use "MM-DD" format to denote dates without year.
diff --git a/services/tests/servicestests/src/com/android/server/devicepolicy/TransferOwnershipMetadataManagerTest.java b/services/tests/servicestests/src/com/android/server/devicepolicy/TransferOwnershipMetadataManagerTest.java
index e3e61ac..257acb8 100644
--- a/services/tests/servicestests/src/com/android/server/devicepolicy/TransferOwnershipMetadataManagerTest.java
+++ b/services/tests/servicestests/src/com/android/server/devicepolicy/TransferOwnershipMetadataManagerTest.java
@@ -30,9 +30,10 @@
import static org.junit.Assert.assertTrue;
import android.os.Environment;
-import android.support.test.runner.AndroidJUnit4;
import android.util.Log;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.server.devicepolicy.TransferOwnershipMetadataManager.Injector;
import com.android.server.devicepolicy.TransferOwnershipMetadataManager.Metadata;
diff --git a/services/tests/servicestests/src/com/android/server/display/AmbientBrightnessStatsTrackerTest.java b/services/tests/servicestests/src/com/android/server/display/AmbientBrightnessStatsTrackerTest.java
index 8502e69..e8e6ded 100644
--- a/services/tests/servicestests/src/com/android/server/display/AmbientBrightnessStatsTrackerTest.java
+++ b/services/tests/servicestests/src/com/android/server/display/AmbientBrightnessStatsTrackerTest.java
@@ -25,9 +25,10 @@
import android.hardware.display.AmbientBrightnessDayStats;
import android.os.SystemClock;
import android.os.UserManager;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.InstrumentationRegistry;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import org.junit.Before;
import org.junit.Test;
diff --git a/services/tests/servicestests/src/com/android/server/display/BrightnessMappingStrategyTest.java b/services/tests/servicestests/src/com/android/server/display/BrightnessMappingStrategyTest.java
index 284d443..ccdb76d 100644
--- a/services/tests/servicestests/src/com/android/server/display/BrightnessMappingStrategyTest.java
+++ b/services/tests/servicestests/src/com/android/server/display/BrightnessMappingStrategyTest.java
@@ -30,11 +30,11 @@
import android.content.res.TypedArray;
import android.hardware.display.BrightnessConfiguration;
import android.os.PowerManager;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
import android.util.MathUtils;
import android.util.Spline;
-import android.util.Slog;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
diff --git a/services/tests/servicestests/src/com/android/server/display/BrightnessTrackerTest.java b/services/tests/servicestests/src/com/android/server/display/BrightnessTrackerTest.java
index 75dc96f..ece9f42 100644
--- a/services/tests/servicestests/src/com/android/server/display/BrightnessTrackerTest.java
+++ b/services/tests/servicestests/src/com/android/server/display/BrightnessTrackerTest.java
@@ -46,11 +46,12 @@
import android.os.SystemClock;
import android.os.UserManager;
import android.provider.Settings;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
import android.util.AtomicFile;
+import androidx.test.InstrumentationRegistry;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
diff --git a/services/tests/servicestests/src/com/android/server/display/ColorDisplayServiceTest.java b/services/tests/servicestests/src/com/android/server/display/ColorDisplayServiceTest.java
index 6bd8011..53711a6 100644
--- a/services/tests/servicestests/src/com/android/server/display/ColorDisplayServiceTest.java
+++ b/services/tests/servicestests/src/com/android/server/display/ColorDisplayServiceTest.java
@@ -16,6 +16,10 @@
package com.android.server.display;
+import static com.google.common.truth.Truth.assertWithMessage;
+
+import static org.mockito.Mockito.doReturn;
+
import android.annotation.NonNull;
import android.app.ActivityManager;
import android.app.AlarmManager;
@@ -26,10 +30,11 @@
import android.provider.Settings;
import android.provider.Settings.Secure;
import android.provider.Settings.System;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.runner.AndroidJUnit4;
import android.test.mock.MockContentResolver;
+import androidx.test.InstrumentationRegistry;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.internal.app.ColorDisplayController;
import com.android.internal.util.test.FakeSettingsProvider;
import com.android.server.LocalServices;
@@ -37,24 +42,22 @@
import com.android.server.twilight.TwilightListener;
import com.android.server.twilight.TwilightManager;
import com.android.server.twilight.TwilightState;
-import java.time.LocalDateTime;
-import java.time.ZoneId;
+
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mockito;
+import java.time.LocalDateTime;
+import java.time.LocalTime;
+import java.time.ZoneId;
import java.util.Calendar;
import java.util.HashMap;
-import java.time.LocalTime;
import java.util.Map;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
-import static com.google.common.truth.Truth.assertWithMessage;
-import static org.mockito.Mockito.doReturn;
-
@RunWith(AndroidJUnit4.class)
public class ColorDisplayServiceTest {
diff --git a/services/tests/servicestests/src/com/android/server/display/PersistentDataStoreTest.java b/services/tests/servicestests/src/com/android/server/display/PersistentDataStoreTest.java
index 675000e..196454b 100644
--- a/services/tests/servicestests/src/com/android/server/display/PersistentDataStoreTest.java
+++ b/services/tests/servicestests/src/com/android/server/display/PersistentDataStoreTest.java
@@ -22,23 +22,21 @@
import static org.junit.Assert.assertTrue;
import android.hardware.display.BrightnessConfiguration;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
-import android.util.AtomicFile;
import android.util.Pair;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import java.io.FileInputStream;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.FileNotFoundException;
-import java.io.InputStream;
import java.io.IOException;
+import java.io.InputStream;
import java.io.OutputStream;
-import java.io.PrintWriter;
import java.nio.charset.StandardCharsets;
@SmallTest
diff --git a/services/tests/servicestests/src/com/android/server/job/BackgroundRestrictionsTest.java b/services/tests/servicestests/src/com/android/server/job/BackgroundRestrictionsTest.java
index 14b118e..be8e569 100644
--- a/services/tests/servicestests/src/com/android/server/job/BackgroundRestrictionsTest.java
+++ b/services/tests/servicestests/src/com/android/server/job/BackgroundRestrictionsTest.java
@@ -38,11 +38,12 @@
import android.os.SystemClock;
import android.os.UserHandle;
import android.provider.Settings;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.filters.LargeTest;
-import android.support.test.runner.AndroidJUnit4;
import android.util.Log;
+import androidx.test.InstrumentationRegistry;
+import androidx.test.filters.LargeTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.servicestests.apps.jobtestapp.TestJobActivity;
import org.junit.After;
diff --git a/services/tests/servicestests/src/com/android/server/job/JobSetTest.java b/services/tests/servicestests/src/com/android/server/job/JobSetTest.java
index 83bd9fc..e62e07d 100644
--- a/services/tests/servicestests/src/com/android/server/job/JobSetTest.java
+++ b/services/tests/servicestests/src/com/android/server/job/JobSetTest.java
@@ -29,13 +29,14 @@
import android.content.pm.PackageManagerInternal;
import android.os.Build;
import android.os.UserHandle;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
import android.util.ArraySet;
import android.util.Log;
import android.util.SparseArray;
+import androidx.test.InstrumentationRegistry;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.server.LocalServices;
import com.android.server.job.controllers.JobStatus;
diff --git a/services/tests/servicestests/src/com/android/server/job/JobStoreTest.java b/services/tests/servicestests/src/com/android/server/job/JobStoreTest.java
index 4ee2ff4..543f51cba 100644
--- a/services/tests/servicestests/src/com/android/server/job/JobStoreTest.java
+++ b/services/tests/servicestests/src/com/android/server/job/JobStoreTest.java
@@ -22,12 +22,13 @@
import android.os.Parcelable;
import android.os.PersistableBundle;
import android.os.SystemClock;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.runner.AndroidJUnit4;
import android.test.RenamingDelegatingContext;
import android.util.Log;
import android.util.Pair;
+import androidx.test.InstrumentationRegistry;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.internal.util.HexDump;
import com.android.server.IoThread;
import com.android.server.LocalServices;
diff --git a/services/tests/servicestests/src/com/android/server/job/controllers/JobStatusTest.java b/services/tests/servicestests/src/com/android/server/job/controllers/JobStatusTest.java
index d78af22..1752479 100644
--- a/services/tests/servicestests/src/com/android/server/job/controllers/JobStatusTest.java
+++ b/services/tests/servicestests/src/com/android/server/job/controllers/JobStatusTest.java
@@ -21,7 +21,8 @@
import android.app.job.JobInfo;
import android.content.ComponentName;
import android.os.SystemClock;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.runner.AndroidJUnit4;
import com.android.server.job.JobSchedulerService;
diff --git a/services/tests/servicestests/src/com/android/server/locksettings/LockSettingsShellCommandTest.java b/services/tests/servicestests/src/com/android/server/locksettings/LockSettingsShellCommandTest.java
index 424c08c..9b6975c3 100644
--- a/services/tests/servicestests/src/com/android/server/locksettings/LockSettingsShellCommandTest.java
+++ b/services/tests/servicestests/src/com/android/server/locksettings/LockSettingsShellCommandTest.java
@@ -29,32 +29,30 @@
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
-import static java.io.FileDescriptor.*;
-
import android.app.ActivityManager;
import android.content.Context;
import android.os.Binder;
-import android.os.Debug;
import android.os.Handler;
import android.os.Looper;
import android.os.ResultReceiver;
import android.os.ShellCallback;
import android.platform.test.annotations.Presubmit;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.InstrumentationRegistry;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import com.android.internal.widget.LockPatternUtils;
-import junit.framework.Assert;
-
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
-import java.io.FileDescriptor;
+import static java.io.FileDescriptor.err;
+import static java.io.FileDescriptor.in;
+import static java.io.FileDescriptor.out;
/**
* Test class for {@link LockSettingsShellCommand}.
diff --git a/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/KeySyncTaskTest.java b/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/KeySyncTaskTest.java
index 90947f4..a82c250 100644
--- a/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/KeySyncTaskTest.java
+++ b/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/KeySyncTaskTest.java
@@ -20,6 +20,7 @@
import static android.security.keystore.recovery.KeyChainProtectionParams.UI_FORMAT_PASSWORD;
import static android.security.keystore.recovery.KeyChainProtectionParams.UI_FORMAT_PATTERN;
import static android.security.keystore.recovery.KeyChainProtectionParams.UI_FORMAT_PIN;
+
import static com.android.internal.widget.LockPatternUtils.CREDENTIAL_TYPE_PASSWORD;
import static com.android.internal.widget.LockPatternUtils.CREDENTIAL_TYPE_PATTERN;
@@ -31,7 +32,6 @@
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
-
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.eq;
@@ -50,9 +50,10 @@
import android.security.keystore.recovery.RecoveryController;
import android.security.keystore.recovery.TrustedRootCertificates;
import android.security.keystore.recovery.WrappedApplicationKey;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.InstrumentationRegistry;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import com.android.server.locksettings.recoverablekeystore.storage.RecoverableKeyStoreDb;
import com.android.server.locksettings.recoverablekeystore.storage.RecoverySnapshotStorage;
diff --git a/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/KeySyncUtilsTest.java b/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/KeySyncUtilsTest.java
index fae48c6..f832d3c 100644
--- a/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/KeySyncUtilsTest.java
+++ b/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/KeySyncUtilsTest.java
@@ -22,8 +22,8 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import com.google.common.collect.ImmutableMap;
diff --git a/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/PlatformKeyManagerTest.java b/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/PlatformKeyManagerTest.java
index 0f0e3f3..13436e7 100644
--- a/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/PlatformKeyManagerTest.java
+++ b/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/PlatformKeyManagerTest.java
@@ -32,9 +32,10 @@
import android.content.Context;
import android.security.keystore.KeyProperties;
import android.security.keystore.KeyProtection;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.InstrumentationRegistry;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import com.android.server.locksettings.recoverablekeystore.storage.RecoverableKeyStoreDb;
diff --git a/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/RecoverableKeyGeneratorTest.java b/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/RecoverableKeyGeneratorTest.java
index fd8b319..48afb8b 100644
--- a/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/RecoverableKeyGeneratorTest.java
+++ b/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/RecoverableKeyGeneratorTest.java
@@ -25,9 +25,10 @@
import android.security.keystore.AndroidKeyStoreSecretKey;
import android.security.keystore.KeyGenParameterSpec;
import android.security.keystore.KeyProperties;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.InstrumentationRegistry;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import com.android.server.locksettings.recoverablekeystore.storage.RecoverableKeyStoreDb;
diff --git a/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/RecoverableKeyStoreManagerTest.java b/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/RecoverableKeyStoreManagerTest.java
index 8e86a87..b15863d 100644
--- a/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/RecoverableKeyStoreManagerTest.java
+++ b/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/RecoverableKeyStoreManagerTest.java
@@ -23,6 +23,7 @@
import static android.security.keystore.recovery.RecoveryController.ERROR_INVALID_CERTIFICATE;
import static com.google.common.truth.Truth.assertThat;
+
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
@@ -35,16 +36,14 @@
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
+import android.Manifest;
import android.app.KeyguardManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
-import android.Manifest;
import android.os.Binder;
import android.os.ServiceSpecificException;
import android.os.UserHandle;
-import android.security.KeyStore;
-import android.security.keystore.AndroidKeyStoreProvider;
import android.security.keystore.AndroidKeyStoreSecretKey;
import android.security.keystore.KeyGenParameterSpec;
import android.security.keystore.KeyProperties;
@@ -53,9 +52,10 @@
import android.security.keystore.recovery.RecoveryCertPath;
import android.security.keystore.recovery.TrustedRootCertificates;
import android.security.keystore.recovery.WrappedApplicationKey;
-import android.support.test.filters.SmallTest;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.InstrumentationRegistry;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import com.android.server.locksettings.recoverablekeystore.storage.ApplicationKeyStorage;
import com.android.server.locksettings.recoverablekeystore.storage.RecoverableKeyStoreDb;
@@ -75,19 +75,16 @@
import java.io.File;
import java.nio.charset.StandardCharsets;
-import java.security.UnrecoverableKeyException;
import java.security.cert.CertPath;
import java.security.cert.CertificateFactory;
import java.security.cert.X509Certificate;
import java.util.ArrayList;
-import java.util.concurrent.Executors;
import java.util.Map;
import java.util.Random;
+import java.util.concurrent.Executors;
-import javax.crypto.Cipher;
import javax.crypto.KeyGenerator;
import javax.crypto.SecretKey;
-import javax.crypto.spec.GCMParameterSpec;
import javax.crypto.spec.SecretKeySpec;
@SmallTest
diff --git a/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/RecoverySnapshotListenersStorageTest.java b/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/RecoverySnapshotListenersStorageTest.java
index acc200f..33038aa 100644
--- a/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/RecoverySnapshotListenersStorageTest.java
+++ b/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/RecoverySnapshotListenersStorageTest.java
@@ -8,9 +8,10 @@
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.InstrumentationRegistry;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
diff --git a/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/SecureBoxTest.java b/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/SecureBoxTest.java
index 35ec23b..15b0708 100644
--- a/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/SecureBoxTest.java
+++ b/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/SecureBoxTest.java
@@ -17,11 +17,16 @@
package com.android.server.locksettings.recoverablekeystore;
import static com.google.common.truth.Truth.assertThat;
+
import static org.testng.Assert.assertThrows;
import static org.testng.Assert.expectThrows;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
import java.math.BigInteger;
import java.nio.charset.StandardCharsets;
import java.security.InvalidKeyException;
@@ -31,9 +36,8 @@
import java.security.PrivateKey;
import java.security.PublicKey;
import java.security.spec.ECPrivateKeySpec;
+
import javax.crypto.AEADBadTagException;
-import org.junit.Test;
-import org.junit.runner.RunWith;
@SmallTest
@RunWith(AndroidJUnit4.class)
diff --git a/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/TestOnlyInsecureCertificateHelperTest.java b/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/TestOnlyInsecureCertificateHelperTest.java
index 67436cc..944d6e0 100644
--- a/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/TestOnlyInsecureCertificateHelperTest.java
+++ b/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/TestOnlyInsecureCertificateHelperTest.java
@@ -3,8 +3,9 @@
import static com.google.common.truth.Truth.assertThat;
import android.security.keystore.recovery.TrustedRootCertificates;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import com.android.internal.widget.LockPatternUtils;
@@ -13,6 +14,7 @@
import java.util.HashMap;
import java.util.Map;
+
import javax.crypto.SecretKey;
@SmallTest
diff --git a/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/WrappedKeyTest.java b/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/WrappedKeyTest.java
index 56122a7..b5ee60e 100644
--- a/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/WrappedKeyTest.java
+++ b/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/WrappedKeyTest.java
@@ -24,8 +24,9 @@
import android.security.keystore.AndroidKeyStoreSecretKey;
import android.security.keystore.KeyGenParameterSpec;
import android.security.keystore.KeyProperties;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import org.junit.After;
import org.junit.Test;
diff --git a/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/certificate/CertUtilsTest.java b/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/certificate/CertUtilsTest.java
index 9279698..1cbebff 100644
--- a/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/certificate/CertUtilsTest.java
+++ b/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/certificate/CertUtilsTest.java
@@ -18,13 +18,17 @@
import static com.google.common.truth.Truth.assertThat;
-import static java.nio.charset.StandardCharsets.UTF_8;
-
import static org.testng.Assert.assertThrows;
import static org.testng.Assert.expectThrows;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.w3c.dom.Element;
+
+import static java.nio.charset.StandardCharsets.UTF_8;
import java.io.InputStream;
import java.security.KeyPairGenerator;
@@ -39,10 +43,6 @@
import java.util.Collections;
import java.util.List;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.w3c.dom.Element;
-
@SmallTest
@RunWith(AndroidJUnit4.class)
public final class CertUtilsTest {
diff --git a/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/certificate/CertXmlTest.java b/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/certificate/CertXmlTest.java
index 52269d9..bbcc411 100644
--- a/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/certificate/CertXmlTest.java
+++ b/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/certificate/CertXmlTest.java
@@ -21,17 +21,17 @@
import static org.testng.Assert.assertThrows;
import static org.testng.Assert.expectThrows;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
-
-import java.security.cert.CertPath;
-import java.security.cert.X509Certificate;
-import java.util.List;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
+import java.security.cert.CertPath;
+import java.security.cert.X509Certificate;
+import java.util.List;
+
@SmallTest
@RunWith(AndroidJUnit4.class)
public final class CertXmlTest {
diff --git a/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/certificate/SigXmlTest.java b/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/certificate/SigXmlTest.java
index 4d87006..45adb4b 100644
--- a/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/certificate/SigXmlTest.java
+++ b/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/certificate/SigXmlTest.java
@@ -21,8 +21,8 @@
import static org.testng.Assert.assertThrows;
import static org.testng.Assert.expectThrows;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import org.junit.Before;
import org.junit.Test;
diff --git a/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/certificate/TestData.java b/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/certificate/TestData.java
index 5eb4166..c5792ad 100644
--- a/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/certificate/TestData.java
+++ b/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/certificate/TestData.java
@@ -17,7 +17,8 @@
package com.android.server.locksettings.recoverablekeystore.certificate;
import android.content.Context;
-import android.support.test.InstrumentationRegistry;
+
+import androidx.test.InstrumentationRegistry;
import com.google.common.io.ByteStreams;
diff --git a/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/serialization/KeyChainSnapshotSerializerTest.java b/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/serialization/KeyChainSnapshotSerializerTest.java
index a23ac0f..880255d 100644
--- a/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/serialization/KeyChainSnapshotSerializerTest.java
+++ b/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/serialization/KeyChainSnapshotSerializerTest.java
@@ -22,9 +22,9 @@
import android.security.keystore.recovery.KeyChainSnapshot;
import android.security.keystore.recovery.KeyDerivationParams;
import android.security.keystore.recovery.WrappedApplicationKey;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import com.android.server.locksettings.recoverablekeystore.TestData;
diff --git a/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/storage/RecoverableKeyStoreDbHelperTest.java b/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/storage/RecoverableKeyStoreDbHelperTest.java
index 9b09dd1a..7130b42 100644
--- a/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/storage/RecoverableKeyStoreDbHelperTest.java
+++ b/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/storage/RecoverableKeyStoreDbHelperTest.java
@@ -18,24 +18,25 @@
import static com.google.common.truth.Truth.assertThat;
-import static java.nio.charset.StandardCharsets.UTF_8;
+import android.content.ContentValues;
+import android.content.Context;
+import android.database.sqlite.SQLiteDatabase;
+
+import androidx.test.InstrumentationRegistry;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
+import com.android.server.locksettings.recoverablekeystore.storage.RecoverableKeyStoreDbContract.KeysEntry;
+import com.android.server.locksettings.recoverablekeystore.storage.RecoverableKeyStoreDbContract.RecoveryServiceMetadataEntry;
+import com.android.server.locksettings.recoverablekeystore.storage.RecoverableKeyStoreDbContract.RootOfTrustEntry;
+import com.android.server.locksettings.recoverablekeystore.storage.RecoverableKeyStoreDbContract.UserMetadataEntry;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import android.content.ContentValues;
-import android.content.Context;
-import android.database.sqlite.SQLiteDatabase;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
-
-import com.android.server.locksettings.recoverablekeystore.storage.RecoverableKeyStoreDbContract.KeysEntry;
-import com.android.server.locksettings.recoverablekeystore.storage.RecoverableKeyStoreDbContract.RecoveryServiceMetadataEntry;
-import com.android.server.locksettings.recoverablekeystore.storage.RecoverableKeyStoreDbContract.RootOfTrustEntry;
-import com.android.server.locksettings.recoverablekeystore.storage.RecoverableKeyStoreDbContract.UserMetadataEntry;
+import static java.nio.charset.StandardCharsets.UTF_8;
@SmallTest
@RunWith(AndroidJUnit4.class)
diff --git a/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/storage/RecoverableKeyStoreDbTest.java b/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/storage/RecoverableKeyStoreDbTest.java
index 940745e..6a26f8c 100644
--- a/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/storage/RecoverableKeyStoreDbTest.java
+++ b/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/storage/RecoverableKeyStoreDbTest.java
@@ -17,25 +17,27 @@
package com.android.server.locksettings.recoverablekeystore.storage;
import static com.google.common.truth.Truth.assertThat;
+
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
+import android.content.Context;
+import android.security.keystore.recovery.RecoveryController;
+
+import androidx.test.InstrumentationRegistry;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
+import com.android.server.locksettings.recoverablekeystore.TestData;
+import com.android.server.locksettings.recoverablekeystore.WrappedKey;
+
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import android.content.Context;
-import android.security.keystore.recovery.RecoveryController;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
-
-import com.android.server.locksettings.recoverablekeystore.TestData;
-import com.android.server.locksettings.recoverablekeystore.WrappedKey;
-
import java.io.File;
import java.nio.charset.StandardCharsets;
import java.security.KeyPairGenerator;
diff --git a/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/storage/RecoverySessionStorageTest.java b/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/storage/RecoverySessionStorageTest.java
index bb0474e..c2d1440 100644
--- a/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/storage/RecoverySessionStorageTest.java
+++ b/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/storage/RecoverySessionStorageTest.java
@@ -22,8 +22,8 @@
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
diff --git a/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/storage/RecoverySnapshotStorageTest.java b/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/storage/RecoverySnapshotStorageTest.java
index ad14c3a..e8614af 100644
--- a/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/storage/RecoverySnapshotStorageTest.java
+++ b/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/storage/RecoverySnapshotStorageTest.java
@@ -12,9 +12,10 @@
import android.security.keystore.recovery.KeyChainSnapshot;
import android.security.keystore.recovery.KeyDerivationParams;
import android.security.keystore.recovery.WrappedApplicationKey;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.InstrumentationRegistry;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import com.android.server.locksettings.recoverablekeystore.TestData;
diff --git a/services/tests/servicestests/src/com/android/server/net/ConnOnActivityStartTest.java b/services/tests/servicestests/src/com/android/server/net/ConnOnActivityStartTest.java
index 28b54ef..fe7a376 100644
--- a/services/tests/servicestests/src/com/android/server/net/ConnOnActivityStartTest.java
+++ b/services/tests/servicestests/src/com/android/server/net/ConnOnActivityStartTest.java
@@ -20,10 +20,6 @@
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
-import com.android.frameworks.servicestests.R;
-import com.android.servicestests.aidl.ICmdReceiverService;
-import com.android.servicestests.aidl.INetworkStateObserver;
-
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
@@ -34,13 +30,17 @@
import android.os.IBinder;
import android.os.SystemClock;
import android.provider.Settings;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.filters.LargeTest;
-import android.support.test.runner.AndroidJUnit4;
import android.support.test.uiautomator.UiDevice;
import android.text.TextUtils;
import android.util.Log;
+import androidx.test.InstrumentationRegistry;
+import androidx.test.filters.LargeTest;
+import androidx.test.runner.AndroidJUnit4;
+
+import com.android.servicestests.aidl.ICmdReceiverService;
+import com.android.servicestests.aidl.INetworkStateObserver;
+
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
@@ -64,7 +64,7 @@
* Install: adb install -r \
* ${ANDROID_PRODUCT_OUT}/data/app/FrameworksServicesTests/FrameworksServicesTests.apk
* Run: adb shell am instrument -e class com.android.server.net.ConnOnActivityStartTest -w \
- * com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
+ * com.android.frameworks.servicestests/androidx.test.runner.AndroidJUnitRunner
*/
@LargeTest
@RunWith(AndroidJUnit4.class)
diff --git a/services/tests/servicestests/src/com/android/server/net/IpConfigStoreTest.java b/services/tests/servicestests/src/com/android/server/net/IpConfigStoreTest.java
index 9f4b754..7767a28 100644
--- a/services/tests/servicestests/src/com/android/server/net/IpConfigStoreTest.java
+++ b/services/tests/servicestests/src/com/android/server/net/IpConfigStoreTest.java
@@ -27,9 +27,10 @@
import android.net.NetworkUtils;
import android.net.ProxyInfo;
import android.net.StaticIpConfiguration;
-import android.support.test.runner.AndroidJUnit4;
import android.util.ArrayMap;
+import androidx.test.runner.AndroidJUnit4;
+
import org.junit.Test;
import org.junit.runner.RunWith;
diff --git a/services/tests/servicestests/src/com/android/server/net/watchlist/HarmfulDigestsTests.java b/services/tests/servicestests/src/com/android/server/net/watchlist/HarmfulDigestsTests.java
index a34f95e..be56855 100644
--- a/services/tests/servicestests/src/com/android/server/net/watchlist/HarmfulDigestsTests.java
+++ b/services/tests/servicestests/src/com/android/server/net/watchlist/HarmfulDigestsTests.java
@@ -19,8 +19,8 @@
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import com.android.internal.util.HexDump;
diff --git a/services/tests/servicestests/src/com/android/server/net/watchlist/NetworkWatchlistServiceTests.java b/services/tests/servicestests/src/com/android/server/net/watchlist/NetworkWatchlistServiceTests.java
index a802ff7..9c8a382 100644
--- a/services/tests/servicestests/src/com/android/server/net/watchlist/NetworkWatchlistServiceTests.java
+++ b/services/tests/servicestests/src/com/android/server/net/watchlist/NetworkWatchlistServiceTests.java
@@ -17,7 +17,6 @@
package com.android.server.net.watchlist;
import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
@@ -30,9 +29,10 @@
import android.os.Message;
import android.os.Process;
import android.os.RemoteException;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.filters.MediumTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.InstrumentationRegistry;
+import androidx.test.filters.MediumTest;
+import androidx.test.runner.AndroidJUnit4;
import com.android.server.ServiceThread;
diff --git a/services/tests/servicestests/src/com/android/server/net/watchlist/PrivacyUtilsTests.java b/services/tests/servicestests/src/com/android/server/net/watchlist/PrivacyUtilsTests.java
index 6f2237f..9d2c409 100644
--- a/services/tests/servicestests/src/com/android/server/net/watchlist/PrivacyUtilsTests.java
+++ b/services/tests/servicestests/src/com/android/server/net/watchlist/PrivacyUtilsTests.java
@@ -21,8 +21,9 @@
import static org.junit.Assert.assertTrue;
import android.privacy.DifferentialPrivacyEncoder;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
diff --git a/services/tests/servicestests/src/com/android/server/net/watchlist/ReportEncoderTests.java b/services/tests/servicestests/src/com/android/server/net/watchlist/ReportEncoderTests.java
index cb4f6c5..bf125f8 100644
--- a/services/tests/servicestests/src/com/android/server/net/watchlist/ReportEncoderTests.java
+++ b/services/tests/servicestests/src/com/android/server/net/watchlist/ReportEncoderTests.java
@@ -19,9 +19,13 @@
import static org.junit.Assert.assertEquals;
import android.content.Context;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.InstrumentationRegistry;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
+import com.android.service.nano.NetworkWatchlistAppResultProto;
+import com.android.service.nano.NetworkWatchlistReportProto;
import org.junit.After;
import org.junit.Before;
@@ -35,9 +39,6 @@
import java.io.InputStreamReader;
import java.util.HashMap;
-import com.android.service.nano.NetworkWatchlistReportProto;
-import com.android.service.nano.NetworkWatchlistAppResultProto;
-
/**
* runtest frameworks-services -c com.android.server.net.watchlist.ReportEncoderTests
*/
diff --git a/services/tests/servicestests/src/com/android/server/net/watchlist/WatchlistConfigTests.java b/services/tests/servicestests/src/com/android/server/net/watchlist/WatchlistConfigTests.java
index 678f018..fa61c59 100644
--- a/services/tests/servicestests/src/com/android/server/net/watchlist/WatchlistConfigTests.java
+++ b/services/tests/servicestests/src/com/android/server/net/watchlist/WatchlistConfigTests.java
@@ -18,13 +18,14 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
import android.content.Context;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.InstrumentationRegistry;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import com.android.internal.util.HexDump;
@@ -40,8 +41,6 @@
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
-import java.util.Arrays;
-
/**
* runtest frameworks-services -c com.android.server.net.watchlist.WatchlistConfigTests
diff --git a/services/tests/servicestests/src/com/android/server/net/watchlist/WatchlistLoggingHandlerTests.java b/services/tests/servicestests/src/com/android/server/net/watchlist/WatchlistLoggingHandlerTests.java
index 8399dac..8bbad8d 100644
--- a/services/tests/servicestests/src/com/android/server/net/watchlist/WatchlistLoggingHandlerTests.java
+++ b/services/tests/servicestests/src/com/android/server/net/watchlist/WatchlistLoggingHandlerTests.java
@@ -17,11 +17,12 @@
package com.android.server.net.watchlist;
import static org.junit.Assert.assertEquals;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.doAnswer;
-
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
+import static org.mockito.ArgumentMatchers.anyInt;
+import static org.mockito.ArgumentMatchers.anyString;
+import static org.mockito.Mockito.doAnswer;
+import static org.mockito.Mockito.mock;
import android.content.Context;
import android.content.ContextWrapper;
@@ -32,21 +33,18 @@
import android.os.FileUtils;
import android.os.Looper;
import android.os.UserManager;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
-import android.support.test.InstrumentationRegistry;
+
+import androidx.test.InstrumentationRegistry;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.mockito.invocation.InvocationOnMock;
-import static org.mockito.ArgumentMatchers.anyInt;
-import static org.mockito.ArgumentMatchers.anyString;
-
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
diff --git a/services/tests/servicestests/src/com/android/server/net/watchlist/WatchlistSettingsTests.java b/services/tests/servicestests/src/com/android/server/net/watchlist/WatchlistSettingsTests.java
index 07158af..03b1c41 100644
--- a/services/tests/servicestests/src/com/android/server/net/watchlist/WatchlistSettingsTests.java
+++ b/services/tests/servicestests/src/com/android/server/net/watchlist/WatchlistSettingsTests.java
@@ -20,9 +20,10 @@
import static org.junit.Assert.assertNotEquals;
import android.content.Context;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.InstrumentationRegistry;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import com.android.internal.util.HexDump;
diff --git a/services/tests/servicestests/src/com/android/server/pm/InstallerTest.java b/services/tests/servicestests/src/com/android/server/pm/InstallerTest.java
index b2eb572..6591d6f 100644
--- a/services/tests/servicestests/src/com/android/server/pm/InstallerTest.java
+++ b/services/tests/servicestests/src/com/android/server/pm/InstallerTest.java
@@ -22,10 +22,11 @@
import android.content.pm.PackageStats;
import android.os.SystemClock;
import android.os.UserHandle;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.runner.AndroidJUnit4;
import android.util.Log;
+import androidx.test.InstrumentationRegistry;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.internal.util.ArrayUtils;
import org.junit.After;
diff --git a/services/tests/servicestests/src/com/android/server/pm/PackageManagerServiceTest.java b/services/tests/servicestests/src/com/android/server/pm/PackageManagerServiceTest.java
index cdac516..e379cd0 100644
--- a/services/tests/servicestests/src/com/android/server/pm/PackageManagerServiceTest.java
+++ b/services/tests/servicestests/src/com/android/server/pm/PackageManagerServiceTest.java
@@ -18,7 +18,8 @@
import android.content.IIntentReceiver;
import android.os.Bundle;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.runner.AndroidJUnit4;
import org.junit.After;
import org.junit.Assert;
diff --git a/services/tests/servicestests/src/com/android/server/pm/PackageManagerSettingsTests.java b/services/tests/servicestests/src/com/android/server/pm/PackageManagerSettingsTests.java
index 97ff94f..ee41c0b 100644
--- a/services/tests/servicestests/src/com/android/server/pm/PackageManagerSettingsTests.java
+++ b/services/tests/servicestests/src/com/android/server/pm/PackageManagerSettingsTests.java
@@ -42,14 +42,15 @@
import android.os.PersistableBundle;
import android.os.UserHandle;
import android.os.UserManagerInternal;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
import android.util.ArrayMap;
import android.util.ArraySet;
import android.util.Log;
import android.util.LongSparseArray;
+import androidx.test.InstrumentationRegistry;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.internal.os.AtomicFile;
import com.android.server.LocalServices;
import com.android.server.pm.permission.PermissionManagerInternal;
diff --git a/services/tests/servicestests/src/com/android/server/pm/PackageParserTest.java b/services/tests/servicestests/src/com/android/server/pm/PackageParserTest.java
index 69c0c0f..9736e68 100644
--- a/services/tests/servicestests/src/com/android/server/pm/PackageParserTest.java
+++ b/services/tests/servicestests/src/com/android/server/pm/PackageParserTest.java
@@ -15,6 +15,8 @@
*/
package com.android.server.pm;
+import static org.junit.Assert.*;
+
import android.content.pm.ActivityInfo;
import android.content.pm.ApplicationInfo;
import android.content.pm.ConfigurationInfo;
@@ -29,9 +31,18 @@
import android.os.Bundle;
import android.os.Parcel;
import android.platform.test.annotations.Presubmit;
-import android.support.test.filters.MediumTest;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+import android.util.ArrayMap;
+import android.util.ArraySet;
+
+import androidx.test.filters.MediumTest;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
+import libcore.io.IoUtils;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
import java.io.File;
import java.lang.reflect.Array;
@@ -43,16 +54,6 @@
import java.util.List;
import java.util.Set;
-import static org.junit.Assert.*;
-
-import android.util.ArrayMap;
-import android.util.ArraySet;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import libcore.io.IoUtils;
-
@RunWith(AndroidJUnit4.class)
@MediumTest
public class PackageParserTest {
diff --git a/services/tests/servicestests/src/com/android/server/pm/PackageUserStateTest.java b/services/tests/servicestests/src/com/android/server/pm/PackageUserStateTest.java
index 2a4ea8c..4a33ca3 100644
--- a/services/tests/servicestests/src/com/android/server/pm/PackageUserStateTest.java
+++ b/services/tests/servicestests/src/com/android/server/pm/PackageUserStateTest.java
@@ -24,10 +24,11 @@
import android.content.pm.PackageUserState;
import android.os.PersistableBundle;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
import android.util.ArraySet;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import org.junit.Test;
import org.junit.runner.RunWith;
diff --git a/services/tests/servicestests/src/com/android/server/pm/ParallelPackageParserTest.java b/services/tests/servicestests/src/com/android/server/pm/ParallelPackageParserTest.java
index d665094..41489dc 100644
--- a/services/tests/servicestests/src/com/android/server/pm/ParallelPackageParserTest.java
+++ b/services/tests/servicestests/src/com/android/server/pm/ParallelPackageParserTest.java
@@ -17,9 +17,10 @@
package com.android.server.pm;
import android.content.pm.PackageParser;
-import android.support.test.runner.AndroidJUnit4;
import android.util.Log;
+import androidx.test.runner.AndroidJUnit4;
+
import junit.framework.Assert;
import org.junit.Before;
diff --git a/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java b/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java
index 7815004..c42c596 100644
--- a/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java
+++ b/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java
@@ -117,7 +117,7 @@
adb install \
-r -g ${ANDROID_PRODUCT_OUT}/data/app/FrameworksServicesTests/FrameworksServicesTests.apk &&
adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest1 \
- -w com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
+ -w com.android.frameworks.servicestests/androidx.test.runner.AndroidJUnitRunner
*/
@SmallTest
public class ShortcutManagerTest1 extends BaseShortcutManagerTest {
diff --git a/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest10.java b/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest10.java
index ca1e6af..ae01b40 100644
--- a/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest10.java
+++ b/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest10.java
@@ -37,7 +37,7 @@
adb install \
-r -g ${ANDROID_PRODUCT_OUT}/data/app/FrameworksServicesTests/FrameworksServicesTests.apk &&
adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest10 \
- -w com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
+ -w com.android.frameworks.servicestests/androidx.test.runner.AndroidJUnitRunner
*/
@SmallTest
public class ShortcutManagerTest10 extends BaseShortcutManagerTest {
diff --git a/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest2.java b/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest2.java
index fcdadac..76d52fd 100644
--- a/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest2.java
+++ b/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest2.java
@@ -50,8 +50,6 @@
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
-import java.io.PrintWriter;
-import java.io.StringWriter;
import java.io.Writer;
import java.util.Locale;
@@ -62,7 +60,7 @@
adb install \
-r -g ${ANDROID_PRODUCT_OUT}/data/app/FrameworksServicesTests/FrameworksServicesTests.apk &&
adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest2 \
- -w com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
+ -w com.android.frameworks.servicestests/androidx.test.runner.AndroidJUnitRunner
*/
@SmallTest
public class ShortcutManagerTest2 extends BaseShortcutManagerTest {
diff --git a/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest8.java b/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest8.java
index e9a329c..8a489d2 100644
--- a/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest8.java
+++ b/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest8.java
@@ -56,7 +56,7 @@
adb install \
-r -g ${ANDROID_PRODUCT_OUT}/data/app/FrameworksServicesTests/FrameworksServicesTests.apk &&
adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest8 \
- -w com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
+ -w com.android.frameworks.servicestests/androidx.test.runner.AndroidJUnitRunner
* TODO for CTS
* - Foreground check.
diff --git a/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest9.java b/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest9.java
index 012024f1..edb9df5 100644
--- a/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest9.java
+++ b/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest9.java
@@ -44,7 +44,7 @@
adb install \
-r -g ${ANDROID_PRODUCT_OUT}/data/app/FrameworksServicesTests/FrameworksServicesTests.apk &&
adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest9 \
- -w com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
+ -w com.android.frameworks.servicestests/androidx.test.runner.AndroidJUnitRunner
*/
@SmallTest
public class ShortcutManagerTest9 extends BaseShortcutManagerTest {
diff --git a/services/tests/servicestests/src/com/android/server/pm/SuspendPackagesTest.java b/services/tests/servicestests/src/com/android/server/pm/SuspendPackagesTest.java
index c186e48..f115b9c 100644
--- a/services/tests/servicestests/src/com/android/server/pm/SuspendPackagesTest.java
+++ b/services/tests/servicestests/src/com/android/server/pm/SuspendPackagesTest.java
@@ -41,9 +41,6 @@
import android.os.PersistableBundle;
import android.os.RemoteException;
import android.os.UserHandle;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.filters.LargeTest;
-import android.support.test.runner.AndroidJUnit4;
import android.support.test.uiautomator.By;
import android.support.test.uiautomator.UiDevice;
import android.support.test.uiautomator.UiObject2;
@@ -52,6 +49,10 @@
import android.view.IWindowManager;
import android.view.WindowManagerGlobal;
+import androidx.test.InstrumentationRegistry;
+import androidx.test.filters.LargeTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.servicestests.apps.suspendtestapp.SuspendTestActivity;
import com.android.servicestests.apps.suspendtestapp.SuspendTestReceiver;
diff --git a/services/tests/servicestests/src/com/android/server/pm/UserDataPreparerTest.java b/services/tests/servicestests/src/com/android/server/pm/UserDataPreparerTest.java
index bb35beb..c489cf0 100644
--- a/services/tests/servicestests/src/com/android/server/pm/UserDataPreparerTest.java
+++ b/services/tests/servicestests/src/com/android/server/pm/UserDataPreparerTest.java
@@ -16,15 +16,22 @@
package com.android.server.pm;
+import static org.junit.Assert.assertEquals;
+import static org.mockito.Matchers.eq;
+import static org.mockito.Matchers.isNull;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
import android.content.Context;
import android.content.pm.UserInfo;
import android.os.FileUtils;
import android.os.storage.StorageManager;
import android.os.storage.VolumeInfo;
import android.platform.test.annotations.Presubmit;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.InstrumentationRegistry;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import org.junit.Before;
import org.junit.Test;
@@ -39,19 +46,13 @@
import java.util.Arrays;
import java.util.Collections;
-import static org.junit.Assert.assertEquals;
-import static org.mockito.Matchers.eq;
-import static org.mockito.Matchers.isNull;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-
/**
* <p>Run with:<pre>
* m FrameworksServicesTests &&
* adb install \
* -r out/target/product/hammerhead/data/app/FrameworksServicesTests/FrameworksServicesTests.apk &&
* adb shell am instrument -e class com.android.server.pm.UserDataPreparerTest \
- * -w com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
+ * -w com.android.frameworks.servicestests/androidx.test.runner.AndroidJUnitRunner
* </pre>
*/
@RunWith(AndroidJUnit4.class)
diff --git a/services/tests/servicestests/src/com/android/server/pm/UserLifecycleStressTest.java b/services/tests/servicestests/src/com/android/server/pm/UserLifecycleStressTest.java
index 304e0e9..d6f7e37 100644
--- a/services/tests/servicestests/src/com/android/server/pm/UserLifecycleStressTest.java
+++ b/services/tests/servicestests/src/com/android/server/pm/UserLifecycleStressTest.java
@@ -24,11 +24,12 @@
import android.content.pm.UserInfo;
import android.os.RemoteException;
import android.os.UserManager;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.filters.LargeTest;
-import android.support.test.runner.AndroidJUnit4;
import android.util.Log;
+import androidx.test.InstrumentationRegistry;
+import androidx.test.filters.LargeTest;
+import androidx.test.runner.AndroidJUnit4;
+
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
diff --git a/services/tests/servicestests/src/com/android/server/pm/UserManagerServiceCreateProfileTest.java b/services/tests/servicestests/src/com/android/server/pm/UserManagerServiceCreateProfileTest.java
index c314de4..8dd8967 100644
--- a/services/tests/servicestests/src/com/android/server/pm/UserManagerServiceCreateProfileTest.java
+++ b/services/tests/servicestests/src/com/android/server/pm/UserManagerServiceCreateProfileTest.java
@@ -24,20 +24,21 @@
import android.os.Looper;
import android.os.UserHandle;
import android.os.UserManagerInternal;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.filters.MediumTest;
-import android.support.test.runner.AndroidJUnit4;
import android.util.IconDrawableFactory;
-import com.android.server.LocalServices;
+import androidx.test.InstrumentationRegistry;
+import androidx.test.filters.MediumTest;
+import androidx.test.runner.AndroidJUnit4;
-import java.util.List;
+import com.android.server.LocalServices;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
+import java.util.List;
+
/**
* <p>Run with:<pre>
* runtest -c com.android.server.pm.UserManagerServiceCreateProfileTest frameworks-services
diff --git a/services/tests/servicestests/src/com/android/server/pm/UserManagerServiceIdRecyclingTest.java b/services/tests/servicestests/src/com/android/server/pm/UserManagerServiceIdRecyclingTest.java
index 35967fb..a9ce618 100644
--- a/services/tests/servicestests/src/com/android/server/pm/UserManagerServiceIdRecyclingTest.java
+++ b/services/tests/servicestests/src/com/android/server/pm/UserManagerServiceIdRecyclingTest.java
@@ -16,12 +16,17 @@
package com.android.server.pm;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
import android.content.pm.UserInfo;
import android.os.Looper;
import android.os.UserManagerInternal;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.runner.AndroidJUnit4;
-import android.support.test.filters.MediumTest;
+
+import androidx.test.InstrumentationRegistry;
+import androidx.test.filters.MediumTest;
+import androidx.test.runner.AndroidJUnit4;
import com.android.server.LocalServices;
@@ -31,17 +36,13 @@
import java.util.LinkedHashSet;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
/**
* <p>Run with:<pre>
* m FrameworksServicesTests &&
* adb install \
* -r out/target/product/hammerhead/data/app/FrameworksServicesTests/FrameworksServicesTests.apk &&
* adb shell am instrument -e class com.android.server.pm.UserManagerServiceIdRecyclingTest \
- * -w com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
+ * -w com.android.frameworks.servicestests/androidx.test.runner.AndroidJUnitRunner
* </pre>
*/
@RunWith(AndroidJUnit4.class)
diff --git a/services/tests/servicestests/src/com/android/server/pm/UserManagerServiceUserInfoTest.java b/services/tests/servicestests/src/com/android/server/pm/UserManagerServiceUserInfoTest.java
index 092119e..806c71a 100644
--- a/services/tests/servicestests/src/com/android/server/pm/UserManagerServiceUserInfoTest.java
+++ b/services/tests/servicestests/src/com/android/server/pm/UserManagerServiceUserInfoTest.java
@@ -16,16 +16,21 @@
package com.android.server.pm;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
import android.content.pm.UserInfo;
import android.os.Looper;
import android.os.Parcel;
-import android.os.UserManagerInternal;
import android.os.UserHandle;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.runner.AndroidJUnit4;
-import android.support.test.filters.MediumTest;
+import android.os.UserManagerInternal;
import android.text.TextUtils;
+import androidx.test.InstrumentationRegistry;
+import androidx.test.filters.MediumTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.server.LocalServices;
import com.android.server.pm.UserManagerService.UserData;
@@ -38,10 +43,6 @@
import java.io.DataOutputStream;
import java.util.List;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
/**
* <p>Run with:<pre>
* runtest -c com.android.server.pm.UserManagerServiceUserInfoTest frameworks-services
diff --git a/services/tests/servicestests/src/com/android/server/pm/UserRestrictionsUtilsTest.java b/services/tests/servicestests/src/com/android/server/pm/UserRestrictionsUtilsTest.java
index 882bf32..2cc5323 100644
--- a/services/tests/servicestests/src/com/android/server/pm/UserRestrictionsUtilsTest.java
+++ b/services/tests/servicestests/src/com/android/server/pm/UserRestrictionsUtilsTest.java
@@ -35,7 +35,7 @@
adb install \
-r out/target/product/hammerhead/data/app/FrameworksServicesTests/FrameworksServicesTests.apk &&
adb shell am instrument -e class com.android.server.pm.UserRestrictionsUtilsTest \
- -w com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
+ -w com.android.frameworks.servicestests/androidx.test.runner.AndroidJUnitRunner
* </pre>
*/
@SmallTest
diff --git a/services/tests/servicestests/src/com/android/server/pm/backup/BackupUtilsTest.java b/services/tests/servicestests/src/com/android/server/pm/backup/BackupUtilsTest.java
index caa1d02..13612a1 100644
--- a/services/tests/servicestests/src/com/android/server/pm/backup/BackupUtilsTest.java
+++ b/services/tests/servicestests/src/com/android/server/pm/backup/BackupUtilsTest.java
@@ -17,24 +17,22 @@
import static com.google.common.truth.Truth.assertThat;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManagerInternal;
import android.content.pm.PackageParser;
-import android.content.pm.PackageParser.Package;
import android.content.pm.Signature;
import android.content.pm.SigningInfo;
-import android.test.MoreAsserts;
import android.platform.test.annotations.Presubmit;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+import android.test.MoreAsserts;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import com.android.server.backup.BackupUtils;
diff --git a/services/tests/servicestests/src/com/android/server/pm/dex/DexLoggerTests.java b/services/tests/servicestests/src/com/android/server/pm/dex/DexLoggerTests.java
index bf8d405..792b25a 100644
--- a/services/tests/servicestests/src/com/android/server/pm/dex/DexLoggerTests.java
+++ b/services/tests/servicestests/src/com/android/server/pm/dex/DexLoggerTests.java
@@ -16,13 +16,20 @@
package com.android.server.pm.dex;
+import static com.android.server.pm.dex.PackageDexUsage.DexUseInfo;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.doThrow;
+
import android.content.pm.ApplicationInfo;
import android.content.pm.IPackageManager;
-import android.content.pm.PackageInfo;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
import android.os.storage.StorageManager;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.server.pm.Installer;
import com.android.server.pm.Installer.InstallerException;
@@ -40,14 +47,6 @@
import java.util.Arrays;
-import static com.google.common.truth.Truth.assertThat;
-
-import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.doThrow;
-
-import static com.android.server.pm.dex.PackageDexUsage.PackageUseInfo;
-import static com.android.server.pm.dex.PackageDexUsage.DexUseInfo;
-
@RunWith(AndroidJUnit4.class)
@SmallTest
public class DexLoggerTests {
diff --git a/services/tests/servicestests/src/com/android/server/pm/dex/DexManagerTests.java b/services/tests/servicestests/src/com/android/server/pm/dex/DexManagerTests.java
index b30c043..2a3ccbd 100644
--- a/services/tests/servicestests/src/com/android/server/pm/dex/DexManagerTests.java
+++ b/services/tests/servicestests/src/com/android/server/pm/dex/DexManagerTests.java
@@ -16,13 +16,28 @@
package com.android.server.pm.dex;
+import static com.android.server.pm.dex.PackageDexUsage.DexUseInfo;
+import static com.android.server.pm.dex.PackageDexUsage.PackageUseInfo;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyInt;
+import static org.mockito.ArgumentMatchers.anyString;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
import android.content.pm.ApplicationInfo;
import android.content.pm.IPackageManager;
import android.content.pm.PackageInfo;
import android.os.Build;
import android.os.UserHandle;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import com.android.server.pm.Installer;
@@ -30,14 +45,6 @@
import dalvik.system.PathClassLoader;
import dalvik.system.VMRuntime;
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
@@ -47,21 +54,13 @@
import org.mockito.junit.MockitoRule;
import org.mockito.quality.Strictness;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.ArgumentMatchers.anyInt;
-import static org.mockito.ArgumentMatchers.anyString;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-
-import static com.android.server.pm.dex.PackageDexUsage.PackageUseInfo;
-import static com.android.server.pm.dex.PackageDexUsage.DexUseInfo;
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
@RunWith(AndroidJUnit4.class)
@SmallTest
diff --git a/services/tests/servicestests/src/com/android/server/pm/dex/DexoptOptionsTests.java b/services/tests/servicestests/src/com/android/server/pm/dex/DexoptOptionsTests.java
index 93064bc..62589eb 100644
--- a/services/tests/servicestests/src/com/android/server/pm/dex/DexoptOptionsTests.java
+++ b/services/tests/servicestests/src/com/android/server/pm/dex/DexoptOptionsTests.java
@@ -19,19 +19,19 @@
import static com.android.server.pm.PackageManagerServiceCompilerMapping.getCompilerFilterForReason;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.server.pm.PackageManagerService;
import com.android.server.pm.PackageManagerServiceCompilerMapping;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
@RunWith(AndroidJUnit4.class)
@SmallTest
public class DexoptOptionsTests {
diff --git a/services/tests/servicestests/src/com/android/server/pm/dex/DexoptUtilsTest.java b/services/tests/servicestests/src/com/android/server/pm/dex/DexoptUtilsTest.java
index aa51ecd..3a55c22 100644
--- a/services/tests/servicestests/src/com/android/server/pm/dex/DexoptUtilsTest.java
+++ b/services/tests/servicestests/src/com/android/server/pm/dex/DexoptUtilsTest.java
@@ -23,11 +23,12 @@
import static org.junit.Assert.fail;
import android.content.pm.ApplicationInfo;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
import android.content.pm.SharedLibraryInfo;
import android.util.SparseArray;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import dalvik.system.DelegateLastClassLoader;
import dalvik.system.DexClassLoader;
import dalvik.system.PathClassLoader;
@@ -36,8 +37,8 @@
import org.junit.runner.RunWith;
import java.io.File;
-import java.util.Arrays;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collections;
import java.util.List;
@@ -332,6 +333,20 @@
}
@Test
+ public void testSharedLibraryContext() {
+ SharedLibraryInfo sharedLibrary =
+ createMockSharedLibrary(new String[] {"a.dex", "b.dex"}).get(0);
+ String context = DexoptUtils.getClassLoaderContext(sharedLibrary);
+ assertEquals("PCL[]", context);
+
+ SharedLibraryInfo otherSharedLibrary =
+ createMockSharedLibrary(new String[] {"c.dex"}).get(0);
+ otherSharedLibrary.addDependency(sharedLibrary);
+ context = DexoptUtils.getClassLoaderContext(otherSharedLibrary);
+ assertEquals("PCL[]{PCL[a.dex:b.dex]}", context);
+ }
+
+ @Test
public void testProcessContextForDexLoad() {
List<String> classLoaders = Arrays.asList(
DELEGATE_LAST_CLASS_LOADER_NAME,
diff --git a/services/tests/servicestests/src/com/android/server/pm/dex/PackageDexUsageTests.java b/services/tests/servicestests/src/com/android/server/pm/dex/PackageDexUsageTests.java
index 0de0503..3107813 100644
--- a/services/tests/servicestests/src/com/android/server/pm/dex/PackageDexUsageTests.java
+++ b/services/tests/servicestests/src/com/android/server/pm/dex/PackageDexUsageTests.java
@@ -16,12 +16,23 @@
package com.android.server.pm.dex;
+import static com.android.server.pm.dex.PackageDexUsage.DexUseInfo;
+import static com.android.server.pm.dex.PackageDexUsage.PackageUseInfo;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
import android.os.Build;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import dalvik.system.VMRuntime;
-import java.util.Collections;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -35,16 +46,6 @@
import java.util.Map;
import java.util.Set;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import static com.android.server.pm.dex.PackageDexUsage.PackageUseInfo;
-import static com.android.server.pm.dex.PackageDexUsage.DexUseInfo;
-
@RunWith(AndroidJUnit4.class)
@SmallTest
public class PackageDexUsageTests {
diff --git a/services/tests/servicestests/src/com/android/server/policy/PhoneWindowManagerInsetsTest.java b/services/tests/servicestests/src/com/android/server/policy/PhoneWindowManagerInsetsTest.java
index 7e18ce7..cce6ba7 100644
--- a/services/tests/servicestests/src/com/android/server/policy/PhoneWindowManagerInsetsTest.java
+++ b/services/tests/servicestests/src/com/android/server/policy/PhoneWindowManagerInsetsTest.java
@@ -22,16 +22,15 @@
import static android.view.Surface.ROTATION_90;
import static org.hamcrest.Matchers.equalTo;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertThat;
import android.graphics.Rect;
import android.platform.test.annotations.Presubmit;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
import android.view.Display;
import android.view.DisplayInfo;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
diff --git a/services/tests/servicestests/src/com/android/server/policy/PhoneWindowManagerLayoutTest.java b/services/tests/servicestests/src/com/android/server/policy/PhoneWindowManagerLayoutTest.java
index 97a716f..64ec9ad 100644
--- a/services/tests/servicestests/src/com/android/server/policy/PhoneWindowManagerLayoutTest.java
+++ b/services/tests/servicestests/src/com/android/server/policy/PhoneWindowManagerLayoutTest.java
@@ -22,7 +22,6 @@
import static android.view.View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN;
import static android.view.ViewGroup.LayoutParams.MATCH_PARENT;
import static android.view.WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS;
-import static android.view.WindowManager.LayoutParams.FLAG_FULLSCREEN;
import static android.view.WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR;
import static android.view.WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN;
import static android.view.WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS;
@@ -40,11 +39,12 @@
import android.graphics.PixelFormat;
import android.graphics.Rect;
import android.platform.test.annotations.Presubmit;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
import android.view.DisplayCutout;
import android.view.WindowManager;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
diff --git a/services/tests/servicestests/src/com/android/server/policy/PhoneWindowManagerTest.java b/services/tests/servicestests/src/com/android/server/policy/PhoneWindowManagerTest.java
index 30665b5..d92d7e0 100644
--- a/services/tests/servicestests/src/com/android/server/policy/PhoneWindowManagerTest.java
+++ b/services/tests/servicestests/src/com/android/server/policy/PhoneWindowManagerTest.java
@@ -19,6 +19,10 @@
import static android.view.View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR;
import static android.view.ViewGroup.LayoutParams.MATCH_PARENT;
import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT;
+import static android.view.WindowManager.DOCKED_BOTTOM;
+import static android.view.WindowManager.DOCKED_LEFT;
+import static android.view.WindowManager.DOCKED_RIGHT;
+import static android.view.WindowManager.DOCKED_TOP;
import static android.view.WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM;
import static android.view.WindowManager.LayoutParams.FLAG_DIM_BEHIND;
import static android.view.WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS;
@@ -28,13 +32,9 @@
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION;
import static android.view.WindowManager.LayoutParams.TYPE_BASE_APPLICATION;
import static android.view.WindowManager.LayoutParams.TYPE_INPUT_METHOD;
-import static android.view.WindowManager.DOCKED_BOTTOM;
-import static android.view.WindowManager.DOCKED_LEFT;
-import static android.view.WindowManager.DOCKED_RIGHT;
-import static android.view.WindowManager.DOCKED_TOP;
-import static com.android.server.policy.WindowManagerPolicy.NAV_BAR_LEFT;
import static com.android.server.policy.WindowManagerPolicy.NAV_BAR_BOTTOM;
+import static com.android.server.policy.WindowManagerPolicy.NAV_BAR_LEFT;
import static com.android.server.policy.WindowManagerPolicy.NAV_BAR_RIGHT;
import static org.junit.Assert.assertEquals;
@@ -44,10 +44,11 @@
import android.graphics.PixelFormat;
import android.platform.test.annotations.Presubmit;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
import android.view.WindowManager;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import org.junit.Test;
import org.junit.runner.RunWith;
diff --git a/services/tests/servicestests/src/com/android/server/policy/PhoneWindowManagerTestBase.java b/services/tests/servicestests/src/com/android/server/policy/PhoneWindowManagerTestBase.java
index 1d37802..140e4ba 100644
--- a/services/tests/servicestests/src/com/android/server/policy/PhoneWindowManagerTestBase.java
+++ b/services/tests/servicestests/src/com/android/server/policy/PhoneWindowManagerTestBase.java
@@ -34,13 +34,11 @@
import android.content.pm.PackageManager;
import android.content.res.Resources;
import android.graphics.Matrix;
-import android.graphics.Path;
import android.graphics.PixelFormat;
import android.graphics.Rect;
import android.graphics.RectF;
import android.os.IBinder;
import android.os.UserHandle;
-import android.support.test.InstrumentationRegistry;
import android.testing.TestableResources;
import android.util.Pair;
import android.view.Display;
@@ -53,6 +51,8 @@
import android.view.accessibility.AccessibilityManager;
import android.view.accessibility.IAccessibilityManager;
+import androidx.test.InstrumentationRegistry;
+
import com.android.server.policy.keyguard.KeyguardServiceDelegate;
import com.android.server.wm.DisplayFrames;
import com.android.server.wm.utils.WmDisplayCutout;
diff --git a/services/tests/servicestests/src/com/android/server/power/batterysaver/BatterySaverStateMachineTest.java b/services/tests/servicestests/src/com/android/server/power/batterysaver/BatterySaverStateMachineTest.java
index 5b24725..e8394fe 100644
--- a/services/tests/servicestests/src/com/android/server/power/batterysaver/BatterySaverStateMachineTest.java
+++ b/services/tests/servicestests/src/com/android/server/power/batterysaver/BatterySaverStateMachineTest.java
@@ -24,10 +24,11 @@
import android.content.ContentResolver;
import android.provider.Settings.Global;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
import android.test.mock.MockContext;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.google.common.base.Objects;
import org.junit.Before;
diff --git a/services/tests/servicestests/src/com/android/server/power/batterysaver/BatterySavingStatsTest.java b/services/tests/servicestests/src/com/android/server/power/batterysaver/BatterySavingStatsTest.java
index 9bd4cc3..ba61fd2 100644
--- a/services/tests/servicestests/src/com/android/server/power/batterysaver/BatterySavingStatsTest.java
+++ b/services/tests/servicestests/src/com/android/server/power/batterysaver/BatterySavingStatsTest.java
@@ -25,8 +25,9 @@
import static org.mockito.Mockito.verify;
import android.metrics.LogMaker;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import com.android.internal.logging.MetricsLogger;
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
diff --git a/services/tests/servicestests/src/com/android/server/power/batterysaver/CpuFrequenciesTest.java b/services/tests/servicestests/src/com/android/server/power/batterysaver/CpuFrequenciesTest.java
index f72ec34..8371e9c 100644
--- a/services/tests/servicestests/src/com/android/server/power/batterysaver/CpuFrequenciesTest.java
+++ b/services/tests/servicestests/src/com/android/server/power/batterysaver/CpuFrequenciesTest.java
@@ -17,10 +17,11 @@
import static org.junit.Assert.assertEquals;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
import android.util.ArrayMap;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import org.junit.Test;
import org.junit.runner.RunWith;
diff --git a/services/tests/servicestests/src/com/android/server/power/batterysaver/FileUpdaterTest.java b/services/tests/servicestests/src/com/android/server/power/batterysaver/FileUpdaterTest.java
index 7324fe6..89c7dd4 100644
--- a/services/tests/servicestests/src/com/android/server/power/batterysaver/FileUpdaterTest.java
+++ b/services/tests/servicestests/src/com/android/server/power/batterysaver/FileUpdaterTest.java
@@ -27,14 +27,14 @@
import static org.mockito.Mockito.verify;
import android.content.Context;
-import android.hardware.camera2.impl.GetCommand;
import android.os.Handler;
import android.os.Looper;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
import android.util.ArrayMap;
+import androidx.test.InstrumentationRegistry;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -48,7 +48,6 @@
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
-
/**
atest $ANDROID_BUILD_TOP/frameworks/base/services/tests/servicestests/src/com/android/server/power/batterysaver/FileUpdaterTest.java
*/
diff --git a/services/tests/servicestests/src/com/android/server/timedetector/SimpleTimeZoneDetectorStrategyTest.java b/services/tests/servicestests/src/com/android/server/timedetector/SimpleTimeZoneDetectorStrategyTest.java
index 62f1433..9e00077 100644
--- a/services/tests/servicestests/src/com/android/server/timedetector/SimpleTimeZoneDetectorStrategyTest.java
+++ b/services/tests/servicestests/src/com/android/server/timedetector/SimpleTimeZoneDetectorStrategyTest.java
@@ -28,9 +28,10 @@
import android.icu.util.Calendar;
import android.icu.util.GregorianCalendar;
import android.icu.util.TimeZone;
-import android.support.test.runner.AndroidJUnit4;
import android.util.TimestampedValue;
+import androidx.test.runner.AndroidJUnit4;
+
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
diff --git a/services/tests/servicestests/src/com/android/server/timedetector/TimeDetectorServiceTest.java b/services/tests/servicestests/src/com/android/server/timedetector/TimeDetectorServiceTest.java
index ed74cd7..45fef76 100644
--- a/services/tests/servicestests/src/com/android/server/timedetector/TimeDetectorServiceTest.java
+++ b/services/tests/servicestests/src/com/android/server/timedetector/TimeDetectorServiceTest.java
@@ -31,15 +31,16 @@
import android.app.timedetector.TimeSignal;
import android.content.Context;
import android.content.pm.PackageManager;
-import android.support.test.runner.AndroidJUnit4;
import android.util.TimestampedValue;
+import androidx.test.runner.AndroidJUnit4;
+
+import com.android.server.timedetector.TimeDetectorStrategy.Callback;
+
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import com.android.server.timedetector.TimeDetectorStrategy.Callback;
-
import java.io.PrintWriter;
@RunWith(AndroidJUnit4.class)
diff --git a/services/tests/servicestests/src/com/android/server/timedetector/TimeDetectorStrategyTest.java b/services/tests/servicestests/src/com/android/server/timedetector/TimeDetectorStrategyTest.java
index 301ded4..239d413 100644
--- a/services/tests/servicestests/src/com/android/server/timedetector/TimeDetectorStrategyTest.java
+++ b/services/tests/servicestests/src/com/android/server/timedetector/TimeDetectorStrategyTest.java
@@ -18,9 +18,10 @@
import static org.junit.Assert.assertEquals;
-import android.support.test.runner.AndroidJUnit4;
import android.util.TimestampedValue;
+import androidx.test.runner.AndroidJUnit4;
+
import org.junit.Test;
import org.junit.runner.RunWith;
diff --git a/services/tests/servicestests/src/com/android/server/timezone/CheckTokenTest.java b/services/tests/servicestests/src/com/android/server/timezone/CheckTokenTest.java
index 9603a06..f7d282b 100644
--- a/services/tests/servicestests/src/com/android/server/timezone/CheckTokenTest.java
+++ b/services/tests/servicestests/src/com/android/server/timezone/CheckTokenTest.java
@@ -16,16 +16,16 @@
package com.android.server.timezone;
-import org.junit.Test;
-
-import android.support.test.filters.SmallTest;
-
-import java.io.IOException;
-
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.fail;
+import androidx.test.filters.SmallTest;
+
+import org.junit.Test;
+
+import java.io.IOException;
+
@SmallTest
public class CheckTokenTest {
diff --git a/services/tests/servicestests/src/com/android/server/timezone/PackageStatusStorageTest.java b/services/tests/servicestests/src/com/android/server/timezone/PackageStatusStorageTest.java
index 74013b7..090db11 100644
--- a/services/tests/servicestests/src/com/android/server/timezone/PackageStatusStorageTest.java
+++ b/services/tests/servicestests/src/com/android/server/timezone/PackageStatusStorageTest.java
@@ -16,26 +16,28 @@
package com.android.server.timezone;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import android.content.Context;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.filters.SmallTest;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-
import static junit.framework.Assert.assertTrue;
+
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.fail;
+import android.content.Context;
+
+import androidx.test.InstrumentationRegistry;
+import androidx.test.filters.SmallTest;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+
@SmallTest
public class PackageStatusStorageTest {
private static final PackageVersions VALID_PACKAGE_VERSIONS = new PackageVersions(1, 2);
diff --git a/services/tests/servicestests/src/com/android/server/timezone/PackageStatusTest.java b/services/tests/servicestests/src/com/android/server/timezone/PackageStatusTest.java
index c0ae81e..9b45f05 100644
--- a/services/tests/servicestests/src/com/android/server/timezone/PackageStatusTest.java
+++ b/services/tests/servicestests/src/com/android/server/timezone/PackageStatusTest.java
@@ -16,13 +16,13 @@
package com.android.server.timezone;
-import org.junit.Test;
-
-import android.support.test.filters.SmallTest;
-
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
+import androidx.test.filters.SmallTest;
+
+import org.junit.Test;
+
@SmallTest
public class PackageStatusTest {
diff --git a/services/tests/servicestests/src/com/android/server/timezone/PackageTrackerTest.java b/services/tests/servicestests/src/com/android/server/timezone/PackageTrackerTest.java
index d9f4adf..1356ea2 100644
--- a/services/tests/servicestests/src/com/android/server/timezone/PackageTrackerTest.java
+++ b/services/tests/servicestests/src/com/android/server/timezone/PackageTrackerTest.java
@@ -16,27 +16,6 @@
package com.android.server.timezone;
-import org.hamcrest.BaseMatcher;
-import org.hamcrest.Description;
-import org.hamcrest.Matcher;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import android.app.timezone.RulesUpdaterContract;
-import android.content.Context;
-import android.content.Intent;
-import android.provider.TimeZoneRulesDataContract;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.filters.SmallTest;
-
-import java.io.File;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.time.Clock;
-import java.time.Instant;
-import java.time.ZoneId;
-
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
@@ -48,6 +27,28 @@
import static org.mockito.Mockito.when;
import static org.mockito.hamcrest.MockitoHamcrest.argThat;
+import android.app.timezone.RulesUpdaterContract;
+import android.content.Context;
+import android.content.Intent;
+import android.provider.TimeZoneRulesDataContract;
+
+import androidx.test.InstrumentationRegistry;
+import androidx.test.filters.SmallTest;
+
+import org.hamcrest.BaseMatcher;
+import org.hamcrest.Description;
+import org.hamcrest.Matcher;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.io.File;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.time.Clock;
+import java.time.Instant;
+import java.time.ZoneId;
+
/**
* White box interaction / unit testing of the {@link PackageTracker}.
*/
diff --git a/services/tests/servicestests/src/com/android/server/timezone/PackageVersionsTest.java b/services/tests/servicestests/src/com/android/server/timezone/PackageVersionsTest.java
index a470f8f..9ffc4e9 100644
--- a/services/tests/servicestests/src/com/android/server/timezone/PackageVersionsTest.java
+++ b/services/tests/servicestests/src/com/android/server/timezone/PackageVersionsTest.java
@@ -16,13 +16,13 @@
package com.android.server.timezone;
-import org.junit.Test;
-
-import android.support.test.filters.SmallTest;
-
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
+import androidx.test.filters.SmallTest;
+
+import org.junit.Test;
+
@SmallTest
public class PackageVersionsTest {
diff --git a/services/tests/servicestests/src/com/android/server/usage/AppStandbyControllerTests.java b/services/tests/servicestests/src/com/android/server/usage/AppStandbyControllerTests.java
index 39fc715..b3683de 100644
--- a/services/tests/servicestests/src/com/android/server/usage/AppStandbyControllerTests.java
+++ b/services/tests/servicestests/src/com/android/server/usage/AppStandbyControllerTests.java
@@ -37,11 +37,9 @@
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertTrue;
-
import static org.junit.Assert.fail;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Matchers.anyInt;
-import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
@@ -58,12 +56,13 @@
import android.os.Looper;
import android.os.RemoteException;
import android.platform.test.annotations.Presubmit;
-import android.support.test.filters.SmallTest;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.runner.AndroidJUnit4;
import android.util.ArraySet;
import android.view.Display;
+import androidx.test.InstrumentationRegistry;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.server.SystemService;
import org.junit.Before;
diff --git a/services/tests/servicestests/src/com/android/server/usage/AppTimeLimitControllerTests.java b/services/tests/servicestests/src/com/android/server/usage/AppTimeLimitControllerTests.java
index 84475bb..047addd 100644
--- a/services/tests/servicestests/src/com/android/server/usage/AppTimeLimitControllerTests.java
+++ b/services/tests/servicestests/src/com/android/server/usage/AppTimeLimitControllerTests.java
@@ -19,13 +19,13 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
import android.app.PendingIntent;
import android.os.HandlerThread;
import android.os.Looper;
-import android.support.test.filters.MediumTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.filters.MediumTest;
+import androidx.test.runner.AndroidJUnit4;
import org.junit.After;
import org.junit.Before;
diff --git a/services/tests/servicestests/src/com/android/server/utils/PriorityDumpTest.java b/services/tests/servicestests/src/com/android/server/utils/PriorityDumpTest.java
index da45d81..4eb2474 100644
--- a/services/tests/servicestests/src/com/android/server/utils/PriorityDumpTest.java
+++ b/services/tests/servicestests/src/com/android/server/utils/PriorityDumpTest.java
@@ -18,14 +18,16 @@
import static com.android.server.utils.PriorityDump.dump;
-import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertSame;
import static org.mockito.Matchers.eq;
import static org.mockito.Matchers.same;
import static org.mockito.Mockito.verify;
import android.platform.test.annotations.Presubmit;
-import android.support.test.filters.SmallTest;
+
+import androidx.test.filters.SmallTest;
+
import com.android.server.utils.PriorityDump.PriorityDumper;
import org.junit.Before;
diff --git a/services/tests/servicestests/src/com/android/server/wallpaper/WallpaperServiceTests.java b/services/tests/servicestests/src/com/android/server/wallpaper/WallpaperServiceTests.java
index 9c010a0..2dd8817 100644
--- a/services/tests/servicestests/src/com/android/server/wallpaper/WallpaperServiceTests.java
+++ b/services/tests/servicestests/src/com/android/server/wallpaper/WallpaperServiceTests.java
@@ -24,9 +24,10 @@
import android.os.Message;
import android.os.SystemClock;
import android.service.wallpaper.WallpaperService;
-import android.support.test.annotation.UiThreadTest;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.annotation.UiThreadTest;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
diff --git a/services/tests/servicestests/src/com/android/server/webkit/WebViewUpdateServiceTest.java b/services/tests/servicestests/src/com/android/server/webkit/WebViewUpdateServiceTest.java
index dca09af..02c6ae0 100644
--- a/services/tests/servicestests/src/com/android/server/webkit/WebViewUpdateServiceTest.java
+++ b/services/tests/servicestests/src/com/android/server/webkit/WebViewUpdateServiceTest.java
@@ -19,15 +19,12 @@
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.Signature;
import android.os.Build;
import android.os.Bundle;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.runner.AndroidJUnit4;
import android.test.suitebuilder.annotation.MediumTest;
import android.util.Base64;
import android.webkit.UserPackage;
@@ -35,17 +32,17 @@
import android.webkit.WebViewProviderInfo;
import android.webkit.WebViewProviderResponse;
+import androidx.test.InstrumentationRegistry;
+import androidx.test.runner.AndroidJUnit4;
+
import org.junit.Test;
import org.junit.runner.RunWith;
-
import org.mockito.ArgumentMatcher;
-import org.mockito.Mockito;
import org.mockito.Matchers;
+import org.mockito.Mockito;
-import java.lang.Integer;
import java.util.concurrent.CountDownLatch;
-
/**
* Tests for WebViewUpdateService
runtest --path frameworks/base/services/tests/servicestests/ \
diff --git a/services/tests/servicestests/src/com/android/server/wm/AnimatingAppWindowTokenRegistryTest.java b/services/tests/servicestests/src/com/android/server/wm/AnimatingAppWindowTokenRegistryTest.java
index 164c80b..b5fe8b1 100644
--- a/services/tests/servicestests/src/com/android/server/wm/AnimatingAppWindowTokenRegistryTest.java
+++ b/services/tests/servicestests/src/com/android/server/wm/AnimatingAppWindowTokenRegistryTest.java
@@ -18,27 +18,22 @@
import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
-import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;
-import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_PORTRAIT;
+
import static junit.framework.Assert.assertFalse;
import static junit.framework.Assert.assertTrue;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-import static org.mockito.ArgumentMatchers.any;
+
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyZeroInteractions;
import android.platform.test.annotations.Presubmit;
-import android.support.test.filters.FlakyTest;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
-import com.android.server.wm.SurfaceAnimator.OnAnimationFinishedCallback;
+import androidx.test.filters.FlakyTest;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.ArgumentCaptor;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
diff --git a/services/tests/servicestests/src/com/android/server/wm/AppTransitionTests.java b/services/tests/servicestests/src/com/android/server/wm/AppTransitionTests.java
index be7d781..3053c41 100644
--- a/services/tests/servicestests/src/com/android/server/wm/AppTransitionTests.java
+++ b/services/tests/servicestests/src/com/android/server/wm/AppTransitionTests.java
@@ -20,13 +20,15 @@
import static android.view.WindowManager.TRANSIT_CRASHING_ACTIVITY_CLOSE;
import static android.view.WindowManager.TRANSIT_KEYGUARD_GOING_AWAY;
import static android.view.WindowManager.TRANSIT_KEYGUARD_UNOCCLUDE;
+
import static org.junit.Assert.assertEquals;
import android.content.Context;
import android.platform.test.annotations.Presubmit;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.InstrumentationRegistry;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import org.junit.Before;
import org.junit.Rule;
diff --git a/services/tests/servicestests/src/com/android/server/wm/AppWindowContainerControllerTests.java b/services/tests/servicestests/src/com/android/server/wm/AppWindowContainerControllerTests.java
index e0645b1..fcd8a39e4 100644
--- a/services/tests/servicestests/src/com/android/server/wm/AppWindowContainerControllerTests.java
+++ b/services/tests/servicestests/src/com/android/server/wm/AppWindowContainerControllerTests.java
@@ -16,26 +16,28 @@
package com.android.server.wm;
-import android.support.test.filters.FlakyTest;
-import org.junit.Test;
-
-import android.platform.test.annotations.Presubmit;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
-
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
import static android.content.res.Configuration.EMPTY;
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_STARTING;
+
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.fail;
+import android.platform.test.annotations.Presubmit;
+
+import androidx.test.InstrumentationRegistry;
+import androidx.test.filters.FlakyTest;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.server.wm.WindowTestUtils.TestTaskWindowContainerController;
+import org.junit.Test;
+
/**
* Test class for {@link AppWindowContainerController}.
*
diff --git a/services/tests/servicestests/src/com/android/server/wm/AppWindowTokenTests.java b/services/tests/servicestests/src/com/android/server/wm/AppWindowTokenTests.java
index f6599dc..9dd1006 100644
--- a/services/tests/servicestests/src/com/android/server/wm/AppWindowTokenTests.java
+++ b/services/tests/servicestests/src/com/android/server/wm/AppWindowTokenTests.java
@@ -16,16 +16,6 @@
package com.android.server.wm;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import android.platform.test.annotations.Presubmit;
-import android.support.test.filters.FlakyTest;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
-import android.view.Surface;
-import android.view.WindowManager;
-
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_BEHIND;
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE;
@@ -38,10 +28,23 @@
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_STARTING;
import static android.view.WindowManager.LayoutParams.TYPE_BASE_APPLICATION;
import static android.view.WindowManager.TRANSIT_UNSET;
+
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
+
+import android.platform.test.annotations.Presubmit;
+import android.view.Surface;
+import android.view.WindowManager;
+
+import androidx.test.filters.FlakyTest;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
/**
* Tests for the {@link AppWindowToken} class.
*
diff --git a/services/tests/servicestests/src/com/android/server/wm/BoundsAnimationControllerTests.java b/services/tests/servicestests/src/com/android/server/wm/BoundsAnimationControllerTests.java
index ff631e7..e6d81a7 100644
--- a/services/tests/servicestests/src/com/android/server/wm/BoundsAnimationControllerTests.java
+++ b/services/tests/servicestests/src/com/android/server/wm/BoundsAnimationControllerTests.java
@@ -21,34 +21,30 @@
import static com.android.server.wm.BoundsAnimationController.SCHEDULE_PIP_MODE_CHANGED_ON_START;
import static com.android.server.wm.BoundsAnimationController.SchedulePipModeChangedState;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotEquals;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertTrue;
+
import android.animation.ValueAnimator;
import android.content.Context;
import android.graphics.Rect;
import android.os.Handler;
import android.os.Looper;
import android.platform.test.annotations.Presubmit;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.annotation.UiThreadTest;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+import androidx.test.InstrumentationRegistry;
+import androidx.test.annotation.UiThreadTest;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
+import com.android.server.wm.BoundsAnimationController.BoundsAnimator;
import com.android.server.wm.WindowManagerInternal.AppTransitionListener;
import org.junit.Test;
import org.junit.runner.RunWith;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNotSame;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import com.android.server.wm.BoundsAnimationController.BoundsAnimator;
-
/**
* Test class for {@link BoundsAnimationController} to ensure that it sends the right callbacks
* depending on the various interactions.
diff --git a/services/tests/servicestests/src/com/android/server/wm/ConfigurationContainerTests.java b/services/tests/servicestests/src/com/android/server/wm/ConfigurationContainerTests.java
index 192e156..74370bb 100644
--- a/services/tests/servicestests/src/com/android/server/wm/ConfigurationContainerTests.java
+++ b/services/tests/servicestests/src/com/android/server/wm/ConfigurationContainerTests.java
@@ -17,7 +17,6 @@
package com.android.server.wm;
import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME;
-import static android.app.WindowConfiguration.ACTIVITY_TYPE_RECENTS;
import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
import static android.app.WindowConfiguration.ACTIVITY_TYPE_UNDEFINED;
import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM;
@@ -28,13 +27,16 @@
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE;
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT;
import static android.content.res.Configuration.EMPTY;
+
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import android.content.res.Configuration;
import android.platform.test.annotations.Presubmit;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import org.junit.Test;
import org.junit.runner.RunWith;
diff --git a/services/tests/servicestests/src/com/android/server/wm/DimmerTests.java b/services/tests/servicestests/src/com/android/server/wm/DimmerTests.java
index 6769e40..21555e3 100644
--- a/services/tests/servicestests/src/com/android/server/wm/DimmerTests.java
+++ b/services/tests/servicestests/src/com/android/server/wm/DimmerTests.java
@@ -29,10 +29,11 @@
import android.graphics.Rect;
import android.platform.test.annotations.Presubmit;
-import android.support.test.runner.AndroidJUnit4;
import android.view.SurfaceControl;
import android.view.SurfaceSession;
+import androidx.test.runner.AndroidJUnit4;
+
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
diff --git a/services/tests/servicestests/src/com/android/server/wm/DisplayContentTests.java b/services/tests/servicestests/src/com/android/server/wm/DisplayContentTests.java
index ac196f9..bfac230 100644
--- a/services/tests/servicestests/src/com/android/server/wm/DisplayContentTests.java
+++ b/services/tests/servicestests/src/com/android/server/wm/DisplayContentTests.java
@@ -28,6 +28,7 @@
import static android.view.WindowManager.LayoutParams.TYPE_BASE_APPLICATION;
import static android.view.WindowManager.LayoutParams.TYPE_STATUS_BAR;
import static android.view.WindowManager.LayoutParams.TYPE_VOICE_INTERACTION;
+
import static com.android.server.wm.WindowContainer.POSITION_TOP;
import static org.hamcrest.Matchers.is;
@@ -38,25 +39,26 @@
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
import android.annotation.SuppressLint;
import android.content.res.Configuration;
import android.graphics.Rect;
import android.os.SystemClock;
import android.platform.test.annotations.Presubmit;
-import android.support.test.filters.FlakyTest;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
import android.util.DisplayMetrics;
import android.util.SparseIntArray;
import android.view.DisplayCutout;
import android.view.MotionEvent;
import android.view.Surface;
+import androidx.test.filters.FlakyTest;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.server.wm.utils.WmDisplayCutout;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
diff --git a/services/tests/servicestests/src/com/android/server/wm/DragDropControllerTests.java b/services/tests/servicestests/src/com/android/server/wm/DragDropControllerTests.java
index a09656c..f383fda 100644
--- a/services/tests/servicestests/src/com/android/server/wm/DragDropControllerTests.java
+++ b/services/tests/servicestests/src/com/android/server/wm/DragDropControllerTests.java
@@ -19,6 +19,7 @@
import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
import static android.view.WindowManager.LayoutParams.TYPE_BASE_APPLICATION;
+
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.any;
@@ -33,21 +34,25 @@
import android.os.UserHandle;
import android.os.UserManagerInternal;
import android.platform.test.annotations.Presubmit;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
import android.view.InputChannel;
import android.view.SurfaceControl;
import android.view.SurfaceSession;
import android.view.View;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.internal.annotations.GuardedBy;
import com.android.server.LocalServices;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
+
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+
/**
* Tests for the {@link DragDropController} class.
*
diff --git a/services/tests/servicestests/src/com/android/server/wm/PinnedStackControllerTest.java b/services/tests/servicestests/src/com/android/server/wm/PinnedStackControllerTest.java
index 96745fa..7222a99 100644
--- a/services/tests/servicestests/src/com/android/server/wm/PinnedStackControllerTest.java
+++ b/services/tests/servicestests/src/com/android/server/wm/PinnedStackControllerTest.java
@@ -2,18 +2,6 @@
import static android.view.Display.DEFAULT_DISPLAY;
-import android.os.RemoteException;
-import android.platform.test.annotations.Presubmit;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
-import android.view.IPinnedStackListener;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyBoolean;
import static org.mockito.ArgumentMatchers.anyInt;
@@ -23,6 +11,19 @@
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
+import android.os.RemoteException;
+import android.platform.test.annotations.Presubmit;
+import android.view.IPinnedStackListener;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+
@SmallTest
@Presubmit
@RunWith(AndroidJUnit4.class)
diff --git a/services/tests/servicestests/src/com/android/server/wm/RecentsAnimationControllerTest.java b/services/tests/servicestests/src/com/android/server/wm/RecentsAnimationControllerTest.java
index a2af9b8..e7c45d5 100644
--- a/services/tests/servicestests/src/com/android/server/wm/RecentsAnimationControllerTest.java
+++ b/services/tests/servicestests/src/com/android/server/wm/RecentsAnimationControllerTest.java
@@ -19,8 +19,10 @@
import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
import static android.view.Display.DEFAULT_DISPLAY;
+
import static com.android.server.wm.RecentsAnimationController.REORDER_KEEP_IN_PLACE;
import static com.android.server.wm.RecentsAnimationController.REORDER_MOVE_TO_ORIGINAL_POSITION;
+
import static org.junit.Assert.fail;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.atLeast;
@@ -31,11 +33,14 @@
import android.os.Binder;
import android.os.IInterface;
import android.platform.test.annotations.Presubmit;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
import android.view.IRecentsAnimationRunner;
import android.view.SurfaceControl;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.server.wm.SurfaceAnimator.OnAnimationFinishedCallback;
+
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
diff --git a/services/tests/servicestests/src/com/android/server/wm/RemoteAnimationControllerTest.java b/services/tests/servicestests/src/com/android/server/wm/RemoteAnimationControllerTest.java
index 95361f0..7d19baa 100644
--- a/services/tests/servicestests/src/com/android/server/wm/RemoteAnimationControllerTest.java
+++ b/services/tests/servicestests/src/com/android/server/wm/RemoteAnimationControllerTest.java
@@ -31,9 +31,6 @@
import android.os.Binder;
import android.os.IInterface;
import android.platform.test.annotations.Presubmit;
-import android.support.test.filters.FlakyTest;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
import android.view.IRemoteAnimationFinishedCallback;
import android.view.IRemoteAnimationRunner;
import android.view.RemoteAnimationAdapter;
@@ -41,6 +38,9 @@
import android.view.SurfaceControl;
import android.view.SurfaceControl.Transaction;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.server.testutils.OffsettableClock;
import com.android.server.testutils.TestHandler;
import com.android.server.wm.SurfaceAnimator.OnAnimationFinishedCallback;
diff --git a/services/tests/servicestests/src/com/android/server/wm/RootWindowContainerTests.java b/services/tests/servicestests/src/com/android/server/wm/RootWindowContainerTests.java
index 204e26c..c1db6a6 100644
--- a/services/tests/servicestests/src/com/android/server/wm/RootWindowContainerTests.java
+++ b/services/tests/servicestests/src/com/android/server/wm/RootWindowContainerTests.java
@@ -1,16 +1,16 @@
package com.android.server.wm;
-import org.junit.Test;
-import org.junit.runner.RunWith;
+import static org.junit.Assert.assertTrue;
import android.content.res.Configuration;
import android.graphics.Rect;
-
import android.platform.test.annotations.Presubmit;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
-import static org.junit.Assert.assertTrue;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
/**
* Tests for the {@link RootWindowContainer} class.
diff --git a/services/tests/servicestests/src/com/android/server/wm/ScreenDecorWindowTests.java b/services/tests/servicestests/src/com/android/server/wm/ScreenDecorWindowTests.java
index a2ccee4..897a48d 100644
--- a/services/tests/servicestests/src/com/android/server/wm/ScreenDecorWindowTests.java
+++ b/services/tests/servicestests/src/com/android/server/wm/ScreenDecorWindowTests.java
@@ -32,6 +32,7 @@
import static android.view.WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH;
import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_IS_SCREEN_DECOR;
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY;
+
import static org.junit.Assert.assertEquals;
import android.app.Activity;
@@ -46,9 +47,6 @@
import android.media.ImageReader;
import android.os.Handler;
import android.platform.test.annotations.Presubmit;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
import android.util.Pair;
import android.view.Display;
import android.view.DisplayInfo;
@@ -57,6 +55,10 @@
import android.view.WindowManager;
import android.widget.TextView;
+import androidx.test.InstrumentationRegistry;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
diff --git a/services/tests/servicestests/src/com/android/server/wm/StackWindowControllerTests.java b/services/tests/servicestests/src/com/android/server/wm/StackWindowControllerTests.java
index ab0a2bd..9f2645c 100644
--- a/services/tests/servicestests/src/com/android/server/wm/StackWindowControllerTests.java
+++ b/services/tests/servicestests/src/com/android/server/wm/StackWindowControllerTests.java
@@ -16,20 +16,20 @@
package com.android.server.wm;
-import android.graphics.Rect;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import android.platform.test.annotations.Presubmit;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
-
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
+import android.graphics.Rect;
+import android.platform.test.annotations.Presubmit;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
/**
* Test class for {@link StackWindowController}.
*
diff --git a/services/tests/servicestests/src/com/android/server/wm/SurfaceAnimationRunnerTest.java b/services/tests/servicestests/src/com/android/server/wm/SurfaceAnimationRunnerTest.java
index 79e9bb4..4551c36 100644
--- a/services/tests/servicestests/src/com/android/server/wm/SurfaceAnimationRunnerTest.java
+++ b/services/tests/servicestests/src/com/android/server/wm/SurfaceAnimationRunnerTest.java
@@ -16,7 +16,6 @@
package com.android.server.wm;
-import static java.util.concurrent.TimeUnit.SECONDS;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
@@ -34,9 +33,6 @@
import android.graphics.Point;
import android.os.PowerManagerInternal;
import android.platform.test.annotations.Presubmit;
-import android.support.test.filters.FlakyTest;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
import android.view.Choreographer;
import android.view.Choreographer.FrameCallback;
import android.view.SurfaceControl;
@@ -44,6 +40,10 @@
import android.view.animation.Animation;
import android.view.animation.TranslateAnimation;
+import androidx.test.filters.FlakyTest;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.server.wm.LocalAnimationAdapter.AnimationSpec;
import org.junit.Before;
@@ -54,6 +54,8 @@
import org.mockito.junit.MockitoJUnit;
import org.mockito.junit.MockitoRule;
+import static java.util.concurrent.TimeUnit.SECONDS;
+
import java.util.concurrent.CountDownLatch;
/**
diff --git a/services/tests/servicestests/src/com/android/server/wm/SurfaceAnimatorTest.java b/services/tests/servicestests/src/com/android/server/wm/SurfaceAnimatorTest.java
index 16b8458..7b5e8de 100644
--- a/services/tests/servicestests/src/com/android/server/wm/SurfaceAnimatorTest.java
+++ b/services/tests/servicestests/src/com/android/server/wm/SurfaceAnimatorTest.java
@@ -28,14 +28,15 @@
import static org.mockito.Mockito.verifyZeroInteractions;
import android.platform.test.annotations.Presubmit;
-import android.support.test.filters.FlakyTest;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
import android.view.SurfaceControl;
import android.view.SurfaceControl.Builder;
import android.view.SurfaceControl.Transaction;
import android.view.SurfaceSession;
+import androidx.test.filters.FlakyTest;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.server.wm.SurfaceAnimator.Animatable;
import com.android.server.wm.SurfaceAnimator.OnAnimationFinishedCallback;
@@ -46,8 +47,6 @@
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
-import java.util.ArrayList;
-
/**
* Test class for {@link SurfaceAnimatorTest}.
*
diff --git a/services/tests/servicestests/src/com/android/server/wm/TaskPositionerTests.java b/services/tests/servicestests/src/com/android/server/wm/TaskPositionerTests.java
index 7bf7dd7..39bcdaf 100644
--- a/services/tests/servicestests/src/com/android/server/wm/TaskPositionerTests.java
+++ b/services/tests/servicestests/src/com/android/server/wm/TaskPositionerTests.java
@@ -16,26 +16,28 @@
package com.android.server.wm;
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import android.graphics.Rect;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
-import android.util.DisplayMetrics;
-import android.util.Log;
-import android.view.Display;
-
import static com.android.server.wm.TaskPositioner.MIN_ASPECT;
import static com.android.server.wm.WindowManagerService.dipToPixel;
import static com.android.server.wm.WindowState.MINIMUM_VISIBLE_HEIGHT_IN_DP;
import static com.android.server.wm.WindowState.MINIMUM_VISIBLE_WIDTH_IN_DP;
+
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
+import android.graphics.Rect;
+import android.util.DisplayMetrics;
+import android.util.Log;
+import android.view.Display;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
/**
* Tests for the {@link TaskPositioner} class.
*
diff --git a/services/tests/servicestests/src/com/android/server/wm/TaskPositioningControllerTests.java b/services/tests/servicestests/src/com/android/server/wm/TaskPositioningControllerTests.java
index f3ed8b0..9af124a 100644
--- a/services/tests/servicestests/src/com/android/server/wm/TaskPositioningControllerTests.java
+++ b/services/tests/servicestests/src/com/android/server/wm/TaskPositioningControllerTests.java
@@ -17,6 +17,7 @@
package com.android.server.wm;
import static android.view.WindowManager.LayoutParams.TYPE_BASE_APPLICATION;
+
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
@@ -27,10 +28,12 @@
import static org.mockito.Mockito.when;
import android.platform.test.annotations.Presubmit;
-import android.support.test.filters.FlakyTest;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
import android.view.InputChannel;
+
+import androidx.test.filters.FlakyTest;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
diff --git a/services/tests/servicestests/src/com/android/server/wm/TaskSnapshotCacheTest.java b/services/tests/servicestests/src/com/android/server/wm/TaskSnapshotCacheTest.java
index 649de4a..c9d8004 100644
--- a/services/tests/servicestests/src/com/android/server/wm/TaskSnapshotCacheTest.java
+++ b/services/tests/servicestests/src/com/android/server/wm/TaskSnapshotCacheTest.java
@@ -17,12 +17,14 @@
package com.android.server.wm;
import static android.view.WindowManager.LayoutParams.FIRST_APPLICATION_WINDOW;
+
import static junit.framework.Assert.assertNotNull;
import static junit.framework.Assert.assertNull;
import android.platform.test.annotations.Presubmit;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import org.junit.Before;
import org.junit.Test;
diff --git a/services/tests/servicestests/src/com/android/server/wm/TaskSnapshotControllerTest.java b/services/tests/servicestests/src/com/android/server/wm/TaskSnapshotControllerTest.java
index 5650050..efce063 100644
--- a/services/tests/servicestests/src/com/android/server/wm/TaskSnapshotControllerTest.java
+++ b/services/tests/servicestests/src/com/android/server/wm/TaskSnapshotControllerTest.java
@@ -19,17 +19,19 @@
import static android.view.WindowManager.LayoutParams.FIRST_APPLICATION_WINDOW;
import static android.view.WindowManager.LayoutParams.FLAG_SECURE;
import static android.view.WindowManager.TRANSIT_UNSET;
+
import static com.android.server.wm.TaskSnapshotController.*;
+
import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertTrue;
import android.platform.test.annotations.Presubmit;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
import android.util.ArraySet;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.google.android.collect.Sets;
+
import org.junit.Test;
import org.junit.runner.RunWith;
diff --git a/services/tests/servicestests/src/com/android/server/wm/TaskSnapshotPersisterLoaderTest.java b/services/tests/servicestests/src/com/android/server/wm/TaskSnapshotPersisterLoaderTest.java
index 325d42a..600b2e5 100644
--- a/services/tests/servicestests/src/com/android/server/wm/TaskSnapshotPersisterLoaderTest.java
+++ b/services/tests/servicestests/src/com/android/server/wm/TaskSnapshotPersisterLoaderTest.java
@@ -18,23 +18,24 @@
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED;
+
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
import android.app.ActivityManager.TaskSnapshot;
import android.content.res.Configuration;
import android.graphics.Rect;
import android.os.SystemClock;
import android.platform.test.annotations.Presubmit;
-import android.support.test.filters.MediumTest;
-import android.support.test.runner.AndroidJUnit4;
import android.util.ArraySet;
-
import android.view.View;
+
+import androidx.test.filters.MediumTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.server.wm.TaskSnapshotPersister.RemoveObsoleteFilesQueueItem;
import org.junit.Test;
diff --git a/services/tests/servicestests/src/com/android/server/wm/TaskSnapshotPersisterTestBase.java b/services/tests/servicestests/src/com/android/server/wm/TaskSnapshotPersisterTestBase.java
index 8b86043..6f4f173 100644
--- a/services/tests/servicestests/src/com/android/server/wm/TaskSnapshotPersisterTestBase.java
+++ b/services/tests/servicestests/src/com/android/server/wm/TaskSnapshotPersisterTestBase.java
@@ -28,7 +28,8 @@
import android.graphics.PixelFormat;
import android.graphics.Rect;
import android.os.UserManager;
-import android.support.test.InstrumentationRegistry;
+
+import androidx.test.InstrumentationRegistry;
import org.junit.After;
import org.junit.Before;
diff --git a/services/tests/servicestests/src/com/android/server/wm/TaskSnapshotSurfaceTest.java b/services/tests/servicestests/src/com/android/server/wm/TaskSnapshotSurfaceTest.java
index b19373e..6c08f42 100644
--- a/services/tests/servicestests/src/com/android/server/wm/TaskSnapshotSurfaceTest.java
+++ b/services/tests/servicestests/src/com/android/server/wm/TaskSnapshotSurfaceTest.java
@@ -19,6 +19,7 @@
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
import static android.content.res.Configuration.ORIENTATION_PORTRAIT;
import static android.view.WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS;
+
import static org.junit.Assert.assertEquals;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyInt;
@@ -35,10 +36,11 @@
import android.graphics.PixelFormat;
import android.graphics.Rect;
import android.platform.test.annotations.Presubmit;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
import android.view.Surface;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.server.wm.TaskSnapshotSurface.Window;
import org.junit.Test;
diff --git a/services/tests/servicestests/src/com/android/server/wm/TaskStackContainersTests.java b/services/tests/servicestests/src/com/android/server/wm/TaskStackContainersTests.java
index ca1994f..9fa5ba4 100644
--- a/services/tests/servicestests/src/com/android/server/wm/TaskStackContainersTests.java
+++ b/services/tests/servicestests/src/com/android/server/wm/TaskStackContainersTests.java
@@ -18,20 +18,20 @@
import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED;
+
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
+import android.platform.test.annotations.Presubmit;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
+import org.junit.After;
+import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.junit.Before;
-import org.junit.After;
-
-import android.platform.test.annotations.Presubmit;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
/**
* Tests for the {@link DisplayContent.TaskStackContainers} container in {@link DisplayContent}.
diff --git a/services/tests/servicestests/src/com/android/server/wm/TaskStackTests.java b/services/tests/servicestests/src/com/android/server/wm/TaskStackTests.java
index eaf71f0..53a1185 100644
--- a/services/tests/servicestests/src/com/android/server/wm/TaskStackTests.java
+++ b/services/tests/servicestests/src/com/android/server/wm/TaskStackTests.java
@@ -16,21 +16,19 @@
package com.android.server.wm;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import android.platform.test.annotations.Presubmit;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
-
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_PORTRAIT;
import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+
+import android.platform.test.annotations.Presubmit;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
/**
* Tests for the {@link TaskStack} class.
diff --git a/services/tests/servicestests/src/com/android/server/wm/TaskWindowContainerControllerTests.java b/services/tests/servicestests/src/com/android/server/wm/TaskWindowContainerControllerTests.java
index 1dd9365..edd7664 100644
--- a/services/tests/servicestests/src/com/android/server/wm/TaskWindowContainerControllerTests.java
+++ b/services/tests/servicestests/src/com/android/server/wm/TaskWindowContainerControllerTests.java
@@ -16,17 +16,19 @@
package com.android.server.wm;
-import android.platform.test.annotations.Presubmit;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
+import android.platform.test.annotations.Presubmit;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
/**
* Test class for {@link TaskWindowContainerController}.
*
diff --git a/services/tests/servicestests/src/com/android/server/wm/UnknownAppVisibilityControllerTest.java b/services/tests/servicestests/src/com/android/server/wm/UnknownAppVisibilityControllerTest.java
index a5c47de..3ac97027 100644
--- a/services/tests/servicestests/src/com/android/server/wm/UnknownAppVisibilityControllerTest.java
+++ b/services/tests/servicestests/src/com/android/server/wm/UnknownAppVisibilityControllerTest.java
@@ -19,8 +19,9 @@
import static junit.framework.Assert.assertTrue;
import android.platform.test.annotations.Presubmit;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import org.junit.Before;
import org.junit.Test;
diff --git a/services/tests/servicestests/src/com/android/server/wm/WallpaperControllerTests.java b/services/tests/servicestests/src/com/android/server/wm/WallpaperControllerTests.java
index 71ead20..882e789 100644
--- a/services/tests/servicestests/src/com/android/server/wm/WallpaperControllerTests.java
+++ b/services/tests/servicestests/src/com/android/server/wm/WallpaperControllerTests.java
@@ -11,8 +11,9 @@
import android.graphics.Bitmap;
import android.os.IBinder;
import android.platform.test.annotations.Presubmit;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
diff --git a/services/tests/servicestests/src/com/android/server/wm/WindowAnimationSpecTest.java b/services/tests/servicestests/src/com/android/server/wm/WindowAnimationSpecTest.java
index ca520ed..d4c68a8 100644
--- a/services/tests/servicestests/src/com/android/server/wm/WindowAnimationSpecTest.java
+++ b/services/tests/servicestests/src/com/android/server/wm/WindowAnimationSpecTest.java
@@ -28,12 +28,13 @@
import android.graphics.Point;
import android.graphics.Rect;
import android.platform.test.annotations.Presubmit;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
import android.view.SurfaceControl;
import android.view.animation.Animation;
import android.view.animation.ClipRectAnimation;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import org.junit.Test;
import org.junit.runner.RunWith;
diff --git a/services/tests/servicestests/src/com/android/server/wm/WindowConfigurationTests.java b/services/tests/servicestests/src/com/android/server/wm/WindowConfigurationTests.java
index 513c1ec..ec5424a 100644
--- a/services/tests/servicestests/src/com/android/server/wm/WindowConfigurationTests.java
+++ b/services/tests/servicestests/src/com/android/server/wm/WindowConfigurationTests.java
@@ -16,17 +16,6 @@
package com.android.server.wm;
-import org.junit.Test;
-
-import android.app.WindowConfiguration;
-import android.content.res.Configuration;
-import android.graphics.Rect;
-import android.platform.test.annotations.Presubmit;
-import android.support.test.filters.FlakyTest;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
-import android.view.DisplayInfo;
-
import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME;
import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM;
@@ -34,9 +23,21 @@
import static android.app.WindowConfiguration.WINDOW_CONFIG_APP_BOUNDS;
import static android.app.WindowConfiguration.WINDOW_CONFIG_WINDOWING_MODE;
import static android.content.pm.ActivityInfo.CONFIG_WINDOW_CONFIGURATION;
+
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertTrue;
+
+import android.app.WindowConfiguration;
+import android.content.res.Configuration;
+import android.graphics.Rect;
+import android.platform.test.annotations.Presubmit;
+import android.view.DisplayInfo;
+
+import androidx.test.filters.FlakyTest;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
+import org.junit.Test;
/**
* Test class to for {@link android.app.WindowConfiguration}.
diff --git a/services/tests/servicestests/src/com/android/server/wm/WindowContainerControllerTests.java b/services/tests/servicestests/src/com/android/server/wm/WindowContainerControllerTests.java
index 502cb6e..6b1feb8 100644
--- a/services/tests/servicestests/src/com/android/server/wm/WindowContainerControllerTests.java
+++ b/services/tests/servicestests/src/com/android/server/wm/WindowContainerControllerTests.java
@@ -16,21 +16,22 @@
package com.android.server.wm;
-import android.app.WindowConfiguration;
-import android.content.res.Configuration;
-import android.support.test.filters.FlakyTest;
-import org.junit.Test;
-
-import android.platform.test.annotations.Presubmit;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
-
import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM;
import static android.content.res.Configuration.EMPTY;
+
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
+import android.content.res.Configuration;
+import android.platform.test.annotations.Presubmit;
+
+import androidx.test.filters.FlakyTest;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
+import org.junit.Test;
+
/**
* Test class for {@link WindowContainerController}.
*
diff --git a/services/tests/servicestests/src/com/android/server/wm/WindowContainerTests.java b/services/tests/servicestests/src/com/android/server/wm/WindowContainerTests.java
index 6c7830e..ea8c918 100644
--- a/services/tests/servicestests/src/com/android/server/wm/WindowContainerTests.java
+++ b/services/tests/servicestests/src/com/android/server/wm/WindowContainerTests.java
@@ -16,20 +16,6 @@
package com.android.server.wm;
-import android.support.test.filters.FlakyTest;
-import android.view.SurfaceControl;
-import android.view.SurfaceSession;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import android.content.res.Configuration;
-import android.graphics.Rect;
-import android.platform.test.annotations.Presubmit;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
-
-import java.util.Comparator;
-
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_BEHIND;
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_PORTRAIT;
@@ -44,7 +30,6 @@
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
-
import static org.mockito.Mockito.any;
import static org.mockito.Mockito.anyFloat;
import static org.mockito.Mockito.eq;
@@ -53,6 +38,21 @@
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
+import android.content.res.Configuration;
+import android.graphics.Rect;
+import android.platform.test.annotations.Presubmit;
+import android.view.SurfaceControl;
+import android.view.SurfaceSession;
+
+import androidx.test.filters.FlakyTest;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import java.util.Comparator;
+
/**
* Test class for {@link WindowContainer}.
*
diff --git a/services/tests/servicestests/src/com/android/server/wm/WindowContainerTraversalTests.java b/services/tests/servicestests/src/com/android/server/wm/WindowContainerTraversalTests.java
index e076399..ffc8622 100644
--- a/services/tests/servicestests/src/com/android/server/wm/WindowContainerTraversalTests.java
+++ b/services/tests/servicestests/src/com/android/server/wm/WindowContainerTraversalTests.java
@@ -20,19 +20,19 @@
import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_PRIMARY;
import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_SECONDARY;
import static android.view.WindowManager.LayoutParams.TYPE_BASE_APPLICATION;
+
+import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
-import static org.mockito.Matchers.eq;
import android.platform.test.annotations.Presubmit;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Mock;
-
import java.util.function.Consumer;
/**
diff --git a/services/tests/servicestests/src/com/android/server/wm/WindowFrameTests.java b/services/tests/servicestests/src/com/android/server/wm/WindowFrameTests.java
index 5a56332..7b02c6b 100644
--- a/services/tests/servicestests/src/com/android/server/wm/WindowFrameTests.java
+++ b/services/tests/servicestests/src/com/android/server/wm/WindowFrameTests.java
@@ -16,29 +16,31 @@
package com.android.server.wm;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
+import static android.view.DisplayCutout.fromBoundingRect;
+import static android.view.WindowManager.LayoutParams.FILL_PARENT;
+import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
import android.app.ActivityManager.TaskDescription;
import android.content.res.Configuration;
import android.graphics.Rect;
import android.platform.test.annotations.Presubmit;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
import android.view.DisplayInfo;
import android.view.Gravity;
import android.view.IWindow;
import android.view.WindowManager;
-import static android.view.DisplayCutout.fromBoundingRect;
-import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION;
-import static android.view.WindowManager.LayoutParams.FILL_PARENT;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import com.android.server.wm.utils.WmDisplayCutout;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
/**
* Tests for the {@link WindowState#computeFrameLw} method and other window frame machinery.
*
diff --git a/services/tests/servicestests/src/com/android/server/wm/WindowManagerServiceRule.java b/services/tests/servicestests/src/com/android/server/wm/WindowManagerServiceRule.java
index d91079e..8321c8b 100644
--- a/services/tests/servicestests/src/com/android/server/wm/WindowManagerServiceRule.java
+++ b/services/tests/servicestests/src/com/android/server/wm/WindowManagerServiceRule.java
@@ -33,9 +33,10 @@
import android.hardware.display.DisplayManagerInternal;
import android.os.PowerManagerInternal;
import android.os.PowerSaveState;
-import android.support.test.InstrumentationRegistry;
import android.view.InputChannel;
+import androidx.test.InstrumentationRegistry;
+
import com.android.server.LocalServices;
import com.android.server.input.InputManagerService;
import com.android.server.policy.WindowManagerPolicy;
diff --git a/services/tests/servicestests/src/com/android/server/wm/WindowManagerServiceRuleTest.java b/services/tests/servicestests/src/com/android/server/wm/WindowManagerServiceRuleTest.java
index 6cf6d7b..570a853 100644
--- a/services/tests/servicestests/src/com/android/server/wm/WindowManagerServiceRuleTest.java
+++ b/services/tests/servicestests/src/com/android/server/wm/WindowManagerServiceRuleTest.java
@@ -20,8 +20,9 @@
import static org.junit.Assert.assertThat;
import android.platform.test.annotations.Presubmit;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import org.junit.Rule;
import org.junit.Test;
diff --git a/services/tests/servicestests/src/com/android/server/wm/WindowStateTests.java b/services/tests/servicestests/src/com/android/server/wm/WindowStateTests.java
index 9f113ad..108baab 100644
--- a/services/tests/servicestests/src/com/android/server/wm/WindowStateTests.java
+++ b/services/tests/servicestests/src/com/android/server/wm/WindowStateTests.java
@@ -16,19 +16,6 @@
package com.android.server.wm;
-import android.graphics.Rect;
-import android.view.SurfaceControl;
-import android.view.WindowManager;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import android.platform.test.annotations.Presubmit;
-import android.support.test.filters.FlakyTest;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
-
-import java.util.LinkedList;
-
import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
import static android.hardware.camera2.params.OutputConfiguration.ROTATION_90;
@@ -52,7 +39,6 @@
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
-import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyLong;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.Mockito.mock;
@@ -61,6 +47,20 @@
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.verify;
+import android.graphics.Rect;
+import android.platform.test.annotations.Presubmit;
+import android.view.SurfaceControl;
+import android.view.WindowManager;
+
+import androidx.test.filters.FlakyTest;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import java.util.LinkedList;
+
/**
* Tests for the {@link WindowState} class.
*
diff --git a/services/tests/servicestests/src/com/android/server/wm/WindowSurfacePlacerTest.java b/services/tests/servicestests/src/com/android/server/wm/WindowSurfacePlacerTest.java
index e173b7d..057f047 100644
--- a/services/tests/servicestests/src/com/android/server/wm/WindowSurfacePlacerTest.java
+++ b/services/tests/servicestests/src/com/android/server/wm/WindowSurfacePlacerTest.java
@@ -20,13 +20,15 @@
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
import static android.view.WindowManager.TRANSIT_TASK_CLOSE;
import static android.view.WindowManager.TRANSIT_TASK_OPEN;
+
import static junit.framework.Assert.assertEquals;
import android.platform.test.annotations.Presubmit;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
import android.view.WindowManager;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
diff --git a/services/tests/servicestests/src/com/android/server/wm/WindowTestsBase.java b/services/tests/servicestests/src/com/android/server/wm/WindowTestsBase.java
index 473a287..6d1c45b 100644
--- a/services/tests/servicestests/src/com/android/server/wm/WindowTestsBase.java
+++ b/services/tests/servicestests/src/com/android/server/wm/WindowTestsBase.java
@@ -16,30 +16,12 @@
package com.android.server.wm;
+import static android.app.AppOpsManager.OP_NONE;
import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
import static android.view.Display.DEFAULT_DISPLAY;
-import static android.view.View.VISIBLE;
-
-import android.content.res.Configuration;
-import android.graphics.Rect;
-import android.hardware.display.DisplayManagerGlobal;
-import android.testing.DexmakerShareClassLoaderRule;
-import android.util.Log;
-import android.view.Display;
-import android.view.DisplayInfo;
-import org.junit.Assert;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Rule;
-
-import android.content.Context;
-import android.support.test.InstrumentationRegistry;
-import android.view.IWindow;
-import android.view.WindowManager;
-
-import static android.app.AppOpsManager.OP_NONE;
import static android.view.DisplayAdjustments.DEFAULT_DISPLAY_ADJUSTMENTS;
+import static android.view.View.VISIBLE;
import static android.view.WindowManager.LayoutParams.FIRST_APPLICATION_WINDOW;
import static android.view.WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE;
import static android.view.WindowManager.LayoutParams.LAST_APPLICATION_WINDOW;
@@ -52,10 +34,29 @@
import static android.view.WindowManager.LayoutParams.TYPE_NAVIGATION_BAR;
import static android.view.WindowManager.LayoutParams.TYPE_STATUS_BAR;
import static android.view.WindowManager.LayoutParams.TYPE_WALLPAPER;
+
import static org.mockito.Mockito.mock;
+import android.content.Context;
+import android.content.res.Configuration;
+import android.graphics.Rect;
+import android.hardware.display.DisplayManagerGlobal;
+import android.testing.DexmakerShareClassLoaderRule;
+import android.util.Log;
+import android.view.Display;
+import android.view.DisplayInfo;
+import android.view.IWindow;
+import android.view.WindowManager;
+
+import androidx.test.InstrumentationRegistry;
+
import com.android.server.AttributeCache;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Rule;
+
import java.util.HashSet;
import java.util.LinkedList;
diff --git a/services/tests/servicestests/src/com/android/server/wm/WindowTokenTests.java b/services/tests/servicestests/src/com/android/server/wm/WindowTokenTests.java
index e3b7174..3732486 100644
--- a/services/tests/servicestests/src/com/android/server/wm/WindowTokenTests.java
+++ b/services/tests/servicestests/src/com/android/server/wm/WindowTokenTests.java
@@ -16,23 +16,24 @@
package com.android.server.wm;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import android.platform.test.annotations.Presubmit;
-import android.support.test.filters.FlakyTest;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
-
import static android.view.WindowManager.LayoutParams.FIRST_SUB_WINDOW;
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION;
import static android.view.WindowManager.LayoutParams.TYPE_TOAST;
+
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
-import static org.mockito.Mockito.mock;
+
+import android.platform.test.annotations.Presubmit;
+
+import androidx.test.filters.FlakyTest;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
/**
* Tests for the {@link WindowToken} class.
diff --git a/services/tests/servicestests/src/com/android/server/wm/WindowTracingTest.java b/services/tests/servicestests/src/com/android/server/wm/WindowTracingTest.java
index 5085254..bbc6550 100644
--- a/services/tests/servicestests/src/com/android/server/wm/WindowTracingTest.java
+++ b/services/tests/servicestests/src/com/android/server/wm/WindowTracingTest.java
@@ -29,12 +29,13 @@
import android.content.Context;
import android.platform.test.annotations.Presubmit;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.filters.SmallTest;
-import android.support.test.filters.FlakyTest;
-import android.support.test.runner.AndroidJUnit4;
import android.util.proto.ProtoOutputStream;
+import androidx.test.InstrumentationRegistry;
+import androidx.test.filters.FlakyTest;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.internal.util.Preconditions;
import com.android.server.wm.WindowManagerTraceProto;
diff --git a/services/tests/servicestests/src/com/android/server/wm/ZOrderingTests.java b/services/tests/servicestests/src/com/android/server/wm/ZOrderingTests.java
index 547be55..8f9fb1b 100644
--- a/services/tests/servicestests/src/com/android/server/wm/ZOrderingTests.java
+++ b/services/tests/servicestests/src/com/android/server/wm/ZOrderingTests.java
@@ -27,19 +27,19 @@
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_MEDIA;
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_MEDIA_OVERLAY;
import static android.view.WindowManager.LayoutParams.TYPE_BASE_APPLICATION;
-import static android.view.WindowManager.LayoutParams.TYPE_DOCK_DIVIDER;
import static android.view.WindowManager.LayoutParams.TYPE_NAVIGATION_BAR_PANEL;
import static android.view.WindowManager.LayoutParams.TYPE_STATUS_BAR_PANEL;
import static android.view.WindowManager.LayoutParams.TYPE_STATUS_BAR_SUB_PANEL;
import static android.view.WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY;
import android.platform.test.annotations.Presubmit;
-import android.support.test.filters.SmallTest;
-import android.support.test.filters.FlakyTest;
-import android.support.test.runner.AndroidJUnit4;
import android.view.SurfaceControl;
import android.view.SurfaceSession;
+import androidx.test.filters.FlakyTest;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import org.junit.After;
import org.junit.Test;
import org.junit.runner.RunWith;
diff --git a/services/tests/servicestests/src/com/android/server/wm/utils/InsetUtilsTest.java b/services/tests/servicestests/src/com/android/server/wm/utils/InsetUtilsTest.java
index 08bcc3d..3364aef 100644
--- a/services/tests/servicestests/src/com/android/server/wm/utils/InsetUtilsTest.java
+++ b/services/tests/servicestests/src/com/android/server/wm/utils/InsetUtilsTest.java
@@ -25,9 +25,9 @@
import android.graphics.Rect;
import android.platform.test.annotations.Presubmit;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
-import android.util.Pair;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
diff --git a/services/tests/servicestests/src/com/android/server/wm/utils/RotationCacheTest.java b/services/tests/servicestests/src/com/android/server/wm/utils/RotationCacheTest.java
index 6bbc7eb..5d08920 100644
--- a/services/tests/servicestests/src/com/android/server/wm/utils/RotationCacheTest.java
+++ b/services/tests/servicestests/src/com/android/server/wm/utils/RotationCacheTest.java
@@ -24,14 +24,12 @@
import static org.junit.Assert.assertThat;
import android.platform.test.annotations.Presubmit;
-import android.support.test.filters.FlakyTest;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
import android.util.Pair;
-import com.android.server.wm.utils.RotationCache.RotationDependentComputation;
+import androidx.test.filters.FlakyTest;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
-import org.hamcrest.Matchers;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
diff --git a/services/tests/servicestests/src/com/android/server/wm/utils/WmDisplayCutoutTest.java b/services/tests/servicestests/src/com/android/server/wm/utils/WmDisplayCutoutTest.java
index f7addf6..9ce3dca 100644
--- a/services/tests/servicestests/src/com/android/server/wm/utils/WmDisplayCutoutTest.java
+++ b/services/tests/servicestests/src/com/android/server/wm/utils/WmDisplayCutoutTest.java
@@ -25,11 +25,12 @@
import android.graphics.Rect;
import android.platform.test.annotations.Presubmit;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
import android.util.Size;
import android.view.DisplayCutout;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import org.junit.Test;
import org.junit.runner.RunWith;
diff --git a/services/tests/servicestests/test-apps/SuspendTestApp/Android.bp b/services/tests/servicestests/test-apps/SuspendTestApp/Android.bp
index 7bff1ae..ca8d47b 100644
--- a/services/tests/servicestests/test-apps/SuspendTestApp/Android.bp
+++ b/services/tests/servicestests/test-apps/SuspendTestApp/Android.bp
@@ -18,7 +18,7 @@
test_suites: ["device-tests"],
static_libs: [
- "android-support-test",
+ "androidx.test.rules",
"ub-uiautomator",
],
diff --git a/services/tests/uiservicestests/Android.bp b/services/tests/uiservicestests/Android.bp
index b0222b8..23f5572 100644
--- a/services/tests/uiservicestests/Android.bp
+++ b/services/tests/uiservicestests/Android.bp
@@ -17,7 +17,7 @@
"services.net",
"services.usage",
"guava",
- "android-support-test",
+ "androidx.test.rules", "hamcrest-library",
"mockito-target-inline-minus-junit4",
"platform-test-annotations",
"testables",
diff --git a/services/tests/uiservicestests/src/com/android/server/UiServiceTestCase.java b/services/tests/uiservicestests/src/com/android/server/UiServiceTestCase.java
index eec852b..4fca175 100644
--- a/services/tests/uiservicestests/src/com/android/server/UiServiceTestCase.java
+++ b/services/tests/uiservicestests/src/com/android/server/UiServiceTestCase.java
@@ -18,9 +18,10 @@
import android.content.pm.PackageManagerInternal;
import android.os.Build;
-import android.support.test.InstrumentationRegistry;
import android.testing.TestableContext;
+import androidx.test.InstrumentationRegistry;
+
import org.junit.Before;
import org.junit.Rule;
import org.mockito.Mock;
diff --git a/services/tests/uiservicestests/src/com/android/server/notification/AlertRateLimiterTest.java b/services/tests/uiservicestests/src/com/android/server/notification/AlertRateLimiterTest.java
index d4c41e0..dc7f118 100644
--- a/services/tests/uiservicestests/src/com/android/server/notification/AlertRateLimiterTest.java
+++ b/services/tests/uiservicestests/src/com/android/server/notification/AlertRateLimiterTest.java
@@ -20,9 +20,10 @@
import static junit.framework.Assert.assertFalse;
import static junit.framework.Assert.assertTrue;
-import android.support.test.runner.AndroidJUnit4;
import android.test.suitebuilder.annotation.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.server.UiServiceTestCase;
import org.junit.Before;
diff --git a/services/tests/uiservicestests/src/com/android/server/notification/BadgeExtractorTest.java b/services/tests/uiservicestests/src/com/android/server/notification/BadgeExtractorTest.java
index cfc7430..e1f3913 100644
--- a/services/tests/uiservicestests/src/com/android/server/notification/BadgeExtractorTest.java
+++ b/services/tests/uiservicestests/src/com/android/server/notification/BadgeExtractorTest.java
@@ -15,26 +15,26 @@
*/
package com.android.server.notification;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertTrue;
-
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
import static android.app.NotificationManager.IMPORTANCE_HIGH;
import static android.app.NotificationManager.IMPORTANCE_UNSPECIFIED;
import static android.app.NotificationManager.Policy.SUPPRESSED_EFFECT_BADGE;
import static android.app.NotificationManager.Policy.SUPPRESSED_EFFECT_LIGHTS;
+import static junit.framework.Assert.assertFalse;
+import static junit.framework.Assert.assertTrue;
+
+import static org.mockito.Mockito.when;
+
import android.app.ActivityManager;
import android.app.Notification;
import android.app.Notification.Builder;
import android.app.NotificationChannel;
import android.os.UserHandle;
import android.service.notification.StatusBarNotification;
-import android.support.test.runner.AndroidJUnit4;
import android.test.suitebuilder.annotation.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.server.UiServiceTestCase;
import org.junit.Before;
diff --git a/services/tests/uiservicestests/src/com/android/server/notification/BuzzBeepBlinkTest.java b/services/tests/uiservicestests/src/com/android/server/notification/BuzzBeepBlinkTest.java
index 99d2b87..7b2684f 100644
--- a/services/tests/uiservicestests/src/com/android/server/notification/BuzzBeepBlinkTest.java
+++ b/services/tests/uiservicestests/src/com/android/server/notification/BuzzBeepBlinkTest.java
@@ -59,13 +59,14 @@
import android.os.Vibrator;
import android.provider.Settings;
import android.service.notification.StatusBarNotification;
-import android.support.test.runner.AndroidJUnit4;
import android.test.suitebuilder.annotation.SmallTest;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityManager;
import android.view.accessibility.IAccessibilityManager;
import android.view.accessibility.IAccessibilityManagerClient;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.internal.util.IntPair;
import com.android.server.UiServiceTestCase;
import com.android.server.lights.Light;
diff --git a/services/tests/uiservicestests/src/com/android/server/notification/GlobalSortKeyComparatorTest.java b/services/tests/uiservicestests/src/com/android/server/notification/GlobalSortKeyComparatorTest.java
index 97f2104..5041779 100644
--- a/services/tests/uiservicestests/src/com/android/server/notification/GlobalSortKeyComparatorTest.java
+++ b/services/tests/uiservicestests/src/com/android/server/notification/GlobalSortKeyComparatorTest.java
@@ -16,18 +16,16 @@
package com.android.server.notification;
import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Matchers.eq;
import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.os.UserHandle;
import android.service.notification.StatusBarNotification;
-import android.support.test.runner.AndroidJUnit4;
import android.test.suitebuilder.annotation.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.server.UiServiceTestCase;
import org.junit.Test;
diff --git a/services/tests/uiservicestests/src/com/android/server/notification/GroupHelperTest.java b/services/tests/uiservicestests/src/com/android/server/notification/GroupHelperTest.java
index 8d4c5b1..8c08718 100644
--- a/services/tests/uiservicestests/src/com/android/server/notification/GroupHelperTest.java
+++ b/services/tests/uiservicestests/src/com/android/server/notification/GroupHelperTest.java
@@ -25,6 +25,15 @@
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
+import android.app.Notification;
+import android.os.UserHandle;
+import android.service.notification.StatusBarNotification;
+import android.test.suitebuilder.annotation.SmallTest;
+
+import androidx.test.runner.AndroidJUnit4;
+
+import com.android.server.UiServiceTestCase;
+
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,14 +41,6 @@
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
-import android.app.Notification;
-import android.os.UserHandle;
-import android.service.notification.StatusBarNotification;
-import android.support.test.runner.AndroidJUnit4;
-import android.test.suitebuilder.annotation.SmallTest;
-
-import com.android.server.UiServiceTestCase;
-
import java.util.ArrayList;
import java.util.LinkedHashSet;
import java.util.List;
diff --git a/services/tests/uiservicestests/src/com/android/server/notification/ImportanceExtractorTest.java b/services/tests/uiservicestests/src/com/android/server/notification/ImportanceExtractorTest.java
index 73d5961..fa7dff0 100644
--- a/services/tests/uiservicestests/src/com/android/server/notification/ImportanceExtractorTest.java
+++ b/services/tests/uiservicestests/src/com/android/server/notification/ImportanceExtractorTest.java
@@ -15,31 +15,30 @@
*/
package com.android.server.notification;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import android.app.ActivityManager;
-import android.app.Notification;
-import android.app.Notification.Builder;
-import android.app.NotificationManager;
-import android.app.NotificationChannel;
-import android.os.UserHandle;
-import android.service.notification.StatusBarNotification;
-import android.support.test.runner.AndroidJUnit4;
-import android.test.suitebuilder.annotation.SmallTest;
-
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-
+import static org.junit.Assert.assertEquals;
import static org.mockito.Matchers.anyInt;
import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.when;
-import static org.junit.Assert.assertEquals;
+import android.app.ActivityManager;
+import android.app.Notification;
+import android.app.Notification.Builder;
+import android.app.NotificationChannel;
+import android.app.NotificationManager;
+import android.os.UserHandle;
+import android.service.notification.StatusBarNotification;
+import android.test.suitebuilder.annotation.SmallTest;
+
+import androidx.test.runner.AndroidJUnit4;
import com.android.server.UiServiceTestCase;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+
@SmallTest
@RunWith(AndroidJUnit4.class)
public class ImportanceExtractorTest extends UiServiceTestCase {
diff --git a/services/tests/uiservicestests/src/com/android/server/notification/NotificationChannelTest.java b/services/tests/uiservicestests/src/com/android/server/notification/NotificationChannelTest.java
index 2241047..ce5dfba 100644
--- a/services/tests/uiservicestests/src/com/android/server/notification/NotificationChannelTest.java
+++ b/services/tests/uiservicestests/src/com/android/server/notification/NotificationChannelTest.java
@@ -22,9 +22,10 @@
import android.app.NotificationChannel;
import android.os.Parcel;
-import android.support.test.runner.AndroidJUnit4;
import android.test.suitebuilder.annotation.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.internal.util.FastXmlSerializer;
import com.android.server.UiServiceTestCase;
diff --git a/services/tests/uiservicestests/src/com/android/server/notification/NotificationComparatorTest.java b/services/tests/uiservicestests/src/com/android/server/notification/NotificationComparatorTest.java
index 7ee0501..a3aeebf 100644
--- a/services/tests/uiservicestests/src/com/android/server/notification/NotificationComparatorTest.java
+++ b/services/tests/uiservicestests/src/com/android/server/notification/NotificationComparatorTest.java
@@ -35,9 +35,10 @@
import android.provider.Settings;
import android.service.notification.StatusBarNotification;
import android.telecom.TelecomManager;
-import android.support.test.runner.AndroidJUnit4;
import android.test.suitebuilder.annotation.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.server.UiServiceTestCase;
import org.junit.Before;
diff --git a/services/tests/uiservicestests/src/com/android/server/notification/NotificationListenerServiceTest.java b/services/tests/uiservicestests/src/com/android/server/notification/NotificationListenerServiceTest.java
index ef9ba78..9314969 100644
--- a/services/tests/uiservicestests/src/com/android/server/notification/NotificationListenerServiceTest.java
+++ b/services/tests/uiservicestests/src/com/android/server/notification/NotificationListenerServiceTest.java
@@ -40,10 +40,10 @@
import android.service.notification.NotificationListenerService.Ranking;
import android.service.notification.NotificationRankingUpdate;
import android.service.notification.SnoozeCriterion;
-import android.service.notification.StatusBarNotification;
-import android.support.test.runner.AndroidJUnit4;
import android.test.suitebuilder.annotation.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.server.UiServiceTestCase;
import org.junit.Test;
diff --git a/services/tests/uiservicestests/src/com/android/server/notification/NotificationRecordTest.java b/services/tests/uiservicestests/src/com/android/server/notification/NotificationRecordTest.java
index e286991..70e5fd1 100644
--- a/services/tests/uiservicestests/src/com/android/server/notification/NotificationRecordTest.java
+++ b/services/tests/uiservicestests/src/com/android/server/notification/NotificationRecordTest.java
@@ -34,8 +34,6 @@
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import android.app.ActivityManager;
@@ -57,9 +55,9 @@
import android.provider.Settings;
import android.service.notification.Adjustment;
import android.service.notification.StatusBarNotification;
-import android.support.test.runner.AndroidJUnit4;
import android.test.suitebuilder.annotation.SmallTest;
-import android.util.Slog;
+
+import androidx.test.runner.AndroidJUnit4;
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.server.UiServiceTestCase;
diff --git a/services/tests/uiservicestests/src/com/android/server/notification/NotificationStatsTest.java b/services/tests/uiservicestests/src/com/android/server/notification/NotificationStatsTest.java
index 0a630f4..b5d8376 100644
--- a/services/tests/uiservicestests/src/com/android/server/notification/NotificationStatsTest.java
+++ b/services/tests/uiservicestests/src/com/android/server/notification/NotificationStatsTest.java
@@ -23,9 +23,10 @@
import android.os.Parcel;
import android.service.notification.NotificationStats;
-import android.support.test.runner.AndroidJUnit4;
import android.test.suitebuilder.annotation.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.server.UiServiceTestCase;
import org.junit.Test;
diff --git a/services/tests/uiservicestests/src/com/android/server/notification/NotificationTest.java b/services/tests/uiservicestests/src/com/android/server/notification/NotificationTest.java
index 9db823c..901b948 100644
--- a/services/tests/uiservicestests/src/com/android/server/notification/NotificationTest.java
+++ b/services/tests/uiservicestests/src/com/android/server/notification/NotificationTest.java
@@ -22,20 +22,18 @@
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
+import static org.mockito.Matchers.anyInt;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.when;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyInt;
import android.app.ActivityManager;
import android.app.Notification;
-import android.app.Person;
import android.app.PendingIntent;
+import android.app.Person;
import android.app.RemoteInput;
import android.content.Context;
import android.content.pm.ApplicationInfo;
-import android.content.pm.PackageManager;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.Color;
@@ -43,13 +41,14 @@
import android.graphics.drawable.Icon;
import android.net.Uri;
import android.os.Build;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
import android.text.SpannableStringBuilder;
import android.text.Spanned;
import android.text.style.StyleSpan;
import android.widget.RemoteViews;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.server.UiServiceTestCase;
import org.junit.Before;
diff --git a/services/tests/uiservicestests/src/com/android/server/notification/NotifyingAppTest.java b/services/tests/uiservicestests/src/com/android/server/notification/NotifyingAppTest.java
index fbb8c33..25e10d0 100644
--- a/services/tests/uiservicestests/src/com/android/server/notification/NotifyingAppTest.java
+++ b/services/tests/uiservicestests/src/com/android/server/notification/NotifyingAppTest.java
@@ -20,9 +20,10 @@
import android.os.Parcel;
import android.service.notification.NotifyingApp;
-import android.support.test.runner.AndroidJUnit4;
import android.test.suitebuilder.annotation.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.server.UiServiceTestCase;
import org.junit.Test;
diff --git a/services/tests/uiservicestests/src/com/android/server/notification/RankingHelperTest.java b/services/tests/uiservicestests/src/com/android/server/notification/RankingHelperTest.java
index a9e713e..63283ad 100644
--- a/services/tests/uiservicestests/src/com/android/server/notification/RankingHelperTest.java
+++ b/services/tests/uiservicestests/src/com/android/server/notification/RankingHelperTest.java
@@ -33,7 +33,6 @@
import static org.mockito.Matchers.anyInt;
import static org.mockito.Matchers.anyString;
import static org.mockito.Matchers.eq;
-import static org.mockito.Mockito.atLeast;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.reset;
@@ -61,13 +60,14 @@
import android.provider.Settings;
import android.provider.Settings.Secure;
import android.service.notification.StatusBarNotification;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.runner.AndroidJUnit4;
import android.test.suitebuilder.annotation.SmallTest;
import android.testing.TestableContentResolver;
import android.util.ArrayMap;
import android.util.Xml;
+import androidx.test.InstrumentationRegistry;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.internal.util.FastXmlSerializer;
import com.android.server.UiServiceTestCase;
diff --git a/services/tests/uiservicestests/src/com/android/server/notification/RateEstimatorTest.java b/services/tests/uiservicestests/src/com/android/server/notification/RateEstimatorTest.java
index 5d8d48f1..68aa1dc 100644
--- a/services/tests/uiservicestests/src/com/android/server/notification/RateEstimatorTest.java
+++ b/services/tests/uiservicestests/src/com/android/server/notification/RateEstimatorTest.java
@@ -15,17 +15,19 @@
*/
package com.android.server.notification;
-import android.support.test.runner.AndroidJUnit4;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
import android.test.suitebuilder.annotation.SmallTest;
+
+import androidx.test.runner.AndroidJUnit4;
+
+import com.android.server.UiServiceTestCase;
+
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.assertFalse;
-
-import com.android.server.UiServiceTestCase;
-
@SmallTest
@RunWith(AndroidJUnit4.class)
public class RateEstimatorTest extends UiServiceTestCase {
diff --git a/services/tests/uiservicestests/src/com/android/server/notification/ScheduleCalendarTest.java b/services/tests/uiservicestests/src/com/android/server/notification/ScheduleCalendarTest.java
index 96ac935..c0fecaf 100644
--- a/services/tests/uiservicestests/src/com/android/server/notification/ScheduleCalendarTest.java
+++ b/services/tests/uiservicestests/src/com/android/server/notification/ScheduleCalendarTest.java
@@ -23,14 +23,14 @@
import android.service.notification.ScheduleCalendar;
import android.service.notification.ZenModeConfig;
-import android.support.test.filters.FlakyTest;
-import android.support.test.runner.AndroidJUnit4;
import android.test.suitebuilder.annotation.SmallTest;
+import androidx.test.filters.FlakyTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.server.UiServiceTestCase;
import org.junit.Before;
-import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
diff --git a/services/tests/uiservicestests/src/com/android/server/notification/ScheduleConditionProviderTest.java b/services/tests/uiservicestests/src/com/android/server/notification/ScheduleConditionProviderTest.java
index efa70e7..551e186 100644
--- a/services/tests/uiservicestests/src/com/android/server/notification/ScheduleConditionProviderTest.java
+++ b/services/tests/uiservicestests/src/com/android/server/notification/ScheduleConditionProviderTest.java
@@ -10,11 +10,11 @@
import android.service.notification.Condition;
import android.service.notification.ScheduleCalendar;
import android.service.notification.ZenModeConfig;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper.RunWithLooper;
+import androidx.test.filters.SmallTest;
+
import com.android.server.UiServiceTestCase;
import org.junit.Before;
diff --git a/services/tests/uiservicestests/src/com/android/server/notification/SnoozeHelperTest.java b/services/tests/uiservicestests/src/com/android/server/notification/SnoozeHelperTest.java
index 88c6fcf..6f760fe 100644
--- a/services/tests/uiservicestests/src/com/android/server/notification/SnoozeHelperTest.java
+++ b/services/tests/uiservicestests/src/com/android/server/notification/SnoozeHelperTest.java
@@ -15,12 +15,16 @@
*/
package com.android.server.notification;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.ArgumentCaptor;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
+import static junit.framework.Assert.assertEquals;
+import static junit.framework.Assert.assertTrue;
+
+import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.anyInt;
+import static org.mockito.Matchers.anyLong;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
import android.app.AlarmManager;
import android.app.Notification;
@@ -30,23 +34,18 @@
import android.os.SystemClock;
import android.os.UserHandle;
import android.service.notification.StatusBarNotification;
-import android.support.test.runner.AndroidJUnit4;
import android.test.suitebuilder.annotation.SmallTest;
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertTrue;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyInt;
-import static org.mockito.Matchers.anyLong;
-import static org.mockito.Matchers.eq;
-import static org.mockito.Mockito.never;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
+import androidx.test.runner.AndroidJUnit4;
import com.android.server.UiServiceTestCase;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.ArgumentCaptor;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
@SmallTest
@RunWith(AndroidJUnit4.class)
diff --git a/services/tests/uiservicestests/src/com/android/server/notification/ValidateNotificationPeopleTest.java b/services/tests/uiservicestests/src/com/android/server/notification/ValidateNotificationPeopleTest.java
index 025b11a..b1ee120 100644
--- a/services/tests/uiservicestests/src/com/android/server/notification/ValidateNotificationPeopleTest.java
+++ b/services/tests/uiservicestests/src/com/android/server/notification/ValidateNotificationPeopleTest.java
@@ -15,23 +15,24 @@
*/
package com.android.server.notification;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+
import android.app.Notification;
import android.app.Person;
import android.os.Bundle;
-import android.support.test.runner.AndroidJUnit4;
import android.test.suitebuilder.annotation.SmallTest;
import android.text.SpannableString;
-import java.util.ArrayList;
-import java.util.Arrays;
+import androidx.test.runner.AndroidJUnit4;
+
+import com.android.server.UiServiceTestCase;
import org.junit.Test;
import org.junit.runner.RunWith;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertEquals;
-
-import com.android.server.UiServiceTestCase;
+import java.util.ArrayList;
+import java.util.Arrays;
@SmallTest
@RunWith(AndroidJUnit4.class)
diff --git a/services/tests/uiservicestests/src/com/android/server/slice/PackageMatchingCacheTest.java b/services/tests/uiservicestests/src/com/android/server/slice/PackageMatchingCacheTest.java
index c6aea88..f6c854e 100644
--- a/services/tests/uiservicestests/src/com/android/server/slice/PackageMatchingCacheTest.java
+++ b/services/tests/uiservicestests/src/com/android/server/slice/PackageMatchingCacheTest.java
@@ -21,10 +21,11 @@
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
-import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper.RunWithLooper;
+import androidx.test.filters.SmallTest;
+
import com.android.server.UiServiceTestCase;
import com.android.server.slice.SliceManagerService.PackageMatchingCache;
diff --git a/services/tests/uiservicestests/src/com/android/server/slice/PinnedSliceStateTest.java b/services/tests/uiservicestests/src/com/android/server/slice/PinnedSliceStateTest.java
index 82e0fbe..f35bb66 100644
--- a/services/tests/uiservicestests/src/com/android/server/slice/PinnedSliceStateTest.java
+++ b/services/tests/uiservicestests/src/com/android/server/slice/PinnedSliceStateTest.java
@@ -26,11 +26,12 @@
import android.os.IBinder;
import android.os.IBinder.DeathRecipient;
import android.os.RemoteException;
-import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.testing.TestableLooper.RunWithLooper;
+import androidx.test.filters.SmallTest;
+
import com.android.server.UiServiceTestCase;
import org.junit.Before;
diff --git a/services/tests/uiservicestests/src/com/android/server/slice/SliceClientPermissionsTest.java b/services/tests/uiservicestests/src/com/android/server/slice/SliceClientPermissionsTest.java
index 1efa415..ff2236d 100644
--- a/services/tests/uiservicestests/src/com/android/server/slice/SliceClientPermissionsTest.java
+++ b/services/tests/uiservicestests/src/com/android/server/slice/SliceClientPermissionsTest.java
@@ -24,14 +24,15 @@
import android.content.ContentResolver;
import android.net.Uri;
-import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper.RunWithLooper;
import android.util.Xml.Encoding;
+import androidx.test.filters.SmallTest;
+
import com.android.server.UiServiceTestCase;
-import com.android.server.slice.SlicePermissionManager.PkgUser;
import com.android.server.slice.SliceClientPermissions.SliceAuthority;
+import com.android.server.slice.SlicePermissionManager.PkgUser;
import org.junit.Test;
import org.junit.runner.RunWith;
diff --git a/services/tests/uiservicestests/src/com/android/server/slice/SliceFullAccessListTest.java b/services/tests/uiservicestests/src/com/android/server/slice/SliceFullAccessListTest.java
index bc28150..d942c5a 100644
--- a/services/tests/uiservicestests/src/com/android/server/slice/SliceFullAccessListTest.java
+++ b/services/tests/uiservicestests/src/com/android/server/slice/SliceFullAccessListTest.java
@@ -19,9 +19,10 @@
import static org.junit.Assert.assertTrue;
import android.os.UserHandle;
-import android.support.test.filters.SmallTest;
import android.util.Xml.Encoding;
+import androidx.test.filters.SmallTest;
+
import com.android.server.UiServiceTestCase;
import org.junit.Before;
diff --git a/services/tests/uiservicestests/src/com/android/server/slice/SliceManagerServiceTest.java b/services/tests/uiservicestests/src/com/android/server/slice/SliceManagerServiceTest.java
index 43a4e27..e4f0008 100644
--- a/services/tests/uiservicestests/src/com/android/server/slice/SliceManagerServiceTest.java
+++ b/services/tests/uiservicestests/src/com/android/server/slice/SliceManagerServiceTest.java
@@ -33,18 +33,18 @@
import android.app.AppOpsManager;
import android.app.slice.SliceSpec;
import android.app.usage.UsageStatsManagerInternal;
-import android.content.pm.PackageManagerInternal;
import android.net.Uri;
import android.os.Binder;
import android.os.IBinder;
import android.os.Process;
import android.os.RemoteException;
-import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.TestableContext;
import android.testing.TestableLooper;
import android.testing.TestableLooper.RunWithLooper;
+import androidx.test.filters.SmallTest;
+
import com.android.server.LocalServices;
import com.android.server.UiServiceTestCase;
diff --git a/services/tests/uiservicestests/src/com/android/server/slice/SlicePermissionManagerTest.java b/services/tests/uiservicestests/src/com/android/server/slice/SlicePermissionManagerTest.java
index dc057d5..2531ada 100644
--- a/services/tests/uiservicestests/src/com/android/server/slice/SlicePermissionManagerTest.java
+++ b/services/tests/uiservicestests/src/com/android/server/slice/SlicePermissionManagerTest.java
@@ -22,12 +22,13 @@
import android.net.Uri;
import android.net.Uri.Builder;
import android.os.FileUtils;
-import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.testing.TestableLooper.RunWithLooper;
import android.util.Xml.Encoding;
+import androidx.test.filters.SmallTest;
+
import com.android.server.UiServiceTestCase;
import org.junit.Test;
diff --git a/services/tests/uiservicestests/src/com/android/server/slice/SliceProviderPermissionsTest.java b/services/tests/uiservicestests/src/com/android/server/slice/SliceProviderPermissionsTest.java
index 5775991..8e61d21 100644
--- a/services/tests/uiservicestests/src/com/android/server/slice/SliceProviderPermissionsTest.java
+++ b/services/tests/uiservicestests/src/com/android/server/slice/SliceProviderPermissionsTest.java
@@ -20,11 +20,12 @@
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
-import android.support.test.filters.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper.RunWithLooper;
import android.util.Xml.Encoding;
+import androidx.test.filters.SmallTest;
+
import com.android.server.UiServiceTestCase;
import com.android.server.slice.SlicePermissionManager.PkgUser;
import com.android.server.slice.SliceProviderPermissions.SliceAuthority;
diff --git a/telecomm/java/android/telecom/CallIdentification.java b/telecomm/java/android/telecom/CallIdentification.java
index cde7f60..fffc123 100644
--- a/telecomm/java/android/telecom/CallIdentification.java
+++ b/telecomm/java/android/telecom/CallIdentification.java
@@ -44,7 +44,7 @@
* A {@link CallScreeningService} uses this class to create new instances of
* {@link CallIdentification} for a screened call.
*/
- public static class Builder {
+ public final static class Builder {
private CharSequence mName;
private CharSequence mDescription;
private CharSequence mDetails;
@@ -67,7 +67,7 @@
* @param callIdAppName The app name.
* @hide
*/
- public Builder(String callIdPackageName, CharSequence callIdAppName) {
+ public Builder(@NonNull String callIdPackageName, @NonNull CharSequence callIdAppName) {
mPackageName = callIdPackageName;
mAppName = callIdAppName;
}
@@ -80,7 +80,7 @@
* @param name The name associated with the call, or {@code null} if none is provided.
* @return Builder instance.
*/
- public Builder setName(@Nullable CharSequence name) {
+ public @NonNull Builder setName(@Nullable CharSequence name) {
mName = name;
return this;
}
@@ -97,7 +97,7 @@
* @param description The call description, or {@code null} if none is provided.
* @return Builder instance.
*/
- public Builder setDescription(@Nullable CharSequence description) {
+ public @NonNull Builder setDescription(@Nullable CharSequence description) {
mDescription = description;
return this;
}
@@ -114,7 +114,8 @@
* @param details The call details, or {@code null} if none is provided.
* @return Builder instance.
*/
- public Builder setDetails(@Nullable CharSequence details) {
+
+ public @NonNull Builder setDetails(@Nullable CharSequence details) {
mDetails = details;
return this;
}
@@ -127,7 +128,7 @@
* @param photo The photo associated with the call, or {@code null} if none was provided.
* @return Builder instance.
*/
- public Builder setPhoto(@Nullable Icon photo) {
+ public @NonNull Builder setPhoto(@Nullable Icon photo) {
mPhoto = photo;
return this;
}
@@ -141,7 +142,7 @@
* @param nuisanceConfidence The nuisance confidence.
* @return The builder.
*/
- public Builder setNuisanceConfidence(@NuisanceConfidence int nuisanceConfidence) {
+ public @NonNull Builder setNuisanceConfidence(@NuisanceConfidence int nuisanceConfidence) {
mNuisanceConfidence = nuisanceConfidence;
return this;
}
@@ -152,7 +153,7 @@
*
* @return {@link CallIdentification} instance.
*/
- public CallIdentification build() {
+ public @NonNull CallIdentification build() {
return new CallIdentification(mName, mDescription, mDetails, mPhoto,
mNuisanceConfidence, mPackageName, mAppName);
}
diff --git a/telecomm/java/android/telecom/Conference.java b/telecomm/java/android/telecom/Conference.java
index 7d1f8ce..6382acf 100644
--- a/telecomm/java/android/telecom/Conference.java
+++ b/telecomm/java/android/telecom/Conference.java
@@ -19,6 +19,7 @@
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.SystemApi;
+import android.annotation.TestApi;
import android.net.Uri;
import android.os.Bundle;
import android.os.SystemClock;
@@ -571,6 +572,7 @@
* @return The primary connection.
* @hide
*/
+ @TestApi
@SystemApi
public Connection getPrimaryConnection() {
if (mUnmodifiableChildConnections == null || mUnmodifiableChildConnections.isEmpty()) {
diff --git a/telecomm/java/android/telecom/PhoneAccountSuggestion.java b/telecomm/java/android/telecom/PhoneAccountSuggestion.java
index b401bcf..563c2dc 100644
--- a/telecomm/java/android/telecom/PhoneAccountSuggestion.java
+++ b/telecomm/java/android/telecom/PhoneAccountSuggestion.java
@@ -17,8 +17,7 @@
package android.telecom;
import android.annotation.IntDef;
-import android.annotation.SystemApi;
-import android.annotation.TestApi;
+import android.annotation.NonNull;
import android.os.Parcel;
import android.os.Parcelable;
@@ -68,11 +67,16 @@
private boolean mShouldAutoSelect;
/**
- * @hide
+ * Creates a new instance of {@link PhoneAccountSuggestion}. This constructor is intended for
+ * use by apps implementing a {@link PhoneAccountSuggestionService}, and generally should not be
+ * used by dialer apps other than for testing purposes.
+ *
+ * @param handle The {@link PhoneAccountHandle} for this suggestion.
+ * @param reason The reason for this suggestion
+ * @param shouldAutoSelect Whether the dialer should automatically place the call using this
+ * account. See {@link #shouldAutoSelect()}.
*/
- @SystemApi
- @TestApi
- public PhoneAccountSuggestion(PhoneAccountHandle handle, @SuggestionReason int reason,
+ public PhoneAccountSuggestion(@NonNull PhoneAccountHandle handle, @SuggestionReason int reason,
boolean shouldAutoSelect) {
this.mHandle = handle;
this.mReason = reason;
@@ -101,7 +105,7 @@
/**
* @return The {@link PhoneAccountHandle} for this suggestion.
*/
- public PhoneAccountHandle getPhoneAccountHandle() {
+ @NonNull public PhoneAccountHandle getPhoneAccountHandle() {
return mHandle;
}
diff --git a/telecomm/java/android/telecom/TelecomManager.java b/telecomm/java/android/telecom/TelecomManager.java
index c60eb56..84b2238 100644
--- a/telecomm/java/android/telecom/TelecomManager.java
+++ b/telecomm/java/android/telecom/TelecomManager.java
@@ -17,11 +17,13 @@
import android.Manifest;
import android.annotation.IntDef;
import android.annotation.NonNull;
+import android.annotation.Nullable;
import android.annotation.RequiresPermission;
import android.annotation.SuppressAutoDoc;
import android.annotation.SuppressLint;
import android.annotation.SystemApi;
import android.annotation.SystemService;
+import android.annotation.TestApi;
import android.annotation.UnsupportedAppUsage;
import android.content.ComponentName;
import android.content.Context;
@@ -560,6 +562,7 @@
*
* @hide
*/
+ @TestApi
@SystemApi
public static final int TTY_MODE_OFF = 0;
@@ -569,6 +572,7 @@
*
* @hide
*/
+ @TestApi
@SystemApi
public static final int TTY_MODE_FULL = 1;
@@ -579,6 +583,7 @@
*
* @hide
*/
+ @TestApi
@SystemApi
public static final int TTY_MODE_HCO = 2;
@@ -589,6 +594,7 @@
*
* @hide
*/
+ @TestApi
@SystemApi
public static final int TTY_MODE_VCO = 3;
@@ -804,10 +810,11 @@
* <p>
* The default dialer has access to use this method.
*
- * @return The user outgoing phone account selected by the user.
+ * @return The user outgoing phone account selected by the user, or {@code null} if there is no
+ * user selected outgoing {@link PhoneAccountHandle}.
*/
@RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
- public PhoneAccountHandle getUserSelectedOutgoingPhoneAccount() {
+ public @Nullable PhoneAccountHandle getUserSelectedOutgoingPhoneAccount() {
try {
if (isServiceConnected()) {
return getTelecomService().getUserSelectedOutgoingPhoneAccount(
@@ -823,12 +830,14 @@
* Sets the user-chosen default {@link PhoneAccountHandle} for making outgoing phone calls.
*
* @param accountHandle The {@link PhoneAccountHandle} which will be used by default for making
- * outgoing voice calls.
+ * outgoing voice calls, or {@code null} if no default is specified (the
+ * user will be asked each time a call is placed in this case).
* @hide
*/
@RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE)
+ @TestApi
@SystemApi
- public void setUserSelectedOutgoingPhoneAccount(PhoneAccountHandle accountHandle) {
+ public void setUserSelectedOutgoingPhoneAccount(@Nullable PhoneAccountHandle accountHandle) {
try {
if (isServiceConnected()) {
getTelecomService().setUserSelectedOutgoingPhoneAccount(accountHandle);
@@ -1195,7 +1204,8 @@
/**
* Used to set the default dialer package.
*
- * @param packageName to set the default dialer to.
+ * @param packageName to set the default dialer to, or {@code null} if the system provided
+ * dialer should be used instead.
*
* @result {@code true} if the default dialer was successfully changed, {@code false} if
* the specified package does not correspond to an installed dialer, or is already
@@ -1212,7 +1222,7 @@
@RequiresPermission(allOf = {
android.Manifest.permission.MODIFY_PHONE_STATE,
android.Manifest.permission.WRITE_SECURE_SETTINGS})
- public boolean setDefaultDialer(String packageName) {
+ public boolean setDefaultDialer(@Nullable String packageName) {
try {
if (isServiceConnected()) {
return getTelecomService().setDefaultDialer(packageName);
@@ -1226,9 +1236,10 @@
/**
* Determines the package name of the system-provided default phone app.
*
- * @return package name for the system dialer package or null if no system dialer is preloaded.
+ * @return package name for the system dialer package or {@code null} if no system dialer is
+ * preloaded.
*/
- public String getSystemDialerPackage() {
+ public @Nullable String getSystemDialerPackage() {
try {
if (isServiceConnected()) {
return getTelecomService().getSystemDialerPackage();
@@ -1527,6 +1538,7 @@
* @hide
*/
@SystemApi
+ @TestApi
@RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE)
public @TtyMode int getCurrentTtyMode() {
try {
@@ -1975,6 +1987,7 @@
* @hide
*/
@SystemApi
+ @TestApi
@RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE)
public boolean isInEmergencyCall() {
try {
diff --git a/telecomm/java/com/android/internal/telecom/ITelecomService.aidl b/telecomm/java/com/android/internal/telecom/ITelecomService.aidl
index 5030f90..93eea56 100644
--- a/telecomm/java/com/android/internal/telecom/ITelecomService.aidl
+++ b/telecomm/java/com/android/internal/telecom/ITelecomService.aidl
@@ -182,6 +182,7 @@
/**
* @see TelecomServiceImpl#getCallState
*/
+ @UnsupportedAppUsage
int getCallState();
/**
diff --git a/telephony/java/android/provider/Telephony.java b/telephony/java/android/provider/Telephony.java
index 21cc1a2..4939157 100644
--- a/telephony/java/android/provider/Telephony.java
+++ b/telephony/java/android/provider/Telephony.java
@@ -17,6 +17,7 @@
package android.provider;
import android.annotation.IntDef;
+import android.annotation.NonNull;
import android.annotation.RequiresPermission;
import android.annotation.SdkConstant;
import android.annotation.SdkConstant.SdkConstantType;
@@ -1126,8 +1127,8 @@
* Broadcast Action: A debug code has been entered in the dialer. This intent is
* broadcast by the system and OEM telephony apps may need to receive these broadcasts.
* These "secret codes" are used to activate developer menus by dialing certain codes.
- * And they are of the form {@code *#*#<code>#*#*}. The intent will have the data
- * URI: {@code android_secret_code://<code>}. It is possible that a manifest
+ * And they are of the form {@code *#*#<code>#*#*}. The intent will have the data
+ * URI: {@code android_secret_code://<code>}. It is possible that a manifest
* receiver would be woken up even if it is not currently running.
*
* <p>Requires {@code android.Manifest.permission#CONTROL_INCALL_EXPERIENCE} to
@@ -3764,6 +3765,42 @@
*/
public static final String CARRIER_ID = "carrier_id";
+ /**
+ * The skip 464xlat flag. Flag works as follows.
+ * {@link #SKIP_464XLAT_DEFAULT}: the APN will skip only APN is IMS and no internet.
+ * {@link #SKIP_464XLAT_DISABLE}: the APN will NOT skip 464xlat
+ * {@link #SKIP_464XLAT_ENABLE}: the APN will skip 464xlat
+ * <p>Type: INTEGER</p>
+ *
+ * @hide
+ */
+ public static final String SKIP_464XLAT = "skip_464xlat";
+
+ /**
+ * Possible value for the {@link #SKIP_464XLAT} field.
+ * <p>Type: INTEGER</p>
+ *
+ * @hide
+ */
+ public static final int SKIP_464XLAT_DEFAULT = -1;
+
+ /**
+ * Possible value for the {@link #SKIP_464XLAT} field.
+ * <p>Type: INTEGER</p>
+ *
+ * @hide
+ */
+ public static final int SKIP_464XLAT_DISABLE = 0;
+
+ /**
+ * Possible value for the {@link #SKIP_464XLAT} field.
+ * <p>Type: INTEGER</p>
+ *
+ * @hide
+ */
+ public static final int SKIP_464XLAT_ENABLE = 1;
+
+
/** @hide */
@IntDef({
UNEDITED,
@@ -3774,6 +3811,16 @@
})
@Retention(RetentionPolicy.SOURCE)
public @interface EditStatus {}
+
+ /** @hide */
+ @IntDef({
+ SKIP_464XLAT_DEFAULT,
+ SKIP_464XLAT_DISABLE,
+ SKIP_464XLAT_ENABLE,
+ })
+ @Retention(RetentionPolicy.SOURCE)
+ public @interface Skip464XlatStatus {}
+
}
/**
@@ -4277,6 +4324,7 @@
* @param subscriptionId the subscriptionId to receive updates on
* @return the Uri used to observe precise carrier identity changes
*/
+ @NonNull
public static Uri getPreciseCarrierIdUriForSubscriptionId(int subscriptionId) {
return Uri.withAppendedPath(Uri.withAppendedPath(CONTENT_URI, "precise"),
String.valueOf(subscriptionId));
diff --git a/telephony/java/android/telephony/CallAttributes.java b/telephony/java/android/telephony/CallAttributes.java
index 0d4f09f..2ff2d91 100644
--- a/telephony/java/android/telephony/CallAttributes.java
+++ b/telephony/java/android/telephony/CallAttributes.java
@@ -16,6 +16,7 @@
package android.telephony;
+import android.annotation.NonNull;
import android.annotation.SystemApi;
import android.os.Parcel;
import android.os.Parcelable;
@@ -29,15 +30,15 @@
* @hide
*/
@SystemApi
-public class CallAttributes implements Parcelable {
+public final class CallAttributes implements Parcelable {
private PreciseCallState mPreciseCallState;
@NetworkType
private int mNetworkType; // TelephonyManager.NETWORK_TYPE_* ints
private CallQuality mCallQuality;
- public CallAttributes(PreciseCallState state, @NetworkType int networkType,
- CallQuality callQuality) {
+ public CallAttributes(@NonNull PreciseCallState state, @NetworkType int networkType,
+ @NonNull CallQuality callQuality) {
this.mPreciseCallState = state;
this.mNetworkType = networkType;
this.mCallQuality = callQuality;
@@ -59,6 +60,7 @@
/**
* Returns the {@link PreciseCallState} of the call.
*/
+ @NonNull
public PreciseCallState getPreciseCallState() {
return mPreciseCallState;
}
@@ -96,6 +98,7 @@
/**
* Returns the {#link CallQuality} of the call.
*/
+ @NonNull
public CallQuality getCallQuality() {
return mCallQuality;
}
diff --git a/telephony/java/android/telephony/CarrierConfigManager.java b/telephony/java/android/telephony/CarrierConfigManager.java
index aef3dbf..9cdd53e 100644
--- a/telephony/java/android/telephony/CarrierConfigManager.java
+++ b/telephony/java/android/telephony/CarrierConfigManager.java
@@ -31,6 +31,7 @@
import android.os.RemoteException;
import android.os.ServiceManager;
import android.service.carrier.CarrierService;
+import android.telecom.TelecomManager;
import android.telephony.ims.ImsReasonInfo;
import com.android.internal.telephony.ICarrierConfigLoader;
@@ -1812,17 +1813,32 @@
/**
* Determine whether user can change Wi-Fi Calling preference in roaming.
- * {@code false} - roaming preference {@link KEY_CARRIER_DEFAULT_WFC_IMS_ROAMING_MODE_INT} is
- * the same as home preference {@link KEY_CARRIER_DEFAULT_WFC_IMS_MODE_INT}
- * and cannot be changed.
- * {@code true} - roaming preference can be changed by user independently.
- *
+ * {@code false} - roaming preference cannot be changed by user independently. If
+ * {@link #KEY_USE_WFC_HOME_NETWORK_MODE_IN_ROAMING_NETWORK_BOOL} is false,
+ * {@link #KEY_CARRIER_DEFAULT_WFC_IMS_ROAMING_MODE_INT} is used as the default
+ * value. If {@link #KEY_USE_WFC_HOME_NETWORK_MODE_IN_ROAMING_NETWORK_BOOL} is
+ * true, roaming preference is the same as home preference and
+ * {@link #KEY_CARRIER_DEFAULT_WFC_IMS_MODE_INT} is used as the default value.
+ * {@code true} - roaming preference can be changed by user independently if
+ * {@link #KEY_USE_WFC_HOME_NETWORK_MODE_IN_ROAMING_NETWORK_BOOL} is false. If
+ * {@link #KEY_USE_WFC_HOME_NETWORK_MODE_IN_ROAMING_NETWORK_BOOL} is true, this
+ * configuration is ignored and roaming preference cannot be changed.
* @hide
*/
public static final String KEY_EDITABLE_WFC_ROAMING_MODE_BOOL =
"editable_wfc_roaming_mode_bool";
/**
+ * Flag specifying whether the carrier will use the WFC home network mode in roaming network.
+ * {@code false} - roaming preference can be selected separately from the home preference.
+ * {@code true} - roaming preference is the same as home preference and
+ * {@link #KEY_CARRIER_DEFAULT_WFC_IMS_MODE_INT} is used as the default value.
+ * @hide
+ */
+ public static final String KEY_USE_WFC_HOME_NETWORK_MODE_IN_ROAMING_NETWORK_BOOL =
+ "use_wfc_home_network_mode_in_roaming_network_bool";
+
+ /**
* Determine whether current lpp_mode used for E-911 needs to be kept persistently.
* {@code false} - not keeping the lpp_mode means using default configuration of gps.conf
* when sim is not presented.
@@ -2110,6 +2126,18 @@
public static final String KEY_RTT_SUPPORTED_BOOL = "rtt_supported_bool";
/**
+ * Boolean flag indicating whether the carrier supports TTY.
+ * <p>
+ * Note that {@link #KEY_CARRIER_VOLTE_TTY_SUPPORTED_BOOL} controls availability of TTY over
+ * VoLTE; if {@link #KEY_TTY_SUPPORTED_BOOL} is disabled, then
+ * {@link #KEY_CARRIER_VOLTE_TTY_SUPPORTED_BOOL} is also implicitly disabled.
+ * <p>
+ * {@link TelecomManager#isTtySupported()} should be used to determine if a device supports TTY,
+ * and this carrier config key should be used to see if the current carrier supports it.
+ */
+ public static final String KEY_TTY_SUPPORTED_BOOL = "tty_supported_bool";
+
+ /**
* Indicates if the carrier supports auto-upgrading a call to RTT when receiving a call from a
* RTT-supported device.
* @hide
@@ -2427,6 +2455,42 @@
public static final String KEY_OPPORTUNISTIC_NETWORK_DATA_SWITCH_HYSTERESIS_TIME_LONG =
"opportunistic_network_data_switch_hysteresis_time_long";
+ /**
+ * An int array containing CDMA enhanced roaming indicator values for Home (non-roaming) network.
+ * The default values come from 3GPP2 C.R1001 table 8.1-1.
+ * Enhanced Roaming Indicator Number Assignments
+ *
+ * @hide
+ */
+ public static final String KEY_CDMA_ENHANCED_ROAMING_INDICATOR_FOR_HOME_NETWORK_INT_ARRAY =
+ "cdma_enhanced_roaming_indicator_for_home_network_int_array";
+
+ /**
+ * This configuration allow the system UI to display different 5G icon for different 5G status.
+ *
+ * There are four 5G status:
+ * 1. connected_mmwave: device currently connected to 5G cell as the secondary cell and using
+ * millimeter wave.
+ * 2. connected: device currently connected to 5G cell as the secondary cell but not using
+ * millimeter wave.
+ * 3. not_restricted: device camped on a network that has 5G capability(not necessary to connect
+ * a 5G cell as a secondary cell) and the use of 5G is not restricted.
+ * 4. restricted: device camped on a network that has 5G capability(not necessary to connect a
+ * 5G cell as a secondary cell) but the use of 5G is restricted.
+ *
+ * The configured string contains multiple key-value pairs separated by comma. For each pair,
+ * the key and value is separated by a colon. The key is corresponded to a 5G status above and
+ * the value is the icon name. Use "None" as the icon name if no icon should be shown in a
+ * specific 5G status.
+ *
+ * Here is an example of the configuration:
+ * "connected_mmwave:5GPlus,connected:5G,not_restricted:None,restricted:None"
+ *
+ * @hide
+ */
+ public static final String KEY_5G_ICON_CONFIGURATION_STRING =
+ "5g_icon_configuration_string";
+
/** The default value for every variable. */
private final static PersistableBundle sDefaults;
@@ -2723,6 +2787,7 @@
sDefaults.putBoolean(KEY_NOTIFY_VT_HANDOVER_TO_WIFI_FAILURE_BOOL, false);
sDefaults.putStringArray(KEY_FILTERED_CNAP_NAMES_STRING_ARRAY, null);
sDefaults.putBoolean(KEY_EDITABLE_WFC_ROAMING_MODE_BOOL, false);
+ sDefaults.putBoolean(KEY_USE_WFC_HOME_NETWORK_MODE_IN_ROAMING_NETWORK_BOOL, false);
sDefaults.putBoolean(KEY_STK_DISABLE_LAUNCH_BROWSER_BOOL, false);
sDefaults.putBoolean(KEY_PERSIST_LPP_MODE_BOOL, true);
sDefaults.putStringArray(KEY_CARRIER_WIFI_STRING_ARRAY, null);
@@ -2749,6 +2814,7 @@
sDefaults.putStringArray(KEY_ROAMING_OPERATOR_STRING_ARRAY, null);
sDefaults.putBoolean(KEY_SHOW_IMS_REGISTRATION_STATUS_BOOL, false);
sDefaults.putBoolean(KEY_RTT_SUPPORTED_BOOL, false);
+ sDefaults.putBoolean(KEY_TTY_SUPPORTED_BOOL, true);
sDefaults.putBoolean(KEY_DISABLE_CHARGE_INDICATION_BOOL, false);
sDefaults.putBoolean(KEY_SUPPORT_NO_REPLY_TIMER_FOR_CFNRY_BOOL, true);
sDefaults.putStringArray(KEY_FEATURE_ACCESS_CODES_STRING_ARRAY, null);
@@ -2803,6 +2869,12 @@
sDefaults.putLong(KEY_OPPORTUNISTIC_NETWORK_ENTRY_OR_EXIT_HYSTERESIS_TIME_LONG, 10000);
/* Default value is 10 seconds. */
sDefaults.putLong(KEY_OPPORTUNISTIC_NETWORK_DATA_SWITCH_HYSTERESIS_TIME_LONG, 10000);
+ sDefaults.putIntArray(KEY_CDMA_ENHANCED_ROAMING_INDICATOR_FOR_HOME_NETWORK_INT_ARRAY,
+ new int[] {
+ 1 /* Roaming Indicator Off */
+ });
+ sDefaults.putString(KEY_5G_ICON_CONFIGURATION_STRING,
+ "connected_mmwave:None,connected:5G,not_restricted:None,restricted:None");
}
/**
diff --git a/telephony/java/android/telephony/CarrierRestrictionRules.java b/telephony/java/android/telephony/CarrierRestrictionRules.java
index d47b55c..b627788 100644
--- a/telephony/java/android/telephony/CarrierRestrictionRules.java
+++ b/telephony/java/android/telephony/CarrierRestrictionRules.java
@@ -177,7 +177,8 @@
* @return a list of boolean with the same size as input, indicating if each
* {@link CarrierIdentifier} is allowed or not.
*/
- public List<Boolean> isCarrierIdentifiersAllowed(@NonNull List<CarrierIdentifier> carrierIds) {
+ public @NonNull List<Boolean> areCarrierIdentifiersAllowed(
+ @NonNull List<CarrierIdentifier> carrierIds) {
ArrayList<Boolean> result = new ArrayList<>(carrierIds.size());
// First calculate the result for each slot independently
@@ -332,7 +333,7 @@
/**
* Builder for a {@link CarrierRestrictionRules}.
*/
- public static class Builder {
+ public static final class Builder {
private final CarrierRestrictionRules mRules;
/** {@hide} */
@@ -341,14 +342,14 @@
}
/** build command */
- public CarrierRestrictionRules build() {
+ public @NonNull CarrierRestrictionRules build() {
return mRules;
}
/**
* Indicate that all carriers are allowed.
*/
- public Builder setAllCarriersAllowed() {
+ public @NonNull Builder setAllCarriersAllowed() {
mRules.mAllowedCarriers.clear();
mRules.mExcludedCarriers.clear();
mRules.mCarrierRestrictionDefault = CARRIER_RESTRICTION_DEFAULT_ALLOWED;
@@ -360,7 +361,8 @@
*
* @param allowedCarriers list of allowed carriers
*/
- public Builder setAllowedCarriers(List<CarrierIdentifier> allowedCarriers) {
+ public @NonNull Builder setAllowedCarriers(
+ @NonNull List<CarrierIdentifier> allowedCarriers) {
mRules.mAllowedCarriers = new ArrayList<CarrierIdentifier>(allowedCarriers);
return this;
}
@@ -370,7 +372,8 @@
*
* @param excludedCarriers list of excluded carriers
*/
- public Builder setExcludedCarriers(List<CarrierIdentifier> excludedCarriers) {
+ public @NonNull Builder setExcludedCarriers(
+ @NonNull List<CarrierIdentifier> excludedCarriers) {
mRules.mExcludedCarriers = new ArrayList<CarrierIdentifier>(excludedCarriers);
return this;
}
@@ -380,7 +383,7 @@
*
* @param carrierRestrictionDefault prioritized carrier list
*/
- public Builder setDefaultCarrierRestriction(
+ public @NonNull Builder setDefaultCarrierRestriction(
@CarrierRestrictionDefault int carrierRestrictionDefault) {
mRules.mCarrierRestrictionDefault = carrierRestrictionDefault;
return this;
@@ -391,7 +394,7 @@
*
* @param multiSimPolicy multi SIM policy
*/
- public Builder setMultiSimPolicy(@MultiSimPolicy int multiSimPolicy) {
+ public @NonNull Builder setMultiSimPolicy(@MultiSimPolicy int multiSimPolicy) {
mRules.mMultiSimPolicy = multiSimPolicy;
return this;
}
diff --git a/telephony/java/android/telephony/CellIdentityNr.java b/telephony/java/android/telephony/CellIdentityNr.java
index 856f081..b94ca9b 100644
--- a/telephony/java/android/telephony/CellIdentityNr.java
+++ b/telephony/java/android/telephony/CellIdentityNr.java
@@ -81,18 +81,22 @@
/**
* Get the NR Cell Identity.
*
- * @return The NR Cell Identity in range [0, 68719476735] or Long.MAX_VALUE if unknown.
+ * @return The 36-bit NR Cell Identity in range [0, 68719476735] or
+ * {@link CellInfo#UNAVAILABLE_LONG} if unknown.
*/
public long getNci() {
return mNci;
}
/**
- * Get the Absolute Radio Frequency Channel Number.
+ * Get the New Radio Absolute Radio Frequency Channel Number.
+ *
+ * Reference: 3GPP TS 38.101-1 section 5.4.2.1 NR-ARFCN and channel raster.
+ * Reference: 3GPP TS 38.101-2 section 5.4.2.1 NR-ARFCN and channel raster.
+ *
* @return Integer value in range [0, 3279165] or {@link CellInfo#UNAVAILABLE} if unknown.
*/
- @Override
- public int getChannelNumber() {
+ public int getNrarfcn() {
return mNrArfcn;
}
diff --git a/telephony/java/android/telephony/CellInfo.java b/telephony/java/android/telephony/CellInfo.java
index 78ccede..cdaf6ed 100644
--- a/telephony/java/android/telephony/CellInfo.java
+++ b/telephony/java/android/telephony/CellInfo.java
@@ -39,6 +39,11 @@
public static final int UNAVAILABLE = Integer.MAX_VALUE;
/**
+ * This value indicates that the long field is unreported.
+ */
+ public static final long UNAVAILABLE_LONG = Long.MAX_VALUE;
+
+ /**
* Cell identity type
* @hide
*/
diff --git a/telephony/java/android/telephony/LocationAccessPolicy.java b/telephony/java/android/telephony/LocationAccessPolicy.java
index d98f37d..b9d8eb6 100644
--- a/telephony/java/android/telephony/LocationAccessPolicy.java
+++ b/telephony/java/android/telephony/LocationAccessPolicy.java
@@ -174,22 +174,22 @@
boolean hasManifestPermission = checkManifestPermission(context, query.callingPid,
query.callingUid, permissionToCheck);
- int appOpMode = context.getSystemService(AppOpsManager.class)
- .noteOpNoThrow(AppOpsManager.permissionToOpCode(permissionToCheck),
- query.callingUid, query.callingPackage);
-
- if (hasManifestPermission && appOpMode == AppOpsManager.MODE_ALLOWED) {
- // If the app did everything right, return without logging.
- return LocationPermissionResult.ALLOWED;
- }
-
- // If the app has the manifest permission but not the app-op permission, it means that
- // it's aware of the requirement and the user denied permission explicitly. If we see
- // this, don't let any of the overrides happen.
if (hasManifestPermission) {
- Log.i(TAG, query.callingPackage + " is aware of " + locationTypeForLog + " but the"
- + " app-ops permission is specifically denied.");
- return appOpsModeToPermissionResult(appOpMode);
+ // Only check the app op if the app has the permission.
+ int appOpMode = context.getSystemService(AppOpsManager.class)
+ .noteOpNoThrow(AppOpsManager.permissionToOpCode(permissionToCheck),
+ query.callingUid, query.callingPackage);
+ if (appOpMode == AppOpsManager.MODE_ALLOWED) {
+ // If the app did everything right, return without logging.
+ return LocationPermissionResult.ALLOWED;
+ } else {
+ // If the app has the manifest permission but not the app-op permission, it means
+ // that it's aware of the requirement and the user denied permission explicitly.
+ // If we see this, don't let any of the overrides happen.
+ Log.i(TAG, query.callingPackage + " is aware of " + locationTypeForLog + " but the"
+ + " app-ops permission is specifically denied.");
+ return appOpsModeToPermissionResult(appOpMode);
+ }
}
int minSdkVersion = Manifest.permission.ACCESS_FINE_LOCATION.equals(permissionToCheck)
diff --git a/telephony/java/android/telephony/MbmsGroupCallSession.java b/telephony/java/android/telephony/MbmsGroupCallSession.java
index 269cda1..f1be31f 100644
--- a/telephony/java/android/telephony/MbmsGroupCallSession.java
+++ b/telephony/java/android/telephony/MbmsGroupCallSession.java
@@ -141,7 +141,7 @@
* Create a new {@link MbmsGroupCallSession} using the system default data subscription ID.
* See {@link #create(Context, int, Executor, MbmsGroupCallSessionCallback)}.
*/
- public static MbmsGroupCallSession create(@NonNull Context context,
+ public static @Nullable MbmsGroupCallSession create(@NonNull Context context,
@NonNull Executor executor, @NonNull MbmsGroupCallSessionCallback callback) {
return create(context, SubscriptionManager.getDefaultSubscriptionId(), executor, callback);
}
diff --git a/telephony/java/android/telephony/NetworkRegistrationState.java b/telephony/java/android/telephony/NetworkRegistrationState.java
index 84d6628..4d97f81 100644
--- a/telephony/java/android/telephony/NetworkRegistrationState.java
+++ b/telephony/java/android/telephony/NetworkRegistrationState.java
@@ -17,11 +17,13 @@
package android.telephony;
import android.annotation.IntDef;
+import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.SystemApi;
import android.os.Parcel;
import android.os.Parcelable;
import android.telephony.AccessNetworkConstants.TransportType;
+import android.telephony.TelephonyManager.NetworkType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@@ -140,6 +142,7 @@
@ServiceState.RoamingType
private int mRoamingType;
+ @NetworkType
private int mAccessNetworkTechnology;
@NRStatus
@@ -149,6 +152,7 @@
private final boolean mEmergencyOnly;
+ @ServiceType
private final int[] mAvailableServices;
@Nullable
@@ -167,9 +171,8 @@
* @param regState Network registration state. Must be one of the {@link RegState}. For
* {@link TransportType#WLAN} transport, only {@link #REG_STATE_HOME} and
* {@link #REG_STATE_NOT_REG_NOT_SEARCHING} are valid states.
- * @param accessNetworkTechnology Access network technology. Must be one of TelephonyManager
- * NETWORK_TYPE_XXXX. For {@link TransportType#WLAN} transport, set to
- * {@link TelephonyManager#NETWORK_TYPE_IWLAN}.
+ * @param accessNetworkTechnology Access network technology.For {@link TransportType#WLAN}
+ * transport, set to {@link TelephonyManager#NETWORK_TYPE_IWLAN}.
* @param rejectCause Reason for denial if the registration state is {@link #REG_STATE_DENIED}.
* Depending on {@code accessNetworkTechnology}, the values are defined in 3GPP TS 24.008
* 10.5.3.6 for UMTS, 3GPP TS 24.301 9.9.3.9 for LTE, and 3GPP2 A.S0001 6.2.2.44 for CDMA. If
@@ -182,8 +185,9 @@
* information is not available.
*/
public NetworkRegistrationState(@Domain int domain, int transportType, @RegState int regState,
- int accessNetworkTechnology, int rejectCause,
- boolean emergencyOnly, int[] availableServices,
+ @NetworkType int accessNetworkTechnology, int rejectCause,
+ boolean emergencyOnly,
+ @NonNull @ServiceType int[] availableServices,
@Nullable CellIdentity cellIdentity) {
mDomain = domain;
mTransportType = transportType;
@@ -230,7 +234,7 @@
updateNrStatus(mDataSpecificStates);
}
- protected NetworkRegistrationState(Parcel source) {
+ private NetworkRegistrationState(Parcel source) {
mDomain = source.readInt();
mTransportType = source.readInt();
mRegState = source.readInt();
@@ -285,6 +289,14 @@
}
/**
+ * @hide
+ * @return {@code true} if in service.
+ */
+ public boolean isInService() {
+ return mRegState == REG_STATE_HOME || mRegState == REG_STATE_ROAMING;
+ }
+
+ /**
* Set {@link ServiceState.RoamingType roaming type}. This could override
* roaming type based on resource overlay or carrier config.
* @hide
@@ -309,25 +321,29 @@
/**
* @return List of available service types.
*/
+ @NonNull
+ @ServiceType
public int[] getAvailableServices() { return mAvailableServices; }
/**
- * @return The access network technology {@link TelephonyManager.NetworkType}.
+ * @return The access network technology {@link NetworkType}.
*/
- public @TelephonyManager.NetworkType int getAccessNetworkTechnology() {
+ public @NetworkType int getAccessNetworkTechnology() {
return mAccessNetworkTechnology;
}
/**
- * override the access network technology {@link TelephonyManager.NetworkType} e.g, rat ratchet.
+ * override the access network technology {@link NetworkType} e.g, rat ratchet.
* @hide
*/
- public void setAccessNetworkTechnology(@TelephonyManager.NetworkType int tech) {
+ public void setAccessNetworkTechnology(@NetworkType int tech) {
mAccessNetworkTechnology = tech;
}
/**
- * @return Network reject cause
+ * @return Reason for denial if the registration state is {@link #REG_STATE_DENIED}.
+ * Depending on {@code accessNetworkTechnology}, the values are defined in 3GPP TS 24.008
+ * 10.5.3.6 for UMTS, 3GPP TS 24.301 9.9.3.9 for LTE, and 3GPP2 A.S0001 6.2.2.44 for CDMA
*/
public int getRejectCause() {
return mRejectCause;
@@ -336,6 +352,7 @@
/**
* @return The cell information.
*/
+ @Nullable
public CellIdentity getCellIdentity() {
return mCellIdentity;
}
@@ -539,4 +556,192 @@
p.recycle();
return result;
}
+
+ /**
+ * Provides a convenient way to set the fields of a {@link NetworkRegistrationState} when
+ * creating a new instance.
+ *
+ * <p>The example below shows how you might create a new {@code NetworkRegistrationState}:
+ *
+ * <pre><code>
+ *
+ * NetworkRegistrationState nrs = new NetworkRegistrationState.Builder()
+ * .setApnTypeBitmask(ApnSetting.TYPE_DEFAULT | ApnSetting.TYPE_MMS)
+ * .setApnName("apn.example.com")
+ * .setEntryName("Example Carrier APN")
+ * .setMmsc(Uri.parse("http://mms.example.com:8002"))
+ * .setMmsProxyAddress(mmsProxy)
+ * .setMmsProxyPort(8799)
+ * .build();
+ * </code></pre>
+ */
+ public static class Builder{
+ @Domain
+ private int mDomain;
+
+ private int mTransportType;
+
+ @RegState
+ private int mRegState;
+
+ @ServiceState.RoamingType
+ private int mRoamingType;
+
+ @NetworkType
+ private int mAccessNetworkTechnology;
+
+ @NRStatus
+ private int mNrStatus;
+
+ private int mRejectCause;
+
+ private boolean mEmergencyOnly;
+
+ @ServiceType
+ private int[] mAvailableServices;
+
+ @Nullable
+ private CellIdentity mCellIdentity;
+
+ /**
+ * Default constructor for Builder.
+ */
+ public Builder() {}
+
+ /**
+ * Set the network domain.
+ *
+ * @param domain Network domain.
+ *
+ * @return The same instance of the builder.
+ */
+ public @NonNull Builder setDomain(@Domain int domain) {
+ mDomain = domain;
+ return this;
+ }
+
+ /**
+ * Set the transport type.
+ *
+ * @param transportType Transport type.
+ *
+ * @return The same instance of the builder.
+ */
+ public @NonNull Builder setTransportType(int transportType) {
+ mTransportType = transportType;
+ return this;
+ }
+
+ /**
+ * Set the registration state.
+ *
+ * @param regState The registration state.
+ *
+ * @return The same instance of the builder.
+ */
+ public @NonNull Builder setRegState(@RegState int regState) {
+ mRegState = regState;
+ return this;
+ }
+
+ /**
+ * Set the roaming type.
+ *
+ * @param roamingType Roaming type.
+ *
+ * @return The same instance of the builder.
+ */
+ public @NonNull Builder setRoamingType(@ServiceState.RoamingType int roamingType) {
+ mRoamingType = roamingType;
+ return this;
+ }
+
+ /**
+ * Set tne access network technology.
+ *
+ * @return The same instance of the builder.
+ *
+ * @param accessNetworkTechnology The access network technology
+ */
+ public @NonNull Builder setAccessNetworkTechnology(
+ @NetworkType int accessNetworkTechnology) {
+ mAccessNetworkTechnology = accessNetworkTechnology;
+ return this;
+ }
+
+ /**
+ * Set the 5G NR connection status.
+ *
+ * @param nrStatus 5G NR connection status.
+ *
+ * @return The same instance of the builder.
+ */
+ public @NonNull Builder setNrStatus(@NRStatus int nrStatus) {
+ mNrStatus = nrStatus;
+ return this;
+ }
+
+ /**
+ * Set the network reject cause.
+ *
+ * @param rejectCause Reason for denial if the registration state is
+ * {@link #REG_STATE_DENIED}.Depending on {@code accessNetworkTechnology}, the values are
+ * defined in 3GPP TS 24.008 10.5.3.6 for UMTS, 3GPP TS 24.301 9.9.3.9 for LTE, and 3GPP2
+ * A.S0001 6.2.2.44 for CDMA. If the reject cause is not supported or unknown, set it to 0.
+ *
+ * @return The same instance of the builder.
+ */
+ public @NonNull Builder setRejectCause(int rejectCause) {
+ mRejectCause = rejectCause;
+ return this;
+ }
+
+ /**
+ * Set emergency only.
+ *
+ * @param emergencyOnly True if this network registration is for emergency use only.
+ *
+ * @return The same instance of the builder.
+ */
+ public @NonNull Builder setEmergencyOnly(boolean emergencyOnly) {
+ mEmergencyOnly = emergencyOnly;
+ return this;
+ }
+
+ /**
+ * Set the available services.
+ *
+ * @param availableServices Available services.
+ *
+ * @return The same instance of the builder.
+ */
+ public @NonNull Builder setAvailableServices(
+ @NonNull @ServiceType int[] availableServices) {
+ mAvailableServices = availableServices;
+ return this;
+ }
+
+ /**
+ * Set the cell identity.
+ *
+ * @param cellIdentity The cell identity.
+ *
+ * @return The same instance of the builder.
+ */
+ public @NonNull Builder setCellIdentity(@Nullable CellIdentity cellIdentity) {
+ mCellIdentity = cellIdentity;
+ return this;
+ }
+
+ /**
+ * Build the NetworkRegistrationState.
+ *
+ * @return the NetworkRegistrationState object.
+ */
+ public @NonNull NetworkRegistrationState build() {
+ return new NetworkRegistrationState(mDomain, mTransportType, mRegState,
+ mAccessNetworkTechnology, mRejectCause, mEmergencyOnly, mAvailableServices,
+ mCellIdentity);
+ }
+ }
}
diff --git a/telephony/java/android/telephony/NetworkService.java b/telephony/java/android/telephony/NetworkService.java
index 6c45cc4..f1240e9 100644
--- a/telephony/java/android/telephony/NetworkService.java
+++ b/telephony/java/android/telephony/NetworkService.java
@@ -17,6 +17,7 @@
package android.telephony;
import android.annotation.NonNull;
+import android.annotation.Nullable;
import android.annotation.SystemApi;
import android.app.Service;
import android.content.Intent;
@@ -26,6 +27,7 @@
import android.os.Looper;
import android.os.Message;
import android.os.RemoteException;
+import android.telephony.NetworkRegistrationState.Domain;
import android.util.SparseArray;
import com.android.internal.annotations.VisibleForTesting;
@@ -81,36 +83,43 @@
* service is associated with one physical SIM slot.
*/
public abstract class NetworkServiceProvider implements AutoCloseable {
- private final int mSlotId;
+ private final int mSlotIndex;
private final List<INetworkServiceCallback>
mNetworkRegistrationStateChangedCallbacks = new ArrayList<>();
- public NetworkServiceProvider(int slotId) {
- mSlotId = slotId;
+ /**
+ * Constructor
+ * @param slotIndex SIM slot id the data service provider associated with.
+ */
+ public NetworkServiceProvider(int slotIndex) {
+ mSlotIndex = slotIndex;
}
/**
- * @return SIM slot id the network service associated with.
+ * @return SIM slot index the network service associated with.
*/
- public final int getSlotId() {
- return mSlotId;
+ public final int getSlotIndex() {
+ return mSlotIndex;
}
/**
* API to get network registration state. The result will be passed to the callback.
- * @param domain
- * @param callback
- * @return SIM slot id the network service associated with.
+ * @param domain Network domain
+ * @param callback The callback for reporting network registration state
*/
- public void getNetworkRegistrationState(int domain, NetworkServiceCallback callback) {
+ public void getNetworkRegistrationState(@Domain int domain,
+ @NonNull NetworkServiceCallback callback) {
callback.onGetNetworkRegistrationStateComplete(
NetworkServiceCallback.RESULT_ERROR_UNSUPPORTED, null);
}
+ /**
+ * Notify the system that network registration state is changed.
+ */
public final void notifyNetworkRegistrationStateChanged() {
mHandler.obtainMessage(NETWORK_SERVICE_INDICATION_NETWORK_STATE_CHANGED,
- mSlotId, 0, null).sendToTarget();
+ mSlotIndex, 0, null).sendToTarget();
}
private void registerForStateChanged(@NonNull INetworkServiceCallback callback) {
@@ -152,23 +161,23 @@
@Override
public void handleMessage(Message message) {
- final int slotId = message.arg1;
+ final int slotIndex = message.arg1;
final INetworkServiceCallback callback = (INetworkServiceCallback) message.obj;
- NetworkServiceProvider serviceProvider = mServiceMap.get(slotId);
+ NetworkServiceProvider serviceProvider = mServiceMap.get(slotIndex);
switch (message.what) {
case NETWORK_SERVICE_CREATE_NETWORK_SERVICE_PROVIDER:
// If the service provider doesn't exist yet, we try to create it.
if (serviceProvider == null) {
- mServiceMap.put(slotId, createNetworkServiceProvider(slotId));
+ mServiceMap.put(slotIndex, onCreateNetworkServiceProvider(slotIndex));
}
break;
case NETWORK_SERVICE_REMOVE_NETWORK_SERVICE_PROVIDER:
// If the service provider doesn't exist yet, we try to create it.
if (serviceProvider != null) {
serviceProvider.close();
- mServiceMap.remove(slotId);
+ mServiceMap.remove(slotIndex);
}
break;
case NETWORK_SERVICE_REMOVE_ALL_NETWORK_SERVICE_PROVIDERS:
@@ -221,12 +230,12 @@
* this method to facilitate the creation of {@link NetworkServiceProvider} instances. The system
* will call this method after binding the network service for each active SIM slot id.
*
- * @param slotId SIM slot id the network service associated with.
+ * @param slotIndex SIM slot id the network service associated with.
* @return Network service object
*/
- protected abstract NetworkServiceProvider createNetworkServiceProvider(int slotId);
+ @Nullable
+ public abstract NetworkServiceProvider onCreateNetworkServiceProvider(int slotIndex);
- /** @hide */
@Override
public IBinder onBind(Intent intent) {
if (intent == null || !NETWORK_SERVICE_INTERFACE.equals(intent.getAction())) {
@@ -237,7 +246,6 @@
return mBinder;
}
- /** @hide */
@Override
public boolean onUnbind(Intent intent) {
mHandler.obtainMessage(NETWORK_SERVICE_REMOVE_ALL_NETWORK_SERVICE_PROVIDERS, 0,
@@ -250,6 +258,7 @@
@Override
public void onDestroy() {
mHandlerThread.quit();
+ super.onDestroy();
}
/**
@@ -259,35 +268,35 @@
private class INetworkServiceWrapper extends INetworkService.Stub {
@Override
- public void createNetworkServiceProvider(int slotId) {
- mHandler.obtainMessage(NETWORK_SERVICE_CREATE_NETWORK_SERVICE_PROVIDER, slotId,
+ public void createNetworkServiceProvider(int slotIndex) {
+ mHandler.obtainMessage(NETWORK_SERVICE_CREATE_NETWORK_SERVICE_PROVIDER, slotIndex,
0, null).sendToTarget();
}
@Override
- public void removeNetworkServiceProvider(int slotId) {
- mHandler.obtainMessage(NETWORK_SERVICE_REMOVE_NETWORK_SERVICE_PROVIDER, slotId,
+ public void removeNetworkServiceProvider(int slotIndex) {
+ mHandler.obtainMessage(NETWORK_SERVICE_REMOVE_NETWORK_SERVICE_PROVIDER, slotIndex,
0, null).sendToTarget();
}
@Override
public void getNetworkRegistrationState(
- int slotId, int domain, INetworkServiceCallback callback) {
- mHandler.obtainMessage(NETWORK_SERVICE_GET_REGISTRATION_STATE, slotId,
+ int slotIndex, int domain, INetworkServiceCallback callback) {
+ mHandler.obtainMessage(NETWORK_SERVICE_GET_REGISTRATION_STATE, slotIndex,
domain, callback).sendToTarget();
}
@Override
public void registerForNetworkRegistrationStateChanged(
- int slotId, INetworkServiceCallback callback) {
- mHandler.obtainMessage(NETWORK_SERVICE_REGISTER_FOR_STATE_CHANGE, slotId,
+ int slotIndex, INetworkServiceCallback callback) {
+ mHandler.obtainMessage(NETWORK_SERVICE_REGISTER_FOR_STATE_CHANGE, slotIndex,
0, callback).sendToTarget();
}
@Override
public void unregisterForNetworkRegistrationStateChanged(
- int slotId,INetworkServiceCallback callback) {
- mHandler.obtainMessage(NETWORK_SERVICE_UNREGISTER_FOR_STATE_CHANGE, slotId,
+ int slotIndex, INetworkServiceCallback callback) {
+ mHandler.obtainMessage(NETWORK_SERVICE_UNREGISTER_FOR_STATE_CHANGE, slotIndex,
0, callback).sendToTarget();
}
}
diff --git a/telephony/java/android/telephony/NetworkServiceCallback.java b/telephony/java/android/telephony/NetworkServiceCallback.java
index dbad02f..c2fcfb7 100644
--- a/telephony/java/android/telephony/NetworkServiceCallback.java
+++ b/telephony/java/android/telephony/NetworkServiceCallback.java
@@ -17,6 +17,7 @@
package android.telephony;
import android.annotation.IntDef;
+import android.annotation.Nullable;
import android.annotation.SystemApi;
import android.os.RemoteException;
import android.telephony.NetworkService.NetworkServiceProvider;
@@ -75,7 +76,8 @@
* {@link NetworkServiceCallback#RESULT_ERROR_UNSUPPORTED}
* @param state The state information to be returned to callback.
*/
- public void onGetNetworkRegistrationStateComplete(int result, NetworkRegistrationState state) {
+ public void onGetNetworkRegistrationStateComplete(int result,
+ @Nullable NetworkRegistrationState state) {
INetworkServiceCallback callback = mCallback.get();
if (callback != null) {
try {
diff --git a/telephony/java/android/telephony/PhoneNumberRange.java b/telephony/java/android/telephony/PhoneNumberRange.java
index dba803b..12df9b5 100644
--- a/telephony/java/android/telephony/PhoneNumberRange.java
+++ b/telephony/java/android/telephony/PhoneNumberRange.java
@@ -149,7 +149,7 @@
* @param number A phone number, with or without separators or a country code.
* @return {@code true} if the number matches, {@code false} otherwise.
*/
- public boolean matches(String number) {
+ public boolean matches(@NonNull String number) {
// Check the prefix, make sure it matches either with or without the country code.
String normalizedNumber = number.replaceAll("[^0-9]", "");
String prefixWithCountryCode = mCountryCode + mPrefix;
diff --git a/telephony/java/android/telephony/PhoneStateListener.java b/telephony/java/android/telephony/PhoneStateListener.java
index da92730..5fd36f4 100644
--- a/telephony/java/android/telephony/PhoneStateListener.java
+++ b/telephony/java/android/telephony/PhoneStateListener.java
@@ -292,14 +292,17 @@
public static final int LISTEN_PHONE_CAPABILITY_CHANGE = 0x00200000;
/**
- * Listen for changes to preferred data subId.
- * See {@link SubscriptionManager#setPreferredDataSubId(int)}
- * for more details.
+ * Listen for changes to active data subId. Active data subscription
+ * is whichever is being used for Internet data. For most of the case, it's
+ * default data subscription but it could be others. For example, when data is
+ * switched to opportunistic subscription, that becomes the active data sub.
*
- * @see #onPreferredDataSubIdChanged
+ * Requires Permission: {@link android.Manifest.permission#READ_PHONE_STATE
+ * READ_PHONE_STATE}
+ * @see #onActiveDataSubIdChanged
* @hide
*/
- public static final int LISTEN_PREFERRED_DATA_SUBID_CHANGE = 0x00400000;
+ public static final int LISTEN_ACTIVE_DATA_SUBID_CHANGE = 0x00400000;
/**
* Listen for changes to the radio power state.
@@ -606,7 +609,7 @@
@RequiresPermission((android.Manifest.permission.READ_PRECISE_PHONE_STATE))
@SystemApi
public void onPreciseDataConnectionStateChanged(
- PreciseDataConnectionState dataConnectionState) {
+ @NonNull PreciseDataConnectionState dataConnectionState) {
// default implementation empty
}
@@ -704,14 +707,14 @@
}
/**
- * Callback invoked when preferred data subId changes. Requires
- * the READ_PRIVILEGED_PHONE_STATE permission.
- * @param subId the new preferred data subId. If it's INVALID_SUBSCRIPTION_ID,
- * it means it's unset and defaultDataSub is used to determine which
- * modem is preferred.
+ * Callback invoked when active data subId changes. Requires
+ * the READ_PHONE_STATE permission.
+ * @param subId current data subId used for Internet data. It will be default data subscription
+ * most cases. And it could be other subscriptions for example opportunistic
+ * subscription if data is switched onto it.
* @hide
*/
- public void onPreferredDataSubIdChanged(int subId) {
+ public void onActiveDataSubIdChanged(int subId) {
// default implementation empty
}
@@ -995,12 +998,12 @@
() -> mExecutor.execute(() -> psl.onCallAttributesChanged(callAttributes)));
}
- public void onPreferredDataSubIdChanged(int subId) {
+ public void onActiveDataSubIdChanged(int subId) {
PhoneStateListener psl = mPhoneStateListenerWeakRef.get();
if (psl == null) return;
Binder.withCleanCallingIdentity(
- () -> mExecutor.execute(() -> psl.onPreferredDataSubIdChanged(subId)));
+ () -> mExecutor.execute(() -> psl.onActiveDataSubIdChanged(subId)));
}
public void onImsCallDisconnectCauseChanged(ImsReasonInfo disconnectCause) {
diff --git a/telephony/java/android/telephony/PreciseDataConnectionState.java b/telephony/java/android/telephony/PreciseDataConnectionState.java
index 57a1826..d593678 100644
--- a/telephony/java/android/telephony/PreciseDataConnectionState.java
+++ b/telephony/java/android/telephony/PreciseDataConnectionState.java
@@ -16,6 +16,8 @@
package android.telephony;
+import android.annotation.NonNull;
+import android.annotation.Nullable;
import android.annotation.SystemApi;
import android.annotation.UnsupportedAppUsage;
import android.net.LinkProperties;
@@ -25,6 +27,7 @@
import java.util.Objects;
+
/**
* Contains precise data connection state.
*
@@ -119,6 +122,7 @@
/**
* Returns APN {@link ApnSetting} of this data connection.
*/
+ @Nullable
public String getDataConnectionApn() {
return mAPN;
}
diff --git a/telephony/java/android/telephony/RadioAccessFamily.java b/telephony/java/android/telephony/RadioAccessFamily.java
index c1786be..eb889c6 100644
--- a/telephony/java/android/telephony/RadioAccessFamily.java
+++ b/telephony/java/android/telephony/RadioAccessFamily.java
@@ -22,6 +22,7 @@
import android.os.Build;
import android.os.Parcel;
import android.os.Parcelable;
+import android.telephony.TelephonyManager.PrefNetworkMode;
import com.android.internal.telephony.RILConstants;
@@ -170,7 +171,8 @@
};
@UnsupportedAppUsage
- public static int getRafFromNetworkType(int type) {
+ @TelephonyManager.NetworkTypeBitMask
+ public static int getRafFromNetworkType(@PrefNetworkMode int type) {
switch (type) {
case RILConstants.NETWORK_MODE_WCDMA_PREF:
return GSM | WCDMA;
@@ -279,6 +281,7 @@
}
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
+ @PrefNetworkMode
public static int getNetworkTypeFromRaf(int raf) {
raf = getAdjustedRaf(raf);
diff --git a/telephony/java/android/telephony/ServiceState.java b/telephony/java/android/telephony/ServiceState.java
index 3dc1199..6118129 100644
--- a/telephony/java/android/telephony/ServiceState.java
+++ b/telephony/java/android/telephony/ServiceState.java
@@ -17,6 +17,8 @@
package android.telephony;
import android.annotation.IntDef;
+import android.annotation.NonNull;
+import android.annotation.Nullable;
import android.annotation.SystemApi;
import android.annotation.TestApi;
import android.annotation.UnsupportedAppUsage;
@@ -436,7 +438,11 @@
/**
* Construct a ServiceState object from the given parcel.
+ *
+ * @deprecated The constructor takes parcel should not be public at the beginning. Use
+ * {@link #ServiceState()} instead.
*/
+ @Deprecated
public ServiceState(Parcel in) {
mVoiceRegState = in.readInt();
mDataRegState = in.readInt();
@@ -1760,6 +1766,7 @@
* @return List of {@link NetworkRegistrationState}
* @hide
*/
+ @NonNull
@SystemApi
public List<NetworkRegistrationState> getNetworkRegistrationStates() {
synchronized (mNetworkRegistrationStates) {
@@ -1776,6 +1783,7 @@
*
* @deprecated Use {@link #getNetworkRegistrationStatesFromTransportType(int)}
*/
+ @NonNull
@Deprecated
@SystemApi
public List<NetworkRegistrationState> getNetworkRegistrationStates(int transportType) {
@@ -1789,6 +1797,7 @@
* @return List of {@link NetworkRegistrationState}
* @hide
*/
+ @NonNull
@SystemApi
public List<NetworkRegistrationState> getNetworkRegistrationStatesForTransportType(
int transportType) {
@@ -1812,6 +1821,7 @@
* @return List of {@link NetworkRegistrationState}
* @hide
*/
+ @NonNull
@SystemApi
public List<NetworkRegistrationState> getNetworkRegistrationStatesForDomain(
@Domain int domain) {
@@ -1838,6 +1848,7 @@
*
* @deprecated Use {@link #getNetworkRegistrationState(int, int)}
*/
+ @Nullable
@Deprecated
@SystemApi
public NetworkRegistrationState getNetworkRegistrationStates(@Domain int domain,
@@ -1854,6 +1865,7 @@
* @hide
*
*/
+ @Nullable
@SystemApi
public NetworkRegistrationState getNetworkRegistrationState(@Domain int domain,
int transportType) {
diff --git a/telephony/java/android/telephony/SignalStrength.java b/telephony/java/android/telephony/SignalStrength.java
index d461bd0..cab2374 100644
--- a/telephony/java/android/telephony/SignalStrength.java
+++ b/telephony/java/android/telephony/SignalStrength.java
@@ -214,7 +214,7 @@
* @see android.telephony#CellSignalStrengthCdma
* @see android.telephony#CellSignalStrengthGsm
*/
- public @NonNull List<CellSignalStrength> getCellSignalStrengths() {
+ @NonNull public List<CellSignalStrength> getCellSignalStrengths() {
return getCellSignalStrengths(CellSignalStrength.class);
}
@@ -240,7 +240,7 @@
* @see android.telephony#CellSignalStrengthCdma
* @see android.telephony#CellSignalStrengthGsm
*/
- public <T extends CellSignalStrength> @NonNull List<T> getCellSignalStrengths(
+ @NonNull public <T extends CellSignalStrength> List<T> getCellSignalStrengths(
@NonNull Class<T> clazz) {
List<T> cssList = new ArrayList<>(2); // Usually have 2 or fewer elems
if (mLte.isValid() && clazz.isAssignableFrom(CellSignalStrengthLte.class)) {
diff --git a/telephony/java/android/telephony/SmsManager.java b/telephony/java/android/telephony/SmsManager.java
index d777bf1..c39f1f5 100644
--- a/telephony/java/android/telephony/SmsManager.java
+++ b/telephony/java/android/telephony/SmsManager.java
@@ -316,6 +316,7 @@
* <code>RESULT_ERROR_GENERIC_FAILURE</code><br>
* <code>RESULT_ERROR_RADIO_OFF</code><br>
* <code>RESULT_ERROR_NULL_PDU</code><br>
+ * <code>RESULT_ERROR_NO_SERVICE</code><br>
* For <code>RESULT_ERROR_GENERIC_FAILURE</code> the sentIntent may include
* the extra "errorCode" containing a radio technology specific value,
* generally only useful for troubleshooting.<br>
@@ -365,19 +366,12 @@
if (DBG) {
Log.d(TAG, "for subId: " + subId + ", subscription-info: " + info);
}
- if (info == null) {
- // There is no subscription for the given subId. That can only mean one thing:
- // the caller is using a SmsManager instance with an obsolete subscription id.
- // That is most probably because caller didn't invalidate SmsManager instance
- // for an already deleted subscription id.
- Log.e(TAG, "subId: " + subId + " for this SmsManager instance is obsolete.");
- sendErrorInPendingIntent(sentIntent, SmsManager.RESULT_ERROR_NO_SERVICE);
- }
/* If the Subscription associated with this SmsManager instance belongs to a remote-sim,
* then send the message thru the remote-sim subscription.
*/
- if (info.getSubscriptionType() == SubscriptionManager.SUBSCRIPTION_TYPE_REMOTE_SIM) {
+ if (info != null
+ && info.getSubscriptionType() == SubscriptionManager.SUBSCRIPTION_TYPE_REMOTE_SIM) {
if (DBG) Log.d(TAG, "sending message thru bluetooth");
sendTextMessageBluetooth(destinationAddress, scAddress, text, sentIntent,
deliveryIntent, info);
@@ -385,8 +379,10 @@
}
try {
+ // If the subscription is invalid or default, we will use the default phone to send the
+ // SMS and possibly fail later in the SMS sending process.
ISms iccISms = getISmsServiceOrThrow();
- iccISms.sendTextForSubscriber(getSubscriptionId(), ActivityThread.currentPackageName(),
+ iccISms.sendTextForSubscriber(subId, ActivityThread.currentPackageName(),
destinationAddress,
scAddress, text, sentIntent, deliveryIntent,
persistMessage);
@@ -459,6 +455,9 @@
}
private void sendErrorInPendingIntent(PendingIntent intent, int errorCode) {
+ if (intent == null) {
+ return;
+ }
try {
intent.send(errorCode);
} catch (PendingIntent.CanceledException e) {
diff --git a/telephony/java/android/telephony/SubscriptionInfo.java b/telephony/java/android/telephony/SubscriptionInfo.java
index 443f908..58f12e2 100644
--- a/telephony/java/android/telephony/SubscriptionInfo.java
+++ b/telephony/java/android/telephony/SubscriptionInfo.java
@@ -425,14 +425,14 @@
/**
* @return The MCC, as a string.
*/
- public String getMccString() {
+ public @Nullable String getMccString() {
return this.mMcc;
}
/**
* @return The MNC, as a string.
*/
- public String getMncString() {
+ public @Nullable String getMncString() {
return this.mMnc;
}
diff --git a/telephony/java/android/telephony/SubscriptionManager.java b/telephony/java/android/telephony/SubscriptionManager.java
index 52cab55..17a4fd8 100644
--- a/telephony/java/android/telephony/SubscriptionManager.java
+++ b/telephony/java/android/telephony/SubscriptionManager.java
@@ -59,6 +59,7 @@
import android.util.Log;
import com.android.internal.telephony.IOnSubscriptionsChangedListener;
+import com.android.internal.telephony.ISetOpportunisticDataCallback;
import com.android.internal.telephony.ISub;
import com.android.internal.telephony.ITelephonyRegistry;
import com.android.internal.telephony.PhoneConstants;
@@ -72,6 +73,7 @@
import java.util.Locale;
import java.util.concurrent.Executor;
import java.util.concurrent.TimeUnit;
+import java.util.function.Consumer;
import java.util.stream.Collectors;
/**
@@ -149,6 +151,7 @@
* {@link Uri#withAppendedPath(Uri, String)}.
* @hide
*/
+ @NonNull
@SystemApi
public static final Uri WFC_ENABLED_CONTENT_URI = Uri.withAppendedPath(CONTENT_URI, "wfc");
@@ -167,6 +170,7 @@
* {@link Uri#withAppendedPath(Uri, String)}.
* @hide
*/
+ @NonNull
@SystemApi
public static final Uri ADVANCED_CALLING_ENABLED_CONTENT_URI = Uri.withAppendedPath(
CONTENT_URI, "advanced_calling");
@@ -184,6 +188,7 @@
* {@link Uri#withAppendedPath(Uri, String)}.
* @hide
*/
+ @NonNull
@SystemApi
public static final Uri WFC_MODE_CONTENT_URI = Uri.withAppendedPath(CONTENT_URI, "wfc_mode");
@@ -200,6 +205,7 @@
* {@link Uri#withAppendedPath(Uri, String)}.
* @hide
*/
+ @NonNull
@SystemApi
public static final Uri WFC_ROAMING_MODE_CONTENT_URI = Uri.withAppendedPath(
CONTENT_URI, "wfc_roaming_mode");
@@ -218,6 +224,7 @@
* {@link Uri#withAppendedPath(Uri, String)}.
* @hide
*/
+ @NonNull
@SystemApi
public static final Uri VT_ENABLED_CONTENT_URI = Uri.withAppendedPath(
CONTENT_URI, "vt_enabled");
@@ -235,6 +242,7 @@
* {@link Uri#withAppendedPath(Uri, String)}.
* @hide
*/
+ @NonNull
@SystemApi
public static final Uri WFC_ROAMING_ENABLED_CONTENT_URI = Uri.withAppendedPath(
CONTENT_URI, "wfc_roaming_enabled");
@@ -2577,17 +2585,35 @@
* {@link SubscriptionManager#DEFAULT_SUBSCRIPTION_ID}, it means
* it's unset and {@link SubscriptionManager#getDefaultDataSubscriptionId()}
* is used to determine which modem is preferred.
+ * @param needValidation whether validation is needed before switch happens.
+ * @param executor The executor of where the callback will execute.
+ * @param callback Callback will be triggered once it succeeds or failed.
+ * See {@link TelephonyManager.SetOpportunisticSubscriptionResult}
+ * for more details. Pass null if don't care about the result.
+ *
* @hide
*
*/
+ @SystemApi
@RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE)
- public void setPreferredDataSubscriptionId(int subId) {
+ public void setPreferredDataSubscriptionId(int subId, boolean needValidation,
+ @NonNull @CallbackExecutor Executor executor, Consumer<Integer> callback) {
if (VDBG) logd("[setPreferredDataSubscriptionId]+ subId:" + subId);
try {
ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub"));
- if (iSub != null) {
- iSub.setPreferredDataSubscriptionId(subId);
- }
+ if (iSub == null) return;
+
+ ISetOpportunisticDataCallback callbackStub = new ISetOpportunisticDataCallback.Stub() {
+ @Override
+ public void onComplete(int result) {
+ Binder.withCleanCallingIdentity(() -> executor.execute(() -> {
+ if (callback != null) {
+ callback.accept(result);
+ }
+ }));
+ }
+ };
+ iSub.setPreferredDataSubscriptionId(subId, needValidation, callbackStub);
} catch (RemoteException ex) {
// ignore it
}
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java
index 29a305e..ff9ae22 100644
--- a/telephony/java/android/telephony/TelephonyManager.java
+++ b/telephony/java/android/telephony/TelephonyManager.java
@@ -1344,12 +1344,7 @@
*/
public static final String EXTRA_RECOVERY_ACTION = "recoveryAction";
- /**
- * The max value for the timeout passed in {@link #requestNumberVerification}.
- * @hide
- */
- @SystemApi
- public static final long MAX_NUMBER_VERIFICATION_TIMEOUT_MILLIS = 60000;
+ private static final long MAX_NUMBER_VERIFICATION_TIMEOUT_MILLIS = 60000;
/**
* Intent sent when an error occurs that debug tools should log and possibly take further
@@ -1544,6 +1539,7 @@
* Returns the Type Allocation Code from the IMEI. Return null if Type Allocation Code is not
* available.
*/
+ @Nullable
public String getTypeAllocationCode() {
return getTypeAllocationCode(getSlotIndex());
}
@@ -1554,6 +1550,7 @@
*
* @param slotIndex of which Type Allocation Code is returned
*/
+ @Nullable
public String getTypeAllocationCode(int slotIndex) {
ITelephony telephony = getITelephony();
if (telephony == null) return null;
@@ -1606,6 +1603,7 @@
* Returns the Manufacturer Code from the MEID. Return null if Manufacturer Code is not
* available.
*/
+ @Nullable
public String getManufacturerCode() {
return getManufacturerCode(getSlotIndex());
}
@@ -1616,6 +1614,7 @@
*
* @param slotIndex of which Type Allocation Code is returned
*/
+ @Nullable
public String getManufacturerCode(int slotIndex) {
ITelephony telephony = getITelephony();
if (telephony == null) return null;
@@ -1992,6 +1991,15 @@
return cmdline;
}
+ /**
+ * @return The max value for the timeout passed in {@link #requestNumberVerification}.
+ * @hide
+ */
+ @SystemApi
+ public static long getMaxNumberVerificationTimeoutMillis() {
+ return MAX_NUMBER_VERIFICATION_TIMEOUT_MILLIS;
+ }
+
/** Kernel command line */
private static final String sKernelCmdLine = getProcCmdLine();
@@ -2758,8 +2766,8 @@
* (see {@link #hasCarrierPrivileges}).
* <p>
* These "secret codes" are used to activate developer menus by dialing certain codes.
- * And they are of the form {@code *#*#<code>#*#*}. The intent will have the data
- * URI: {@code android_secret_code://<code>}. It is possible that a manifest
+ * And they are of the form {@code *#*#<code>#*#*}. The intent will have the data
+ * URI: {@code android_secret_code://<code>}. It is possible that a manifest
* receiver would be woken up even if it is not currently running.
* <p>
* It is supposed to replace {@link android.provider.Telephony.Sms.Intents#SECRET_CODE_ACTION}
@@ -4471,6 +4479,7 @@
* {@link android.Manifest.permission#READ_PRIVILEGED_PHONE_STATE READ_PRIVILEGED_PHONE_STATE}
* @hide
*/
+ @Nullable
@SystemApi
@RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE)
public String getIsimDomain() {
@@ -5719,8 +5728,8 @@
*
* @hide
* @param range The range of phone numbers the caller expects a phone call from.
- * @param timeoutMillis The amount of time to wait for such a call, or
- * {@link #MAX_NUMBER_VERIFICATION_TIMEOUT_MILLIS}, whichever is lesser.
+ * @param timeoutMillis The amount of time to wait for such a call, or the value of
+ * {@link #getMaxNumberVerificationTimeoutMillis()}, whichever is lesser.
* @param executor The {@link Executor} that callbacks should be executed on.
* @param callback The callback to use for delivering results.
*/
@@ -5976,6 +5985,7 @@
* @return IMS Service Table or null if not present or not loaded
* @hide
*/
+ @Nullable
@SystemApi
@RequiresPermission(Manifest.permission.READ_PRIVILEGED_PHONE_STATE)
public String getIsimIst() {
@@ -6827,12 +6837,12 @@
* app has carrier privileges (see {@link #hasCarrierPrivileges}).
*
* @param subId the id of the subscription to set the preferred network type for.
- * @param networkType the preferred network type, defined in RILConstants.java.
+ * @param networkType the preferred network type
* @return true on success; false on any failure.
* @hide
*/
@UnsupportedAppUsage
- public boolean setPreferredNetworkType(int subId, int networkType) {
+ public boolean setPreferredNetworkType(int subId, @PrefNetworkMode int networkType) {
try {
ITelephony telephony = getITelephony();
if (telephony != null) {
@@ -6902,14 +6912,12 @@
}
/**
- * Check TETHER_DUN_REQUIRED and TETHER_DUN_APN settings, net.tethering.noprovisioning
- * SystemProperty to decide whether DUN APN is required for
- * tethering.
+ * Check whether DUN APN is required for tethering.
*
- * @return 0: Not required. 1: required. 2: Not set.
+ * @return {@code true} if DUN APN is required for tethering.
* @hide
*/
- public int getTetherApnRequired() {
+ public boolean getTetherApnRequired() {
try {
ITelephony telephony = getITelephony();
if (telephony != null)
@@ -6919,7 +6927,7 @@
} catch (NullPointerException ex) {
Rlog.e(TAG, "hasMatchedTetherApnSetting NPE", ex);
}
- return 2;
+ return false;
}
@@ -9046,6 +9054,7 @@
* @return Application ID for specified app type or {@code null} if no uicc or error.
* @hide
*/
+ @Nullable
@SystemApi
@RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE)
public String getAidForAppType(@UiccAppType int appType) {
@@ -10100,6 +10109,29 @@
return false;
}
+ /** @hide */
+ @Retention(RetentionPolicy.SOURCE)
+ @IntDef(prefix = {"SET_OPPORTUNISTIC_SUB"}, value = {
+ SET_OPPORTUNISTIC_SUB_SUCCESS,
+ SET_OPPORTUNISTIC_SUB_VALIDATION_FAILED,
+ SET_OPPORTUNISTIC_SUB_INVALID_PARAMETER})
+ public @interface SetOpportunisticSubscriptionResult {}
+
+ /**
+ * No error. Operation succeeded.
+ */
+ public static final int SET_OPPORTUNISTIC_SUB_SUCCESS = 0;
+
+ /**
+ * Validation failed when trying to switch to preferred subscription.
+ */
+ public static final int SET_OPPORTUNISTIC_SUB_VALIDATION_FAILED = 1;
+
+ /**
+ * The parameter passed in is invalid.
+ */
+ public static final int SET_OPPORTUNISTIC_SUB_INVALID_PARAMETER = 2;
+
/**
* Set preferred opportunistic data subscription id.
*
@@ -10291,18 +10323,16 @@
* <p>Requires Permission:
* {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE} or that the
* calling app has carrier privileges (see {@link #hasCarrierPrivileges}).
+ *
+ * Note: with only carrier privileges, it is not allowed to switch from multi-sim
+ * to single-sim
+ *
* @param numOfSims number of live SIMs we want to switch to
* @throws android.os.RemoteException
*/
@SuppressAutoDoc // Blocked by b/72967236 - no support for carrier privileges
@RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE)
public void switchMultiSimConfig(int numOfSims) {
- //only proceed if multi-sim is not restricted
- if (!isMultisimSupported()) {
- Rlog.e(TAG, "switchMultiSimConfig not possible. It is restricted or not supported.");
- return;
- }
-
try {
ITelephony telephony = getITelephony();
if (telephony != null) {
diff --git a/telephony/java/android/telephony/data/ApnSetting.java b/telephony/java/android/telephony/data/ApnSetting.java
index 0e69530..1607817 100644
--- a/telephony/java/android/telephony/data/ApnSetting.java
+++ b/telephony/java/android/telephony/data/ApnSetting.java
@@ -19,7 +19,7 @@
import android.annotation.NonNull;
import android.content.ContentValues;
import android.database.Cursor;
-import android.hardware.radio.V1_0.ApnTypes;
+import android.hardware.radio.V1_4.ApnTypes;
import android.net.Uri;
import android.os.Parcel;
import android.os.Parcelable;
@@ -61,6 +61,7 @@
private static final String V4_FORMAT_REGEX = "^\\[ApnSettingV4\\]\\s*";
private static final String V5_FORMAT_REGEX = "^\\[ApnSettingV5\\]\\s*";
private static final String V6_FORMAT_REGEX = "^\\[ApnSettingV6\\]\\s*";
+ private static final String V7_FORMAT_REGEX = "^\\[ApnSettingV7\\]\\s*";
/**
* Default value for mtu if it's not set. Moved from PhoneConstants.
@@ -79,7 +80,7 @@
* APN type for all APNs.
* @hide
*/
- public static final int TYPE_ALL = ApnTypes.ALL;
+ public static final int TYPE_ALL = ApnTypes.ALL | ApnTypes.MCX;
/** APN type for default data traffic. */
public static final int TYPE_DEFAULT = ApnTypes.DEFAULT | ApnTypes.HIPRI;
/** APN type for MMS traffic. */
@@ -103,6 +104,8 @@
* for access to carrier services in an emergency call situation.
*/
public static final int TYPE_EMERGENCY = ApnTypes.EMERGENCY;
+ /** APN type for MCX (Mission Critical Service) where X can be PTT/Video/Data */
+ public static final int TYPE_MCX = ApnTypes.MCX;
/** @hide */
@IntDef(flag = true, prefix = { "TYPE_" }, value = {
@@ -115,7 +118,8 @@
TYPE_IMS,
TYPE_CBS,
TYPE_IA,
- TYPE_EMERGENCY
+ TYPE_EMERGENCY,
+ TYPE_MCX
})
@Retention(RetentionPolicy.SOURCE)
public @interface ApnType {}
@@ -206,6 +210,7 @@
APN_TYPE_STRING_MAP.put("cbs", TYPE_CBS);
APN_TYPE_STRING_MAP.put("ia", TYPE_IA);
APN_TYPE_STRING_MAP.put("emergency", TYPE_EMERGENCY);
+ APN_TYPE_STRING_MAP.put("mcx", TYPE_MCX);
APN_TYPE_INT_MAP = new ArrayMap<Integer, String>();
APN_TYPE_INT_MAP.put(TYPE_DEFAULT, "default");
APN_TYPE_INT_MAP.put(TYPE_MMS, "mms");
@@ -217,6 +222,7 @@
APN_TYPE_INT_MAP.put(TYPE_CBS, "cbs");
APN_TYPE_INT_MAP.put(TYPE_IA, "ia");
APN_TYPE_INT_MAP.put(TYPE_EMERGENCY, "emergency");
+ APN_TYPE_INT_MAP.put(TYPE_MCX, "mcx");
PROTOCOL_STRING_MAP = new ArrayMap<String, Integer>();
PROTOCOL_STRING_MAP.put("IP", PROTOCOL_IP);
@@ -281,6 +287,8 @@
private boolean mPermanentFailed = false;
private final int mCarrierId;
+ private final int mSkip464Xlat;
+
/**
* Returns the MTU size of the mobile interface to which the APN connected.
*
@@ -618,6 +626,17 @@
return mCarrierId;
}
+ /**
+ * Returns the skip464xlat flag for this APN.
+ *
+ * @return SKIP_464XLAT_DEFAULT, SKIP_464XLAT_DISABLE or SKIP_464XLAT_ENABLE
+ * @hide
+ */
+ @Carriers.Skip464XlatStatus
+ public int getSkip464Xlat() {
+ return mSkip464Xlat;
+ }
+
private ApnSetting(Builder builder) {
this.mEntryName = builder.mEntryName;
this.mApnName = builder.mApnName;
@@ -646,6 +665,7 @@
this.mMvnoMatchData = builder.mMvnoMatchData;
this.mApnSetId = builder.mApnSetId;
this.mCarrierId = builder.mCarrierId;
+ this.mSkip464Xlat = builder.mSkip464Xlat;
}
/**
@@ -657,7 +677,7 @@
int authType, int mApnTypeBitmask, int protocol, int roamingProtocol,
boolean carrierEnabled, int networkTypeBitmask, int profileId,
boolean modemCognitive, int maxConns, int waitTime, int maxConnsTime, int mtu,
- int mvnoType, String mvnoMatchData, int apnSetId, int carrierId) {
+ int mvnoType, String mvnoMatchData, int apnSetId, int carrierId, int skip464xlat) {
return new Builder()
.setId(id)
.setOperatorNumeric(operatorNumeric)
@@ -686,6 +706,7 @@
.setMvnoMatchData(mvnoMatchData)
.setApnSetId(apnSetId)
.setCarrierId(carrierId)
+ .setSkip464Xlat(skip464xlat)
.buildWithoutCheck();
}
@@ -703,7 +724,8 @@
mmsc, mmsProxyAddress, mmsProxyPort, user, password, authType, mApnTypeBitmask,
protocol, roamingProtocol, carrierEnabled, networkTypeBitmask, profileId,
modemCognitive, maxConns, waitTime, maxConnsTime, mtu, mvnoType, mvnoMatchData,
- Carriers.NO_APN_SET_ID, TelephonyManager.UNKNOWN_CARRIER_ID);
+ Carriers.NO_APN_SET_ID, TelephonyManager.UNKNOWN_CARRIER_ID,
+ Carriers.SKIP_464XLAT_DEFAULT);
}
/**
@@ -762,7 +784,8 @@
cursor.getString(cursor.getColumnIndexOrThrow(
Telephony.Carriers.MVNO_MATCH_DATA)),
cursor.getInt(cursor.getColumnIndexOrThrow(Telephony.Carriers.APN_SET_ID)),
- cursor.getInt(cursor.getColumnIndexOrThrow(Telephony.Carriers.CARRIER_ID)));
+ cursor.getInt(cursor.getColumnIndexOrThrow(Telephony.Carriers.CARRIER_ID)),
+ cursor.getInt(cursor.getColumnIndexOrThrow(Carriers.SKIP_464XLAT)));
}
/**
@@ -775,7 +798,7 @@
apn.mProtocol, apn.mRoamingProtocol, apn.mCarrierEnabled, apn.mNetworkTypeBitmask,
apn.mProfileId, apn.mPersistent, apn.mMaxConns, apn.mWaitTime,
apn.mMaxConnsTime, apn.mMtu, apn.mMvnoType, apn.mMvnoMatchData, apn.mApnSetId,
- apn.mCarrierId);
+ apn.mCarrierId, apn.mSkip464Xlat);
}
/**
@@ -824,6 +847,13 @@
* <profileId>, <modemCognitive>, <maxConns>, <waitTime>, <maxConnsTime>, <mtu>,
* <mvnoType>, <mvnoMatchData>, <networkTypeBitmask>, <apnSetId>, <carrierId>
*
+ * v7 format:
+ * [ApnSettingV7] <carrier>, <apn>, <proxy>, <port>, <user>, <password>, <server>,
+ * <mmsc>, <mmsproxy>, <mmsport>, <mcc>, <mnc>, <authtype>,
+ * <type>[| <type>...], <protocol>, <roaming_protocol>, <carrierEnabled>, <bearerBitmask>,
+ * <profileId>, <modemCognitive>, <maxConns>, <waitTime>, <maxConnsTime>, <mtu>,
+ * <mvnoType>, <mvnoMatchData>, <networkTypeBitmask>, <apnSetId>, <carrierId>, <skip464xlat>
+ *
* Note that the strings generated by {@link #toString()} do not contain the username
* and password and thus cannot be read by this method.
*
@@ -836,7 +866,10 @@
int version;
// matches() operates on the whole string, so append .* to the regex.
- if (data.matches(V6_FORMAT_REGEX + ".*")) {
+ if (data.matches(V7_FORMAT_REGEX + ".*")) {
+ version = 7;
+ data = data.replaceFirst(V7_FORMAT_REGEX, "");
+ } else if (data.matches(V6_FORMAT_REGEX + ".*")) {
version = 6;
data = data.replaceFirst(V6_FORMAT_REGEX, "");
} else if (data.matches(V5_FORMAT_REGEX + ".*")) {
@@ -882,6 +915,7 @@
String mvnoMatchData = "";
int apnSetId = Carriers.NO_APN_SET_ID;
int carrierId = TelephonyManager.UNKNOWN_CARRIER_ID;
+ int skip464xlat = Carriers.SKIP_464XLAT_DEFAULT;
if (version == 1) {
typeArray = new String[a.length - 13];
System.arraycopy(a, 13, typeArray, 0, a.length - 13);
@@ -928,6 +962,12 @@
if (a.length > 28) {
carrierId = Integer.parseInt(a[28]);
}
+ if (a.length > 29) {
+ try {
+ skip464xlat = Integer.parseInt(a[29]);
+ } catch (NumberFormatException e) {
+ }
+ }
}
// If both bearerBitmask and networkTypeBitmask were specified, bearerBitmask would be
@@ -943,7 +983,7 @@
getProtocolIntFromString(protocol), getProtocolIntFromString(roamingProtocol),
carrierEnabled, networkTypeBitmask, profileId, modemCognitive, maxConns, waitTime,
maxConnsTime, mtu, getMvnoTypeIntFromString(mvnoType), mvnoMatchData, apnSetId,
- carrierId);
+ carrierId, skip464xlat);
}
/**
@@ -979,7 +1019,7 @@
*/
public String toString() {
StringBuilder sb = new StringBuilder();
- sb.append("[ApnSettingV6] ")
+ sb.append("[ApnSettingV7] ")
.append(mEntryName)
.append(", ").append(mId)
.append(", ").append(mOperatorNumeric)
@@ -1007,6 +1047,7 @@
sb.append(", ").append(mNetworkTypeBitmask);
sb.append(", ").append(mApnSetId);
sb.append(", ").append(mCarrierId);
+ sb.append(", ").append(mSkip464Xlat);
return sb.toString();
}
@@ -1100,7 +1141,8 @@
&& Objects.equals(mMvnoMatchData, other.mMvnoMatchData)
&& Objects.equals(mNetworkTypeBitmask, other.mNetworkTypeBitmask)
&& Objects.equals(mApnSetId, other.mApnSetId)
- && Objects.equals(mCarrierId, other.mCarrierId);
+ && Objects.equals(mCarrierId, other.mCarrierId)
+ && Objects.equals(mSkip464Xlat, other.mSkip464Xlat);
}
/**
@@ -1146,7 +1188,8 @@
&& Objects.equals(mMvnoType, other.mMvnoType)
&& Objects.equals(mMvnoMatchData, other.mMvnoMatchData)
&& Objects.equals(mApnSetId, other.mApnSetId)
- && Objects.equals(mCarrierId, other.mCarrierId);
+ && Objects.equals(mCarrierId, other.mCarrierId)
+ && Objects.equals(mSkip464Xlat, other.mSkip464Xlat);
}
/**
@@ -1174,7 +1217,8 @@
&& xorEqualsInt(this.mMmsProxyPort, other.mMmsProxyPort))
&& Objects.equals(this.mNetworkTypeBitmask, other.mNetworkTypeBitmask)
&& Objects.equals(mApnSetId, other.mApnSetId)
- && Objects.equals(mCarrierId, other.mCarrierId);
+ && Objects.equals(mCarrierId, other.mCarrierId)
+ && Objects.equals(mSkip464Xlat, other.mSkip464Xlat);
}
// Equal or one is null.
@@ -1221,6 +1265,7 @@
apnValue.put(Telephony.Carriers.MVNO_TYPE, getMvnoTypeStringFromInt(mMvnoType));
apnValue.put(Telephony.Carriers.NETWORK_TYPE_BITMASK, mNetworkTypeBitmask);
apnValue.put(Telephony.Carriers.CARRIER_ID, mCarrierId);
+ apnValue.put(Telephony.Carriers.SKIP_464XLAT, mSkip464Xlat);
return apnValue;
}
@@ -1380,6 +1425,7 @@
dest.writeInt(mNetworkTypeBitmask);
dest.writeInt(mApnSetId);
dest.writeInt(mCarrierId);
+ dest.writeInt(mSkip464Xlat);
}
private static ApnSetting readFromParcel(Parcel in) {
@@ -1403,11 +1449,12 @@
final int networkTypeBitmask = in.readInt();
final int apnSetId = in.readInt();
final int carrierId = in.readInt();
+ final int skip464xlat = in.readInt();
return makeApnSetting(id, operatorNumeric, entryName, apnName,
- proxy, port, mmsc, mmsProxy, mmsPort, user, password, authType, apnTypesBitmask,
- protocol, roamingProtocol, carrierEnabled, networkTypeBitmask, 0, false,
- 0, 0, 0, 0, mvnoType, null, apnSetId, carrierId);
+ proxy, port, mmsc, mmsProxy, mmsPort, user, password, authType, apnTypesBitmask,
+ protocol, roamingProtocol, carrierEnabled, networkTypeBitmask, 0, false,
+ 0, 0, 0, 0, mvnoType, null, apnSetId, carrierId, skip464xlat);
}
public static final Parcelable.Creator<ApnSetting> CREATOR =
@@ -1484,6 +1531,7 @@
private String mMvnoMatchData;
private int mApnSetId;
private int mCarrierId = TelephonyManager.UNKNOWN_CARRIER_ID;
+ private int mSkip464Xlat = Carriers.SKIP_464XLAT_DEFAULT;
/**
* Default constructor for Builder.
@@ -1820,12 +1868,24 @@
*
* @param carrierId the carrier id to set for this APN
*/
+ @NonNull
public Builder setCarrierId(int carrierId) {
this.mCarrierId = carrierId;
return this;
}
/**
+ * Sets skip464xlat flag for this APN.
+ *
+ * @param skip464xlat skip464xlat for this APN
+ * @hide
+ */
+ public Builder setSkip464Xlat(@Carriers.Skip464XlatStatus int skip464xlat) {
+ this.mSkip464Xlat = skip464xlat;
+ return this;
+ }
+
+ /**
* Builds {@link ApnSetting} from this builder.
*
* @return {@code null} if {@link #setApnName(String)} or {@link #setEntryName(String)}
@@ -1833,7 +1893,7 @@
* {@link ApnSetting} built from this builder otherwise.
*/
public ApnSetting build() {
- if ((mApnTypeBitmask & ApnTypes.ALL) == 0 || TextUtils.isEmpty(mApnName)
+ if ((mApnTypeBitmask & TYPE_ALL) == 0 || TextUtils.isEmpty(mApnName)
|| TextUtils.isEmpty(mEntryName)) {
return null;
}
diff --git a/telephony/java/android/telephony/data/DataCallResponse.java b/telephony/java/android/telephony/data/DataCallResponse.java
index 3d2fe5f..6d74ded 100644
--- a/telephony/java/android/telephony/data/DataCallResponse.java
+++ b/telephony/java/android/telephony/data/DataCallResponse.java
@@ -25,6 +25,8 @@
import android.os.Parcelable;
import android.telephony.data.ApnSetting.ProtocolType;
+import com.android.internal.annotations.VisibleForTesting;
+
import java.net.InetAddress;
import java.util.ArrayList;
import java.util.List;
@@ -90,6 +92,8 @@
mMtu = mtu;
}
+ /** @hide */
+ @VisibleForTesting
public DataCallResponse(Parcel source) {
mStatus = source.readInt();
mSuggestedRetryTime = source.readInt();
diff --git a/telephony/java/android/telephony/data/DataService.java b/telephony/java/android/telephony/data/DataService.java
index 79572b9..59d1e1e 100644
--- a/telephony/java/android/telephony/data/DataService.java
+++ b/telephony/java/android/telephony/data/DataService.java
@@ -116,23 +116,23 @@
*/
public abstract class DataServiceProvider implements AutoCloseable {
- private final int mSlotId;
+ private final int mSlotIndex;
private final List<IDataServiceCallback> mDataCallListChangedCallbacks = new ArrayList<>();
/**
* Constructor
- * @param slotId SIM slot id the data service provider associated with.
+ * @param slotIndex SIM slot index the data service provider associated with.
*/
- public DataServiceProvider(int slotId) {
- mSlotId = slotId;
+ public DataServiceProvider(int slotIndex) {
+ mSlotIndex = slotIndex;
}
/**
- * @return SIM slot id the data service provider associated with.
+ * @return SIM slot index the data service provider associated with.
*/
- public final int getSlotId() {
- return mSlotId;
+ public final int getSlotIndex() {
+ return mSlotIndex;
}
/**
@@ -152,8 +152,9 @@
* @param callback The result callback for this request. Null if the client does not care
* about the result.
*/
- public void setupDataCall(int accessNetworkType, DataProfile dataProfile, boolean isRoaming,
- boolean allowRoaming, @SetupDataReason int reason,
+ public void setupDataCall(int accessNetworkType, @NonNull DataProfile dataProfile,
+ boolean isRoaming, boolean allowRoaming,
+ @SetupDataReason int reason,
@Nullable LinkProperties linkProperties,
@Nullable DataServiceCallback callback) {
// The default implementation is to return unsupported.
@@ -192,7 +193,7 @@
* @param callback The result callback for this request. Null if the client does not care
* about the result.
*/
- public void setInitialAttachApn(DataProfile dataProfile, boolean isRoaming,
+ public void setInitialAttachApn(@NonNull DataProfile dataProfile, boolean isRoaming,
@Nullable DataServiceCallback callback) {
// The default implementation is to return unsupported.
if (callback != null) {
@@ -211,7 +212,7 @@
* @param callback The result callback for this request. Null if the client does not care
* about the result.
*/
- public void setDataProfile(List<DataProfile> dps, boolean isRoaming,
+ public void setDataProfile(@NonNull List<DataProfile> dps, boolean isRoaming,
@Nullable DataServiceCallback callback) {
// The default implementation is to return unsupported.
if (callback != null) {
@@ -250,9 +251,9 @@
public final void notifyDataCallListChanged(List<DataCallResponse> dataCallList) {
synchronized (mDataCallListChangedCallbacks) {
for (IDataServiceCallback callback : mDataCallListChangedCallbacks) {
- mHandler.obtainMessage(DATA_SERVICE_INDICATION_DATA_CALL_LIST_CHANGED, mSlotId,
- 0, new DataCallListChangedIndication(dataCallList, callback))
- .sendToTarget();
+ mHandler.obtainMessage(DATA_SERVICE_INDICATION_DATA_CALL_LIST_CHANGED,
+ mSlotIndex, 0, new DataCallListChangedIndication(dataCallList,
+ callback)).sendToTarget();
}
}
}
@@ -341,20 +342,20 @@
@Override
public void handleMessage(Message message) {
IDataServiceCallback callback;
- final int slotId = message.arg1;
- DataServiceProvider serviceProvider = mServiceMap.get(slotId);
+ final int slotIndex = message.arg1;
+ DataServiceProvider serviceProvider = mServiceMap.get(slotIndex);
switch (message.what) {
case DATA_SERVICE_CREATE_DATA_SERVICE_PROVIDER:
- serviceProvider = createDataServiceProvider(message.arg1);
+ serviceProvider = onCreateDataServiceProvider(message.arg1);
if (serviceProvider != null) {
- mServiceMap.put(slotId, serviceProvider);
+ mServiceMap.put(slotIndex, serviceProvider);
}
break;
case DATA_SERVICE_REMOVE_DATA_SERVICE_PROVIDER:
if (serviceProvider != null) {
serviceProvider.close();
- mServiceMap.remove(slotId);
+ mServiceMap.remove(slotIndex);
}
break;
case DATA_SERVICE_REMOVE_ALL_DATA_SERVICE_PROVIDERS:
@@ -453,12 +454,12 @@
* this method to facilitate the creation of {@link DataServiceProvider} instances. The system
* will call this method after binding the data service for each active SIM slot id.
*
- * @param slotId SIM slot id the data service associated with.
+ * @param slotIndex SIM slot id the data service associated with.
* @return Data service object
*/
- public abstract DataServiceProvider createDataServiceProvider(int slotId);
+ @Nullable
+ public abstract DataServiceProvider onCreateDataServiceProvider(int slotIndex);
- /** @hide */
@Override
public IBinder onBind(Intent intent) {
if (intent == null || !DATA_SERVICE_INTERFACE.equals(intent.getAction())) {
@@ -468,17 +469,16 @@
return mBinder;
}
- /** @hide */
@Override
public boolean onUnbind(Intent intent) {
mHandler.obtainMessage(DATA_SERVICE_REMOVE_ALL_DATA_SERVICE_PROVIDERS).sendToTarget();
return false;
}
- /** @hide */
@Override
public void onDestroy() {
mHandlerThread.quit();
+ super.onDestroy();
}
/**
@@ -486,78 +486,78 @@
*/
private class IDataServiceWrapper extends IDataService.Stub {
@Override
- public void createDataServiceProvider(int slotId) {
- mHandler.obtainMessage(DATA_SERVICE_CREATE_DATA_SERVICE_PROVIDER, slotId, 0)
+ public void createDataServiceProvider(int slotIndex) {
+ mHandler.obtainMessage(DATA_SERVICE_CREATE_DATA_SERVICE_PROVIDER, slotIndex, 0)
.sendToTarget();
}
@Override
- public void removeDataServiceProvider(int slotId) {
- mHandler.obtainMessage(DATA_SERVICE_REMOVE_DATA_SERVICE_PROVIDER, slotId, 0)
+ public void removeDataServiceProvider(int slotIndex) {
+ mHandler.obtainMessage(DATA_SERVICE_REMOVE_DATA_SERVICE_PROVIDER, slotIndex, 0)
.sendToTarget();
}
@Override
- public void setupDataCall(int slotId, int accessNetworkType, DataProfile dataProfile,
+ public void setupDataCall(int slotIndex, int accessNetworkType, DataProfile dataProfile,
boolean isRoaming, boolean allowRoaming, int reason,
LinkProperties linkProperties, IDataServiceCallback callback) {
- mHandler.obtainMessage(DATA_SERVICE_REQUEST_SETUP_DATA_CALL, slotId, 0,
+ mHandler.obtainMessage(DATA_SERVICE_REQUEST_SETUP_DATA_CALL, slotIndex, 0,
new SetupDataCallRequest(accessNetworkType, dataProfile, isRoaming,
allowRoaming, reason, linkProperties, callback))
.sendToTarget();
}
@Override
- public void deactivateDataCall(int slotId, int cid, int reason,
+ public void deactivateDataCall(int slotIndex, int cid, int reason,
IDataServiceCallback callback) {
- mHandler.obtainMessage(DATA_SERVICE_REQUEST_DEACTIVATE_DATA_CALL, slotId, 0,
+ mHandler.obtainMessage(DATA_SERVICE_REQUEST_DEACTIVATE_DATA_CALL, slotIndex, 0,
new DeactivateDataCallRequest(cid, reason, callback))
.sendToTarget();
}
@Override
- public void setInitialAttachApn(int slotId, DataProfile dataProfile, boolean isRoaming,
+ public void setInitialAttachApn(int slotIndex, DataProfile dataProfile, boolean isRoaming,
IDataServiceCallback callback) {
- mHandler.obtainMessage(DATA_SERVICE_REQUEST_SET_INITIAL_ATTACH_APN, slotId, 0,
+ mHandler.obtainMessage(DATA_SERVICE_REQUEST_SET_INITIAL_ATTACH_APN, slotIndex, 0,
new SetInitialAttachApnRequest(dataProfile, isRoaming, callback))
.sendToTarget();
}
@Override
- public void setDataProfile(int slotId, List<DataProfile> dps, boolean isRoaming,
+ public void setDataProfile(int slotIndex, List<DataProfile> dps, boolean isRoaming,
IDataServiceCallback callback) {
- mHandler.obtainMessage(DATA_SERVICE_REQUEST_SET_DATA_PROFILE, slotId, 0,
+ mHandler.obtainMessage(DATA_SERVICE_REQUEST_SET_DATA_PROFILE, slotIndex, 0,
new SetDataProfileRequest(dps, isRoaming, callback)).sendToTarget();
}
@Override
- public void getDataCallList(int slotId, IDataServiceCallback callback) {
+ public void getDataCallList(int slotIndex, IDataServiceCallback callback) {
if (callback == null) {
loge("getDataCallList: callback is null");
return;
}
- mHandler.obtainMessage(DATA_SERVICE_REQUEST_GET_DATA_CALL_LIST, slotId, 0,
+ mHandler.obtainMessage(DATA_SERVICE_REQUEST_GET_DATA_CALL_LIST, slotIndex, 0,
callback).sendToTarget();
}
@Override
- public void registerForDataCallListChanged(int slotId, IDataServiceCallback callback) {
+ public void registerForDataCallListChanged(int slotIndex, IDataServiceCallback callback) {
if (callback == null) {
loge("registerForDataCallListChanged: callback is null");
return;
}
- mHandler.obtainMessage(DATA_SERVICE_REQUEST_REGISTER_DATA_CALL_LIST_CHANGED, slotId,
+ mHandler.obtainMessage(DATA_SERVICE_REQUEST_REGISTER_DATA_CALL_LIST_CHANGED, slotIndex,
0, callback).sendToTarget();
}
@Override
- public void unregisterForDataCallListChanged(int slotId, IDataServiceCallback callback) {
+ public void unregisterForDataCallListChanged(int slotIndex, IDataServiceCallback callback) {
if (callback == null) {
loge("unregisterForDataCallListChanged: callback is null");
return;
}
- mHandler.obtainMessage(DATA_SERVICE_REQUEST_UNREGISTER_DATA_CALL_LIST_CHANGED, slotId,
- 0, callback).sendToTarget();
+ mHandler.obtainMessage(DATA_SERVICE_REQUEST_UNREGISTER_DATA_CALL_LIST_CHANGED,
+ slotIndex, 0, callback).sendToTarget();
}
}
diff --git a/telephony/java/android/telephony/data/DataServiceCallback.java b/telephony/java/android/telephony/data/DataServiceCallback.java
index bef1142..2d0cfe8 100644
--- a/telephony/java/android/telephony/data/DataServiceCallback.java
+++ b/telephony/java/android/telephony/data/DataServiceCallback.java
@@ -17,6 +17,8 @@
package android.telephony.data;
import android.annotation.IntDef;
+import android.annotation.NonNull;
+import android.annotation.Nullable;
import android.annotation.SystemApi;
import android.net.LinkProperties;
import android.os.RemoteException;
@@ -74,7 +76,8 @@
* @param result The result code. Must be one of the {@link ResultCode}.
* @param response Setup data call response.
*/
- public void onSetupDataCallComplete(@ResultCode int result, DataCallResponse response) {
+ public void onSetupDataCallComplete(@ResultCode int result,
+ @Nullable DataCallResponse response) {
IDataServiceCallback callback = mCallback.get();
if (callback != null) {
try {
@@ -141,10 +144,11 @@
* DataServiceCallback)}.
*
* @param result The result code. Must be one of the {@link ResultCode}.
- * @param dataCallList List of the current active data connection.
+ * @param dataCallList List of the current active data connection. If no data call is presented,
+ * set it to an empty list.
*/
public void onGetDataCallListComplete(@ResultCode int result,
- List<DataCallResponse> dataCallList) {
+ @NonNull List<DataCallResponse> dataCallList) {
IDataServiceCallback callback = mCallback.get();
if (callback != null) {
try {
@@ -156,11 +160,12 @@
}
/**
- * Called to indicate that data connection list changed.
+ * Called to indicate that data connection list changed. If no data call is presented, set it to
+ * an empty list.
*
* @param dataCallList List of the current active data connection.
*/
- public void onDataCallListChanged(List<DataCallResponse> dataCallList) {
+ public void onDataCallListChanged(@NonNull List<DataCallResponse> dataCallList) {
IDataServiceCallback callback = mCallback.get();
if (callback != null) {
try {
diff --git a/telephony/java/android/telephony/data/QualifiedNetworksService.java b/telephony/java/android/telephony/data/QualifiedNetworksService.java
index 45b4849..c38f278 100644
--- a/telephony/java/android/telephony/data/QualifiedNetworksService.java
+++ b/telephony/java/android/telephony/data/QualifiedNetworksService.java
@@ -16,6 +16,8 @@
package android.telephony.data;
+import android.annotation.NonNull;
+import android.annotation.Nullable;
import android.annotation.SystemApi;
import android.app.Service;
import android.content.Intent;
@@ -132,7 +134,7 @@
* for data setup.
*/
public final void updateQualifiedNetworkTypes(@ApnType int apnTypes,
- int[] qualifiedNetworkTypes) {
+ @Nullable int[] qualifiedNetworkTypes) {
mHandler.obtainMessage(QNS_UPDATE_QUALIFIED_NETWORKS, mSlotIndex, apnTypes,
qualifiedNetworkTypes).sendToTarget();
}
@@ -233,6 +235,7 @@
* @param slotIndex SIM slot index the qualified networks service associated with.
* @return Qualified networks service instance
*/
+ @NonNull
public abstract NetworkAvailabilityUpdater createNetworkAvailabilityUpdater(int slotIndex);
/** @hide */
diff --git a/telephony/java/android/telephony/euicc/EuiccManager.java b/telephony/java/android/telephony/euicc/EuiccManager.java
index 828e3e9..b8a07e4 100644
--- a/telephony/java/android/telephony/euicc/EuiccManager.java
+++ b/telephony/java/android/telephony/euicc/EuiccManager.java
@@ -17,6 +17,7 @@
import android.Manifest;
import android.annotation.IntDef;
+import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.RequiresPermission;
import android.annotation.SdkConstant;
@@ -116,6 +117,66 @@
"android.telephony.euicc.action.RESOLVE_ERROR";
/**
+ * Intent action sent by system apps (such as the Settings app) to the Telephony framework to
+ * enable or disable a subscription. Must be accompanied with {@link #EXTRA_SUBSCRIPTION_ID} and
+ * {@link #EXTRA_ENABLE_SUBSCRIPTION}.
+ *
+ * <p>Unlike {@link #switchToSubscription(int, PendingIntent)}, using this action allows the
+ * underlying eUICC service (i.e. the LPA app) to control the UI experience during this
+ * operation. The action is received by the Telephony framework, which in turn selects and
+ * launches an appropriate LPA activity to present UI to the user. For example, the activity may
+ * show a confirmation dialog, a progress dialog, or an error dialog when necessary.
+ *
+ * <p>The launched activity will immediately finish with
+ * {@link android.app.Activity#RESULT_CANCELED} if {@link #isEnabled} is false.
+ *
+ * @hide
+ */
+ @SystemApi
+ public static final String ACTION_TOGGLE_SUBSCRIPTION_PRIVILEGED =
+ "android.telephony.euicc.action.TOGGLE_SUBSCRIPTION_PRIVILEGED";
+
+ /**
+ * Intent action sent by system apps (such as the Settings app) to the Telephony framework to
+ * delete a subscription. Must be accompanied with {@link #EXTRA_SUBSCRIPTION_ID}.
+ *
+ * <p>Unlike {@link #deleteSubscription(int, PendingIntent)}, using this action allows the
+ * underlying eUICC service (i.e. the LPA app) to control the UI experience during this
+ * operation. The action is received by the Telephony framework, which in turn selects and
+ * launches an appropriate LPA activity to present UI to the user. For example, the activity may
+ * show a confirmation dialog, a progress dialog, or an error dialog when necessary.
+ *
+ * <p>The launched activity will immediately finish with
+ * {@link android.app.Activity#RESULT_CANCELED} if {@link #isEnabled} is false.
+ *
+ * @hide
+ */
+ @SystemApi
+ public static final String ACTION_DELETE_SUBSCRIPTION_PRIVILEGED =
+ "android.telephony.euicc.action.DELETE_SUBSCRIPTION_PRIVILEGED";
+
+ /**
+ * Intent action sent by system apps (such as the Settings app) to the Telephony framework to
+ * rename a subscription. Must be accompanied with {@link #EXTRA_SUBSCRIPTION_ID} and
+ * {@link #EXTRA_SUBSCRIPTION_NICKNAME}.
+ *
+ * <p>Unlike {@link #updateSubscriptionNickname(int, String, PendingIntent)}, using this action
+ * allows the the underlying eUICC service (i.e. the LPA app) to control the UI experience
+ * during this operation. The action is received by the Telephony framework, which in turn
+ * selects and launches an appropriate LPA activity to present UI to the user. For example, the
+ * activity may show a confirmation dialog, a progress dialog, or an error dialog when
+ * necessary.
+ *
+ * <p>The launched activity will immediately finish with
+ * {@link android.app.Activity#RESULT_CANCELED} if {@link #isEnabled} is false.
+ *
+ * @hide
+ */
+ @SystemApi
+ public static final String ACTION_RENAME_SUBSCRIPTION_PRIVILEGED =
+ "android.telephony.euicc.action.RENAME_SUBSCRIPTION_PRIVILEGED";
+
+ /**
* Result code for an operation indicating that the operation succeeded.
*/
public static final int EMBEDDED_SUBSCRIPTION_RESULT_OK = 0;
@@ -195,6 +256,37 @@
"android.telephony.euicc.extra.FORCE_PROVISION";
/**
+ * Key for an extra set on privileged actions {@link #ACTION_TOGGLE_SUBSCRIPTION_PRIVILEGED},
+ * {@link #ACTION_DELETE_SUBSCRIPTION_PRIVILEGED}, and
+ * {@link #ACTION_RENAME_SUBSCRIPTION_PRIVILEGED} providing the ID of the targeted subscription.
+ *
+ * @hide
+ */
+ @SystemApi
+ public static final String EXTRA_SUBSCRIPTION_ID =
+ "android.telephony.euicc.extra.SUBSCRIPTION_ID";
+
+ /**
+ * Key for an extra set on {@link #ACTION_TOGGLE_SUBSCRIPTION_PRIVILEGED} providing a boolean
+ * value of whether to enable or disable the targeted subscription.
+ *
+ * @hide
+ */
+ @SystemApi
+ public static final String EXTRA_ENABLE_SUBSCRIPTION =
+ "android.telephony.euicc.extra.ENABLE_SUBSCRIPTION";
+
+ /**
+ * Key for an extra set on {@link #ACTION_RENAME_SUBSCRIPTION_PRIVILEGED} providing a new
+ * nickname for the targeted subscription.
+ *
+ * @hide
+ */
+ @SystemApi
+ public static final String EXTRA_SUBSCRIPTION_NICKNAME =
+ "android.telephony.euicc.extra.SUBSCRIPTION_NICKNAME";
+
+ /**
* Optional meta-data attribute for a carrier app providing an icon to use to represent the
* carrier. If not provided, the app's launcher icon will be used as a fallback.
*/
@@ -274,6 +366,7 @@
*
* @return an EuiccManager that uses the given card ID for all calls.
*/
+ @NonNull
public EuiccManager createForCardId(int cardId) {
return new EuiccManager(mContext, cardId);
}
diff --git a/telephony/java/android/telephony/ims/ImsCallSessionListener.java b/telephony/java/android/telephony/ims/ImsCallSessionListener.java
index 337375a..a09844d 100644
--- a/telephony/java/android/telephony/ims/ImsCallSessionListener.java
+++ b/telephony/java/android/telephony/ims/ImsCallSessionListener.java
@@ -16,6 +16,7 @@
package android.telephony.ims;
+import android.annotation.NonNull;
import android.annotation.SystemApi;
import android.os.RemoteException;
import android.telephony.CallQuality;
@@ -606,7 +607,7 @@
*
* @param profile updated ImsStreamMediaProfile
*/
- public void callSessionRttAudioIndicatorChanged(ImsStreamMediaProfile profile) {
+ public void callSessionRttAudioIndicatorChanged(@NonNull ImsStreamMediaProfile profile) {
try {
mListener.callSessionRttAudioIndicatorChanged(profile);
} catch (RemoteException e) {
@@ -619,7 +620,7 @@
*
* @param callQuality The new call quality
*/
- public void callQualityChanged(CallQuality callQuality) {
+ public void callQualityChanged(@NonNull CallQuality callQuality) {
try {
mListener.callQualityChanged(callQuality);
} catch (RemoteException e) {
diff --git a/telephony/java/android/telephony/ims/ImsException.java b/telephony/java/android/telephony/ims/ImsException.java
index ac4d17a..bdaad5b 100644
--- a/telephony/java/android/telephony/ims/ImsException.java
+++ b/telephony/java/android/telephony/ims/ImsException.java
@@ -86,7 +86,8 @@
* @param message an optional message to detail the error condition more specifically.
* @param cause the {@link Throwable} that caused this {@link ImsException} to be created.
*/
- public ImsException(@Nullable String message, @ImsErrorCode int code, Throwable cause) {
+ public ImsException(@Nullable String message, @ImsErrorCode int code,
+ @Nullable Throwable cause) {
super(getMessage(message, code), cause);
mCode = code;
}
diff --git a/telephony/java/android/telephony/ims/ImsExternalCallState.java b/telephony/java/android/telephony/ims/ImsExternalCallState.java
index f2d0cbf..c56915d 100644
--- a/telephony/java/android/telephony/ims/ImsExternalCallState.java
+++ b/telephony/java/android/telephony/ims/ImsExternalCallState.java
@@ -17,6 +17,8 @@
package android.telephony.ims;
import android.annotation.IntDef;
+import android.annotation.NonNull;
+import android.annotation.Nullable;
import android.annotation.SystemApi;
import android.net.Uri;
import android.os.Parcel;
@@ -124,9 +126,9 @@
* @param callType The type of external call.
* @param isCallheld A flag determining if the external connection is currently held.
*/
- public ImsExternalCallState(String callId, Uri address, Uri localAddress,
- boolean isPullable, @ExternalCallState int callState, @ExternalCallType int callType,
- boolean isCallheld) {
+ public ImsExternalCallState(@NonNull String callId, @NonNull Uri address,
+ @Nullable Uri localAddress, boolean isPullable, @ExternalCallState int callState,
+ @ExternalCallType int callType, boolean isCallheld) {
mCallId = getIdForString(callId);
mAddress = address;
mLocalAddress = localAddress;
@@ -184,14 +186,14 @@
return mCallId;
}
- public Uri getAddress() {
+ public @NonNull Uri getAddress() {
return mAddress;
}
/**
* @return A {@link Uri} containing the local address from the Multiendpoint Dialog Information.
*/
- public Uri getLocalAddress() {
+ public @Nullable Uri getLocalAddress() {
return mLocalAddress;
}
diff --git a/telephony/java/android/telephony/ims/ImsMmTelManager.java b/telephony/java/android/telephony/ims/ImsMmTelManager.java
index eb99d5d..58ddf21 100644
--- a/telephony/java/android/telephony/ims/ImsMmTelManager.java
+++ b/telephony/java/android/telephony/ims/ImsMmTelManager.java
@@ -21,6 +21,7 @@
import android.annotation.CallbackExecutor;
import android.annotation.IntDef;
import android.annotation.NonNull;
+import android.annotation.Nullable;
import android.annotation.RequiresPermission;
import android.annotation.SystemApi;
import android.content.Context;
@@ -139,7 +140,7 @@
if (mLocalCallback == null) return;
Binder.withCleanCallingIdentity(() ->
- mExecutor.execute(() -> mLocalCallback.onDeregistered(info)));
+ mExecutor.execute(() -> mLocalCallback.onUnregistered(info)));
}
@Override
@@ -199,7 +200,7 @@
*
* @param info the {@link ImsReasonInfo} associated with why registration was disconnected.
*/
- public void onDeregistered(ImsReasonInfo info) {
+ public void onUnregistered(@Nullable ImsReasonInfo info) {
}
/**
@@ -211,7 +212,7 @@
* transport type that has failed to handover registration to.
* @param info A {@link ImsReasonInfo} that identifies the reason for failure.
*/
- public void onTechnologyChangeFailed(int imsTransportType, ImsReasonInfo info) {
+ public void onTechnologyChangeFailed(int imsTransportType, @Nullable ImsReasonInfo info) {
}
/**
@@ -223,7 +224,7 @@
* subscription.
* @hide
*/
- public void onSubscriberAssociatedUriChanged(Uri[] uris) {
+ public void onSubscriberAssociatedUriChanged(@Nullable Uri[] uris) {
}
/**@hide*/
@@ -294,7 +295,7 @@
* @param capabilities The new availability of the capabilities.
*/
public void onCapabilitiesStatusChanged(
- MmTelFeature.MmTelCapabilities capabilities) {
+ @NonNull MmTelFeature.MmTelCapabilities capabilities) {
}
/**@hide*/
@@ -319,7 +320,7 @@
* @see android.telephony.SubscriptionManager#getActiveSubscriptionInfoList()
* @throws IllegalArgumentException if the subscription is invalid.
*/
- public static ImsMmTelManager createForSubscriptionId(int subId) {
+ public static @NonNull ImsMmTelManager createForSubscriptionId(int subId) {
if (!SubscriptionManager.isValidSubscriptionId(subId)) {
throw new IllegalArgumentException("Invalid subscription ID");
}
@@ -357,7 +358,7 @@
* reason.
*/
@RequiresPermission(Manifest.permission.READ_PRIVILEGED_PHONE_STATE)
- public void registerImsRegistrationCallback(@CallbackExecutor Executor executor,
+ public void registerImsRegistrationCallback(@NonNull @CallbackExecutor Executor executor,
@NonNull RegistrationCallback c) throws ImsException {
if (c == null) {
throw new IllegalArgumentException("Must include a non-null RegistrationCallback.");
@@ -485,7 +486,7 @@
* @see android.telephony.CarrierConfigManager#KEY_HIDE_ENHANCED_4G_LTE_BOOL
* @see android.telephony.CarrierConfigManager#KEY_ENHANCED_4G_LTE_ON_BY_DEFAULT_BOOL
* @see android.telephony.CarrierConfigManager#KEY_CARRIER_VOLTE_AVAILABLE_BOOL
- * @see #setAdvancedCallingSetting(boolean)
+ * @see #setAdvancedCallingSettingEnabled(boolean)
* @return true if the user's setting for advanced calling is enabled, false otherwise.
*/
@RequiresPermission(Manifest.permission.READ_PRIVILEGED_PHONE_STATE)
@@ -519,9 +520,9 @@
* @see #isAdvancedCallingSettingEnabled()
*/
@RequiresPermission(Manifest.permission.MODIFY_PHONE_STATE)
- public void setAdvancedCallingSetting(boolean isEnabled) {
+ public void setAdvancedCallingSettingEnabled(boolean isEnabled) {
try {
- getITelephony().setAdvancedCallingSetting(mSubId, isEnabled);
+ getITelephony().setAdvancedCallingSettingEnabled(mSubId, isEnabled);
return;
} catch (RemoteException e) {
throw e.rethrowAsRuntimeException();
@@ -589,7 +590,7 @@
/**
* The user's setting for whether or not they have enabled the "Video Calling" setting.
* @return true if the user’s “Video Calling” setting is currently enabled.
- * @see #setVtSetting(boolean)
+ * @see #setVtSettingEnabled(boolean)
*/
@RequiresPermission(Manifest.permission.READ_PRIVILEGED_PHONE_STATE)
public boolean isVtSettingEnabled() {
@@ -605,9 +606,9 @@
* @see #isVtSettingEnabled()
*/
@RequiresPermission(Manifest.permission.MODIFY_PHONE_STATE)
- public void setVtSetting(boolean isEnabled) {
+ public void setVtSettingEnabled(boolean isEnabled) {
try {
- getITelephony().setVtSetting(mSubId, isEnabled);
+ getITelephony().setVtSettingEnabled(mSubId, isEnabled);
return;
} catch (RemoteException e) {
throw e.rethrowAsRuntimeException();
@@ -616,7 +617,7 @@
/**
* @return true if the user's setting for Voice over WiFi is enabled and false if it is not.
- * @see #setVoWiFiSetting(boolean)
+ * @see #setVoWiFiSettingEnabled(boolean)
*/
@RequiresPermission(Manifest.permission.READ_PRIVILEGED_PHONE_STATE)
public boolean isVoWiFiSettingEnabled() {
@@ -633,9 +634,9 @@
* @see #isVoWiFiSettingEnabled()
*/
@RequiresPermission(Manifest.permission.MODIFY_PHONE_STATE)
- public void setVoWiFiSetting(boolean isEnabled) {
+ public void setVoWiFiSettingEnabled(boolean isEnabled) {
try {
- getITelephony().setVoWiFiSetting(mSubId, isEnabled);
+ getITelephony().setVoWiFiSettingEnabled(mSubId, isEnabled);
return;
} catch (RemoteException e) {
throw e.rethrowAsRuntimeException();
@@ -645,7 +646,7 @@
/**
* @return true if the user's setting for Voice over WiFi while roaming is enabled, false
* if disabled.
- * @see #setVoWiFiRoamingSetting(boolean)
+ * @see #setVoWiFiRoamingSettingEnabled(boolean)
*/
@RequiresPermission(Manifest.permission.READ_PRIVILEGED_PHONE_STATE)
public boolean isVoWiFiRoamingSettingEnabled() {
@@ -663,9 +664,9 @@
* @see #isVoWiFiRoamingSettingEnabled()
*/
@RequiresPermission(Manifest.permission.MODIFY_PHONE_STATE)
- public void setVoWiFiRoamingSetting(boolean isEnabled) {
+ public void setVoWiFiRoamingSettingEnabled(boolean isEnabled) {
try {
- getITelephony().setVoWiFiRoamingSetting(mSubId, isEnabled);
+ getITelephony().setVoWiFiRoamingSettingEnabled(mSubId, isEnabled);
return;
} catch (RemoteException e) {
throw e.rethrowAsRuntimeException();
@@ -682,7 +683,7 @@
* - {@link #WIFI_MODE_WIFI_ONLY}
* - {@link #WIFI_MODE_CELLULAR_PREFERRED}
* - {@link #WIFI_MODE_WIFI_PREFERRED}
- * @see #setVoWiFiSetting(boolean)
+ * @see #setVoWiFiSettingEnabled(boolean)
*/
@RequiresPermission(Manifest.permission.MODIFY_PHONE_STATE)
public void setVoWiFiNonPersistent(boolean isCapable, int mode) {
@@ -700,7 +701,7 @@
* - {@link #WIFI_MODE_WIFI_ONLY}
* - {@link #WIFI_MODE_CELLULAR_PREFERRED}
* - {@link #WIFI_MODE_WIFI_PREFERRED}
- * @see #setVoWiFiSetting(boolean)
+ * @see #setVoWiFiSettingEnabled(boolean)
*/
@RequiresPermission(Manifest.permission.READ_PRIVILEGED_PHONE_STATE)
public @WiFiCallingMode int getVoWiFiModeSetting() {
@@ -739,7 +740,7 @@
* - {@link #WIFI_MODE_WIFI_ONLY}
* - {@link #WIFI_MODE_CELLULAR_PREFERRED}
* - {@link #WIFI_MODE_WIFI_PREFERRED}
- * @see #setVoWiFiRoamingSetting(boolean)
+ * @see #setVoWiFiRoamingSettingEnabled(boolean)
*/
@RequiresPermission(Manifest.permission.READ_PRIVILEGED_PHONE_STATE)
public @WiFiCallingMode int getVoWiFiRoamingModeSetting() {
diff --git a/telephony/java/android/telephony/ims/ImsSsData.java b/telephony/java/android/telephony/ims/ImsSsData.java
index 3a82517..86832bb 100644
--- a/telephony/java/android/telephony/ims/ImsSsData.java
+++ b/telephony/java/android/telephony/ims/ImsSsData.java
@@ -17,6 +17,7 @@
import android.annotation.IntDef;
import android.annotation.NonNull;
+import android.annotation.Nullable;
import android.annotation.SystemApi;
import android.os.Parcel;
import android.os.Parcelable;
@@ -24,6 +25,9 @@
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
/**
* Provides STK Call Control Supplementary Service information.
@@ -260,13 +264,13 @@
public final int result;
private int[] mSsInfo;
- private ImsCallForwardInfo[] mCfInfo;
- private ImsSsInfo[] mImsSsInfo;
+ private List<ImsCallForwardInfo> mCfInfo;
+ private List<ImsSsInfo> mImsSsInfo;
/**
* Builder for optional ImsSsData parameters.
*/
- public static class Builder {
+ public static final class Builder {
private ImsSsData mImsSsData;
/**
@@ -301,7 +305,7 @@
* Set the array of {@link ImsSsInfo}s that are associated with this supplementary service
* data.
*/
- public @NonNull Builder setSuppServiceInfo(@NonNull ImsSsInfo[] imsSsInfos) {
+ public @NonNull Builder setSuppServiceInfo(@NonNull List<ImsSsInfo> imsSsInfos) {
mImsSsData.mImsSsInfo = imsSsInfos;
return this;
}
@@ -311,7 +315,7 @@
* service data.
*/
public @NonNull Builder setCallForwardingInfo(
- @NonNull ImsCallForwardInfo[] imsCallForwardInfos) {
+ @NonNull List<ImsCallForwardInfo> imsCallForwardInfos) {
mImsSsData.mCfInfo = imsCallForwardInfos;
return this;
}
@@ -360,8 +364,8 @@
serviceClass = in.readInt();
result = in.readInt();
mSsInfo = in.createIntArray();
- mCfInfo = (ImsCallForwardInfo[])in.readParcelableArray(this.getClass().getClassLoader());
- mImsSsInfo = (ImsSsInfo[])in.readParcelableArray(this.getClass().getClassLoader());
+ mCfInfo = in.readParcelableList(new ArrayList<>(), this.getClass().getClassLoader());
+ mImsSsInfo = in.readParcelableList(new ArrayList<>(), this.getClass().getClassLoader());
}
public static final Creator<ImsSsData> CREATOR = new Creator<ImsSsData>() {
@@ -384,8 +388,8 @@
out.writeInt(getServiceClass());
out.writeInt(getResult());
out.writeIntArray(mSsInfo);
- out.writeParcelableArray(mCfInfo, 0);
- out.writeParcelableArray(mImsSsInfo, 0);
+ out.writeParcelableList(mCfInfo, 0);
+ out.writeParcelableList(mImsSsInfo, 0);
}
@Override
@@ -500,12 +504,12 @@
/** @hide */
public void setImsSpecificSuppServiceInfo(ImsSsInfo[] imsSsInfo) {
- mImsSsInfo = imsSsInfo;
+ mImsSsInfo = Arrays.asList(imsSsInfo);
}
/** @hide */
public void setCallForwardingInfo(ImsCallForwardInfo[] cfInfo) {
- mCfInfo = cfInfo;
+ mCfInfo = Arrays.asList(cfInfo);
}
/**
@@ -524,7 +528,7 @@
int[] result = new int[2];
- if (mImsSsInfo == null || mImsSsInfo.length == 0) {
+ if (mImsSsInfo == null || mImsSsInfo.size() == 0) {
Rlog.e(TAG, "getSuppServiceInfoCompat: Could not parse mImsSsInfo, returning empty "
+ "int[]");
return result;
@@ -535,26 +539,26 @@
if (isTypeClir()) {
// Assume there will only be one ImsSsInfo.
// contains {"n","m"} parameters
- result[0] = mImsSsInfo[0].getClirOutgoingState();
- result[1] = mImsSsInfo[0].getClirInterrogationStatus();
+ result[0] = mImsSsInfo.get(0).getClirOutgoingState();
+ result[1] = mImsSsInfo.get(0).getClirInterrogationStatus();
return result;
}
// COLR 7.31
if (isTypeColr()) {
- result[0] = mImsSsInfo[0].getProvisionStatus();
+ result[0] = mImsSsInfo.get(0).getProvisionStatus();
}
// Facility Lock CLCK 7.4 (for call barring), CLIP 7.6, COLP 7.8, as well as any
// other result, just return the status for the "n" parameter and provisioning status for
// "m" as the default.
- result[0] = mImsSsInfo[0].getStatus();
- result[1] = mImsSsInfo[0].getProvisionStatus();
+ result[0] = mImsSsInfo.get(0).getStatus();
+ result[1] = mImsSsInfo.get(0).getProvisionStatus();
return result;
}
/**
* @return an array of {@link ImsSsInfo}s associated with this supplementary service data.
*/
- public @NonNull ImsSsInfo[] getSuppServiceInfo() {
+ public @NonNull List<ImsSsInfo> getSuppServiceInfo() {
return mImsSsInfo;
}
@@ -562,7 +566,7 @@
* @return an array of {@link ImsCallForwardInfo}s associated with this supplementary service
* data.
**/
- public ImsCallForwardInfo[] getCallForwardInfo() {
+ public @Nullable List<ImsCallForwardInfo> getCallForwardInfo() {
return mCfInfo;
}
diff --git a/telephony/java/android/telephony/ims/ImsSsInfo.java b/telephony/java/android/telephony/ims/ImsSsInfo.java
index 031f9e1..fba390c 100644
--- a/telephony/java/android/telephony/ims/ImsSsInfo.java
+++ b/telephony/java/android/telephony/ims/ImsSsInfo.java
@@ -173,7 +173,7 @@
/**
* Builds {@link ImsSsInfo} instances, which may include optional parameters.
*/
- public static class Builder {
+ public static final class Builder {
private final ImsSsInfo mImsSsInfo;
@@ -304,7 +304,7 @@
/**
* @return The Incoming Communication Barring (ICB) number.
*/
- public String getIncomingCommunicationBarringNumber() {
+ public @Nullable String getIncomingCommunicationBarringNumber() {
return mIcbNum;
}
diff --git a/telephony/java/android/telephony/ims/ProvisioningManager.java b/telephony/java/android/telephony/ims/ProvisioningManager.java
index 204891b..d12cda8 100644
--- a/telephony/java/android/telephony/ims/ProvisioningManager.java
+++ b/telephony/java/android/telephony/ims/ProvisioningManager.java
@@ -19,6 +19,7 @@
import android.Manifest;
import android.annotation.CallbackExecutor;
import android.annotation.NonNull;
+import android.annotation.Nullable;
import android.annotation.RequiresPermission;
import android.annotation.SystemApi;
import android.annotation.WorkerThread;
@@ -153,7 +154,7 @@
* @param item the IMS provisioning key constant, as defined by the OEM.
* @param value the new String value of the IMS configuration constant.
*/
- public void onProvisioningStringChanged(int item, String value) {
+ public void onProvisioningStringChanged(int item, @NonNull String value) {
// Base Implementation
}
@@ -177,7 +178,7 @@
* @see android.telephony.SubscriptionManager#getActiveSubscriptionInfoList()
* @throws IllegalArgumentException if the subscription is invalid.
*/
- public static ProvisioningManager createForSubscriptionId(int subId) {
+ public static @NonNull ProvisioningManager createForSubscriptionId(int subId) {
if (!SubscriptionManager.isValidSubscriptionId(subId)) {
throw new IllegalArgumentException("Invalid subscription ID");
}
@@ -206,7 +207,7 @@
* reason.
*/
@RequiresPermission(Manifest.permission.READ_PRIVILEGED_PHONE_STATE)
- public void registerProvisioningChangedCallback(@CallbackExecutor Executor executor,
+ public void registerProvisioningChangedCallback(@NonNull @CallbackExecutor Executor executor,
@NonNull Callback callback) throws ImsException {
callback.setExecutor(executor);
try {
@@ -271,7 +272,7 @@
*/
@WorkerThread
@RequiresPermission(Manifest.permission.READ_PRIVILEGED_PHONE_STATE)
- public String getProvisioningStringValue(int key) {
+ public @Nullable String getProvisioningStringValue(int key) {
try {
return getITelephony().getImsProvisioningString(mSubId, key);
} catch (RemoteException e) {
@@ -313,7 +314,7 @@
@WorkerThread
@RequiresPermission(Manifest.permission.MODIFY_PHONE_STATE)
public @ImsConfigImplBase.SetConfigResult int setProvisioningStringValue(int key,
- String value) {
+ @NonNull String value) {
try {
return getITelephony().setImsProvisioningString(mSubId, key, value);
} catch (RemoteException e) {
@@ -333,6 +334,7 @@
* @see CarrierConfigManager#KEY_CARRIER_VOLTE_PROVISIONING_REQUIRED_BOOL
* @param isProvisioned true if the device is provisioned for UT over IMS, false otherwise.
*/
+ @WorkerThread
@RequiresPermission(Manifest.permission.MODIFY_PHONE_STATE)
public void setProvisioningStatusForCapability(
@MmTelFeature.MmTelCapabilities.MmTelCapability int capability,
@@ -359,6 +361,7 @@
* provisioning, false if the capability does require provisioning and has not been
* provisioned yet.
*/
+ @WorkerThread
@RequiresPermission(Manifest.permission.READ_PRIVILEGED_PHONE_STATE)
public boolean getProvisioningStatusForCapability(
@MmTelFeature.MmTelCapabilities.MmTelCapability int capability,
diff --git a/telephony/java/android/telephony/mbms/vendor/IMbmsStreamingService.aidl b/telephony/java/android/telephony/mbms/vendor/IMbmsStreamingService.aidl
index c90ffc7..c1401272 100755
--- a/telephony/java/android/telephony/mbms/vendor/IMbmsStreamingService.aidl
+++ b/telephony/java/android/telephony/mbms/vendor/IMbmsStreamingService.aidl
@@ -26,13 +26,17 @@
*/
interface IMbmsStreamingService
{
+ @UnsupportedAppUsage
int initialize(IMbmsStreamingSessionCallback callback, int subId);
+ @UnsupportedAppUsage
int requestUpdateStreamingServices(int subId, in List<String> serviceClasses);
+ @UnsupportedAppUsage
int startStreaming(int subId, String serviceId,
IStreamingServiceCallback callback);
+ @UnsupportedAppUsage
Uri getPlaybackUri(int subId, String serviceId);
void stopStreaming(int subId, String serviceId);
diff --git a/telephony/java/android/telephony/mbms/vendor/MbmsGroupCallServiceBase.java b/telephony/java/android/telephony/mbms/vendor/MbmsGroupCallServiceBase.java
index e86a47d..1335b52 100644
--- a/telephony/java/android/telephony/mbms/vendor/MbmsGroupCallServiceBase.java
+++ b/telephony/java/android/telephony/mbms/vendor/MbmsGroupCallServiceBase.java
@@ -16,6 +16,7 @@
package android.telephony.mbms.vendor;
+import android.annotation.NonNull;
import android.annotation.SystemApi;
import android.annotation.TestApi;
import android.app.Service;
@@ -187,7 +188,7 @@
*
* May throw an {@link IllegalArgumentException} or a {@link SecurityException}, which
* will be intercepted and passed to the app as
- * {@link MbmsErrors.InitializationErrors#ERROR_UNABLE_TO_INITIALIZE}
+ * {@link MbmsErrors.InitializationErrtrors#ERROR_UNABLE_TO_INITIALIZE}
*
* May return any value from {@link MbmsErrors.InitializationErrors}
* or {@link MbmsErrors#SUCCESS}. Non-successful error codes will be passed to the app via
@@ -196,7 +197,7 @@
* @param callback The callback to use to communicate with the app.
* @param subscriptionId The subscription ID to use.
*/
- public int initialize(MbmsGroupCallSessionCallback callback, int subscriptionId)
+ public int initialize(@NonNull MbmsGroupCallSessionCallback callback, int subscriptionId)
throws RemoteException {
throw new UnsupportedOperationException("Not implemented");
}
@@ -215,8 +216,8 @@
* @param callback The callback object on which the app wishes to receive updates.
* @return Any error in {@link MbmsErrors.GeneralErrors}
*/
- public int startGroupCall(int subscriptionId, long tmgi, List<Integer> saiList,
- List<Integer> frequencyList, GroupCallCallback callback) {
+ public int startGroupCall(int subscriptionId, long tmgi, @NonNull List<Integer> saiList,
+ @NonNull List<Integer> frequencyList, @NonNull GroupCallCallback callback) {
throw new UnsupportedOperationException("Not implemented");
}
@@ -241,8 +242,8 @@
* @param saiList New list of SAIs that the call is available on.
* @param frequencyList New list of frequencies that the call is available on.
*/
- public void updateGroupCall(int subscriptionId, long tmgi, List<Integer> saiList,
- List<Integer> frequencyList) {
+ public void updateGroupCall(int subscriptionId, long tmgi, @NonNull List<Integer> saiList,
+ @NonNull List<Integer> frequencyList) {
throw new UnsupportedOperationException("Not implemented");
}
diff --git a/telephony/java/com/android/ims/ImsConfigListener.aidl b/telephony/java/com/android/ims/ImsConfigListener.aidl
index 64a5015..4f229df 100644
--- a/telephony/java/com/android/ims/ImsConfigListener.aidl
+++ b/telephony/java/com/android/ims/ImsConfigListener.aidl
@@ -47,6 +47,7 @@
*
* @return void.
*/
+ @UnsupportedAppUsage
void onSetFeatureResponse(int feature, int network, int value, int status);
/**
diff --git a/telephony/java/com/android/ims/internal/IImsCallSessionListener.aidl b/telephony/java/com/android/ims/internal/IImsCallSessionListener.aidl
index 579369f..b33a9f1 100644
--- a/telephony/java/com/android/ims/internal/IImsCallSessionListener.aidl
+++ b/telephony/java/com/android/ims/internal/IImsCallSessionListener.aidl
@@ -34,33 +34,47 @@
/**
* Notifies the result of the basic session operation (setup / terminate).
*/
+ @UnsupportedAppUsage
void callSessionProgressing(in IImsCallSession session, in ImsStreamMediaProfile profile);
+ @UnsupportedAppUsage
void callSessionStarted(in IImsCallSession session, in ImsCallProfile profile);
+ @UnsupportedAppUsage
void callSessionStartFailed(in IImsCallSession session, in ImsReasonInfo reasonInfo);
+ @UnsupportedAppUsage
void callSessionTerminated(in IImsCallSession session, in ImsReasonInfo reasonInfo);
/**
* Notifies the result of the call hold/resume operation.
*/
+ @UnsupportedAppUsage
void callSessionHeld(in IImsCallSession session, in ImsCallProfile profile);
+ @UnsupportedAppUsage
void callSessionHoldFailed(in IImsCallSession session, in ImsReasonInfo reasonInfo);
+ @UnsupportedAppUsage
void callSessionHoldReceived(in IImsCallSession session, in ImsCallProfile profile);
+ @UnsupportedAppUsage
void callSessionResumed(in IImsCallSession session, in ImsCallProfile profile);
+ @UnsupportedAppUsage
void callSessionResumeFailed(in IImsCallSession session, in ImsReasonInfo reasonInfo);
+ @UnsupportedAppUsage
void callSessionResumeReceived(in IImsCallSession session, in ImsCallProfile profile);
/**
* Notifies the result of call merge operation.
*/
+ @UnsupportedAppUsage
void callSessionMergeStarted(in IImsCallSession session,
in IImsCallSession newSession, in ImsCallProfile profile);
+ @UnsupportedAppUsage
void callSessionMergeComplete(in IImsCallSession session);
+ @UnsupportedAppUsage
void callSessionMergeFailed(in IImsCallSession session,
in ImsReasonInfo reasonInfo);
/**
* Notifies the result of call upgrade / downgrade or any other call updates.
*/
+ @UnsupportedAppUsage
void callSessionUpdated(in IImsCallSession session,
in ImsCallProfile profile);
void callSessionUpdateFailed(in IImsCallSession session,
@@ -81,7 +95,9 @@
/**
* Notifies the result of the participant invitation / removal to/from the conference session.
*/
+ @UnsupportedAppUsage
void callSessionInviteParticipantsRequestDelivered(in IImsCallSession session);
+ @UnsupportedAppUsage
void callSessionInviteParticipantsRequestFailed(in IImsCallSession session,
in ImsReasonInfo reasonInfo);
void callSessionRemoveParticipantsRequestDelivered(in IImsCallSession session);
@@ -91,6 +107,7 @@
/**
* Notifies the changes of the conference info. in the conference session.
*/
+ @UnsupportedAppUsage
void callSessionConferenceStateUpdated(in IImsCallSession session,
in ImsConferenceState state);
@@ -103,8 +120,10 @@
/**
* Notifies of handover information for this call
*/
+ @UnsupportedAppUsage
void callSessionHandover(in IImsCallSession session,
in int srcAccessTech, in int targetAccessTech, in ImsReasonInfo reasonInfo);
+ @UnsupportedAppUsage
void callSessionHandoverFailed(in IImsCallSession session,
in int srcAccessTech, in int targetAccessTech, in ImsReasonInfo reasonInfo);
void callSessionMayHandover(in IImsCallSession session,
@@ -118,6 +137,7 @@
* - {@link com.android.internal.telephony.Phone#TTY_MODE_HCO}
* - {@link com.android.internal.telephony.Phone#TTY_MODE_VCO}
*/
+ @UnsupportedAppUsage
void callSessionTtyModeReceived(in IImsCallSession session, in int mode);
/**
@@ -126,11 +146,13 @@
* @param session The call session.
* @param isMultiParty {@code true} if the session became multiparty, {@code false} otherwise.
*/
+ @UnsupportedAppUsage
void callSessionMultipartyStateChanged(in IImsCallSession session, in boolean isMultiParty);
/**
* Notifies the supplementary service information for the current session.
*/
+ @UnsupportedAppUsage
void callSessionSuppServiceReceived(in IImsCallSession session,
in ImsSuppServiceNotification suppSrvNotification);
diff --git a/telephony/java/com/android/ims/internal/IImsRegistrationListener.aidl b/telephony/java/com/android/ims/internal/IImsRegistrationListener.aidl
index 2212109..a7a62a6 100644
--- a/telephony/java/com/android/ims/internal/IImsRegistrationListener.aidl
+++ b/telephony/java/com/android/ims/internal/IImsRegistrationListener.aidl
@@ -32,6 +32,7 @@
*
* @deprecated see {@link registrationConnectedWithRadioTech}
*/
+ @UnsupportedAppUsage
void registrationConnected();
/**
@@ -47,6 +48,7 @@
* @param imsRadioTech the radio access technology. Valid values are {@code
* RIL_RADIO_TECHNOLOGY_*} defined in {@link ServiceState}.
*/
+ @UnsupportedAppUsage
void registrationConnectedWithRadioTech(int imsRadioTech);
/**
@@ -55,12 +57,14 @@
* @param imsRadioTech the radio access technology. Valid values are {@code
* RIL_RADIO_TECHNOLOGY_*} defined in {@link ServiceState}.
*/
+ @UnsupportedAppUsage
void registrationProgressingWithRadioTech(int imsRadioTech);
/**
* Notifies the application when the device is disconnected from the IMS network.
*/
+ @UnsupportedAppUsage
void registrationDisconnected(in ImsReasonInfo imsReasonInfo);
/**
@@ -94,6 +98,7 @@
* @param enabledFeatures features enabled as defined in com.android.ims.ImsConfig#FeatureConstants.
* @param disabledFeatures features disabled as defined in com.android.ims.ImsConfig#FeatureConstants.
*/
+ @UnsupportedAppUsage
void registrationFeatureCapabilityChanged(int serviceClass,
in int[] enabledFeatures, in int[] disabledFeatures);
@@ -101,11 +106,13 @@
* Updates the application with the waiting voice message count.
* @param count The number of waiting voice messages.
*/
+ @UnsupportedAppUsage
void voiceMessageCountUpdate(int count);
/**
* Notifies the application when the list of URIs associated with IMS client is updated.
*/
+ @UnsupportedAppUsage
void registrationAssociatedUriChanged(in Uri[] uris);
/**
@@ -116,5 +123,6 @@
* attempted.
* @param imsReasonInfo Reason for the failure.
*/
+ @UnsupportedAppUsage
void registrationChangeFailed(in int targetAccessTech, in ImsReasonInfo imsReasonInfo);
}
diff --git a/telephony/java/com/android/ims/internal/IImsUtListener.aidl b/telephony/java/com/android/ims/internal/IImsUtListener.aidl
index a603cd3..fcb9fb1 100644
--- a/telephony/java/com/android/ims/internal/IImsUtListener.aidl
+++ b/telephony/java/com/android/ims/internal/IImsUtListener.aidl
@@ -31,30 +31,37 @@
/**
* Notifies the result of the supplementary service configuration udpate.
*/
+ @UnsupportedAppUsage
void utConfigurationUpdated(in IImsUt ut, int id);
+ @UnsupportedAppUsage
void utConfigurationUpdateFailed(in IImsUt ut, int id, in ImsReasonInfo error);
/**
* Notifies the result of the supplementary service configuration query.
*/
+ @UnsupportedAppUsage
void utConfigurationQueried(in IImsUt ut, int id, in Bundle ssInfo);
+ @UnsupportedAppUsage
void utConfigurationQueryFailed(in IImsUt ut, int id, in ImsReasonInfo error);
/**
* Notifies the status of the call barring supplementary service.
*/
+ @UnsupportedAppUsage
void utConfigurationCallBarringQueried(in IImsUt ut,
int id, in ImsSsInfo[] cbInfo);
/**
* Notifies the status of the call forwarding supplementary service.
*/
+ @UnsupportedAppUsage
void utConfigurationCallForwardQueried(in IImsUt ut,
int id, in ImsCallForwardInfo[] cfInfo);
/**
* Notifies the status of the call waiting supplementary service.
*/
+ @UnsupportedAppUsage
void utConfigurationCallWaitingQueried(in IImsUt ut,
int id, in ImsSsInfo[] cwInfo);
diff --git a/telephony/java/com/android/ims/internal/IImsVideoCallCallback.aidl b/telephony/java/com/android/ims/internal/IImsVideoCallCallback.aidl
index 9499c9f..cf8d637 100644
--- a/telephony/java/com/android/ims/internal/IImsVideoCallCallback.aidl
+++ b/telephony/java/com/android/ims/internal/IImsVideoCallCallback.aidl
@@ -31,18 +31,25 @@
* {@hide}
*/
oneway interface IImsVideoCallCallback {
+ @UnsupportedAppUsage
void receiveSessionModifyRequest(in VideoProfile videoProfile);
+ @UnsupportedAppUsage
void receiveSessionModifyResponse(int status, in VideoProfile requestedProfile,
in VideoProfile responseProfile);
+ @UnsupportedAppUsage
void handleCallSessionEvent(int event);
+ @UnsupportedAppUsage
void changePeerDimensions(int width, int height);
+ @UnsupportedAppUsage
void changeCallDataUsage(long dataUsage);
+ @UnsupportedAppUsage
void changeCameraCapabilities(in VideoProfile.CameraCapabilities cameraCapabilities);
+ @UnsupportedAppUsage
void changeVideoQuality(int videoQuality);
}
diff --git a/telephony/java/com/android/ims/internal/IImsVideoCallProvider.aidl b/telephony/java/com/android/ims/internal/IImsVideoCallProvider.aidl
index 0da27e1..4d20bd6 100644
--- a/telephony/java/com/android/ims/internal/IImsVideoCallProvider.aidl
+++ b/telephony/java/com/android/ims/internal/IImsVideoCallProvider.aidl
@@ -41,6 +41,7 @@
* @hide
*/
oneway interface IImsVideoCallProvider {
+ @UnsupportedAppUsage
void setCallback(IImsVideoCallCallback callback);
void setCamera(String cameraId, int uid);
diff --git a/telephony/java/com/android/ims/internal/uce/options/IOptionsListener.aidl b/telephony/java/com/android/ims/internal/uce/options/IOptionsListener.aidl
index 8cb1153..c69d5a9 100644
--- a/telephony/java/com/android/ims/internal/uce/options/IOptionsListener.aidl
+++ b/telephony/java/com/android/ims/internal/uce/options/IOptionsListener.aidl
@@ -29,6 +29,7 @@
* @param version, version information of the service.
* @hide
*/
+ @UnsupportedAppUsage
void getVersionCb(in String version );
/**
@@ -37,6 +38,7 @@
* @param statusCode, UCE_SUCCESS as service availability.
* @hide
*/
+ @UnsupportedAppUsage
void serviceAvailable(in StatusCode statusCode);
/**
@@ -45,6 +47,7 @@
* @param statusCode, UCE_SUCCESS as service unavailability.
* @hide
*/
+ @UnsupportedAppUsage
void serviceUnavailable(in StatusCode statusCode);
/**
@@ -55,6 +58,7 @@
* @param capInfo, capabilities of the remote entity received.
* @hide
*/
+ @UnsupportedAppUsage
void sipResponseReceived( String uri,
in OptionsSipResponse sipResponse, in OptionsCapInfo capInfo);
@@ -63,6 +67,7 @@
* @param cmdStatus, command status of the request placed.
* @hide
*/
+ @UnsupportedAppUsage
void cmdStatus(in OptionsCmdStatus cmdStatus);
/**
@@ -73,6 +78,7 @@
* @param tID, transation of the request received from network.
* @hide
*/
+ @UnsupportedAppUsage
void incomingOptions( String uri, in OptionsCapInfo capInfo,
in int tID);
}
diff --git a/telephony/java/com/android/ims/internal/uce/options/IOptionsService.aidl b/telephony/java/com/android/ims/internal/uce/options/IOptionsService.aidl
index 839bb55..2e49082 100644
--- a/telephony/java/com/android/ims/internal/uce/options/IOptionsService.aidl
+++ b/telephony/java/com/android/ims/internal/uce/options/IOptionsService.aidl
@@ -33,6 +33,7 @@
* @return StatusCode, status of the request placed.
* @hide
*/
+ @UnsupportedAppUsage
StatusCode getVersion(int optionsServiceHandle);
/**
@@ -44,6 +45,7 @@
* The service will fill UceLong.mUceLong with optionsServiceListenerHdl
* @return StatusCode, status of the request placed.
*/
+ @UnsupportedAppUsage
StatusCode addListener(int optionsServiceHandle, IOptionsListener optionsListener,
inout UceLong optionsServiceListenerHdl);
@@ -54,6 +56,7 @@
* @param optionsServiceListenerHdl provided in createOptionsService() or Addlistener().
* @return StatusCode, status of the request placed.
*/
+ @UnsupportedAppUsage
StatusCode removeListener(int optionsServiceHandle, in UceLong optionsServiceListenerHdl);
/**
@@ -66,6 +69,7 @@
* with original request.
* @return StatusCode, status of the request placed.
*/
+ @UnsupportedAppUsage
StatusCode setMyInfo(int optionsServiceHandle , in CapInfo capInfo, int reqUserData);
@@ -78,6 +82,7 @@
* with original request.
* @return StatusCode, status of the request placed.
*/
+ @UnsupportedAppUsage
StatusCode getMyInfo(int optionsServiceHandle , int reqUserdata);
/**
@@ -90,6 +95,7 @@
* with original request.
* @return StatusCode, status of the request placed.
*/
+ @UnsupportedAppUsage
StatusCode getContactCap(int optionsServiceHandle , String remoteURI, int reqUserData);
@@ -103,6 +109,7 @@
* with original request.
* @return StatusCode, status of the request placed.
*/
+ @UnsupportedAppUsage
StatusCode getContactListCap(int optionsServiceHandle, in String[] remoteURIList,
int reqUserData);
@@ -119,6 +126,7 @@
* @param bContactInBL, true if the contact is blacklisted, else false.
* @return StatusCode, status of the request placed.
*/
+ @UnsupportedAppUsage
StatusCode responseIncomingOptions(int optionsServiceHandle, int tId, int sipResponseCode,
String reasonPhrase, in OptionsCapInfo capInfo,
in boolean bContactInBL);
diff --git a/telephony/java/com/android/ims/internal/uce/presence/IPresenceListener.aidl b/telephony/java/com/android/ims/internal/uce/presence/IPresenceListener.aidl
index 2ae424f..65e7fc9 100644
--- a/telephony/java/com/android/ims/internal/uce/presence/IPresenceListener.aidl
+++ b/telephony/java/com/android/ims/internal/uce/presence/IPresenceListener.aidl
@@ -36,6 +36,7 @@
* Gets the version of the presence listener implementation.
* @param version, version information.
*/
+ @UnsupportedAppUsage
void getVersionCb(in String version );
/**
@@ -43,6 +44,7 @@
* availability.
* @param statusCode, UCE_SUCCESS as service availability.
*/
+ @UnsupportedAppUsage
void serviceAvailable(in StatusCode statusCode);
/**
@@ -50,6 +52,7 @@
* unavailability.
* @param statusCode, UCE_SUCCESS as service unAvailability.
*/
+ @UnsupportedAppUsage
void serviceUnAvailable(in StatusCode statusCode);
/**
@@ -57,12 +60,14 @@
* publish request.
* @param publishTrigger, Publish trigger for the network being supported.
*/
+ @UnsupportedAppUsage
void publishTriggering(in PresPublishTriggerType publishTrigger);
/**
* Callback function to be invoked to inform the client of the status of an asynchronous call.
* @param cmdStatus, command status of the request placed.
*/
+ @UnsupportedAppUsage
void cmdStatus( in PresCmdStatus cmdStatus);
/**
@@ -70,6 +75,7 @@
* such as PUBLISH or SUBSCRIBE, has been received.
* @param sipResponse, network response received for the request placed.
*/
+ @UnsupportedAppUsage
void sipResponseReceived(in PresSipResponse sipResponse);
/**
@@ -78,6 +84,7 @@
* @param presentityURI, URI of the remote entity the request was placed.
* @param tupleInfo, array of capability information remote entity supports.
*/
+ @UnsupportedAppUsage
void capInfoReceived(in String presentityURI,
in PresTupleInfo [] tupleInfo);
@@ -87,6 +94,7 @@
* @param rlmiInfo, resource infomation received from network.
* @param resInfo, array of capabilities received from network for the list of remore URI.
*/
+ @UnsupportedAppUsage
void listCapInfoReceived(in PresRlmiInfo rlmiInfo,
in PresResInfo [] resInfo);
@@ -94,6 +102,7 @@
* Callback function to be invoked to inform the client when Unpublish message
* is sent to network.
*/
+ @UnsupportedAppUsage
void unpublishMessageSent();
}
\ No newline at end of file
diff --git a/telephony/java/com/android/ims/internal/uce/presence/IPresenceService.aidl b/telephony/java/com/android/ims/internal/uce/presence/IPresenceService.aidl
index fdea6d3..26a3e83 100644
--- a/telephony/java/com/android/ims/internal/uce/presence/IPresenceService.aidl
+++ b/telephony/java/com/android/ims/internal/uce/presence/IPresenceService.aidl
@@ -33,6 +33,7 @@
* @param presenceServiceHdl returned in createPresenceService().
* @return StatusCode, status of the request placed.
*/
+ @UnsupportedAppUsage
StatusCode getVersion(int presenceServiceHdl);
/**
@@ -45,6 +46,7 @@
*
* @return StatusCode, status of the request placed
*/
+ @UnsupportedAppUsage
StatusCode addListener(int presenceServiceHdl, IPresenceListener presenceServiceListener,
inout UceLong presenceServiceListenerHdl);
@@ -54,6 +56,7 @@
* @param presenceServiceListenerHdl provided in createPresenceService() or Addlistener().
* @return StatusCode, status of the request placed.
*/
+ @UnsupportedAppUsage
StatusCode removeListener(int presenceServiceHdl, in UceLong presenceServiceListenerHdl);
/**
@@ -69,6 +72,7 @@
* with original request.
* @return StatusCode, status of the request placed.
*/
+ @UnsupportedAppUsage
StatusCode reenableService(int presenceServiceHdl, int userData);
/**
@@ -81,6 +85,7 @@
* with original request.
* @return StatusCode, status of the request placed.
*/
+ @UnsupportedAppUsage
StatusCode publishMyCap(int presenceServiceHdl, in PresCapInfo myCapInfo , int userData);
/**
@@ -94,6 +99,7 @@
* with original request.
* @return StatusCode, status of the request placed.
*/
+ @UnsupportedAppUsage
StatusCode getContactCap(int presenceServiceHdl , String remoteUri, int userData);
/**
@@ -107,6 +113,7 @@
* with original request.
* @return StatusCode, status of the request placed.
*/
+ @UnsupportedAppUsage
StatusCode getContactListCap(int presenceServiceHdl, in String[] remoteUriList, int userData);
/**
@@ -122,6 +129,7 @@
* with original request.
* @return StatusCode, status of the request placed.
*/
+ @UnsupportedAppUsage
StatusCode setNewFeatureTag(int presenceServiceHdl, String featureTag,
in PresServiceInfo serviceInfo, int userData);
diff --git a/telephony/java/com/android/ims/internal/uce/uceservice/IUceListener.aidl b/telephony/java/com/android/ims/internal/uce/uceservice/IUceListener.aidl
index 13707a1..41abf7d 100644
--- a/telephony/java/com/android/ims/internal/uce/uceservice/IUceListener.aidl
+++ b/telephony/java/com/android/ims/internal/uce/uceservice/IUceListener.aidl
@@ -25,5 +25,6 @@
* @param serviceStatusValue defined in ImsUceManager
* @hide
*/
+ @UnsupportedAppUsage
void setStatus(int serviceStatusValue);
}
diff --git a/telephony/java/com/android/ims/internal/uce/uceservice/IUceService.aidl b/telephony/java/com/android/ims/internal/uce/uceservice/IUceService.aidl
index 1fb8513..ec45371 100644
--- a/telephony/java/com/android/ims/internal/uce/uceservice/IUceService.aidl
+++ b/telephony/java/com/android/ims/internal/uce/uceservice/IUceService.aidl
@@ -38,6 +38,7 @@
* Service status is returned in setStatus callback in IUceListener.
* @hide
*/
+ @UnsupportedAppUsage
boolean startService(IUceListener uceListener);
/**
@@ -45,6 +46,7 @@
* @return boolean true if the service stop request is processed successfully, FALSE otherwise.
* @hide
*/
+ @UnsupportedAppUsage
boolean stopService();
@@ -54,6 +56,7 @@
* @return boolean true if service started else false.
* @hide
*/
+ @UnsupportedAppUsage
boolean isServiceStarted();
/**
@@ -71,6 +74,7 @@
*
* @deprecated This is replaced with new API createOptionsServiceForSubscription()
*/
+ @UnsupportedAppUsage
int createOptionsService(IOptionsListener optionsListener,
inout UceLong optionsServiceListenerHdl);
/**
@@ -97,6 +101,7 @@
* in IOptionsListener
* @hide
*/
+ @UnsupportedAppUsage
void destroyOptionsService(int optionsServiceHandle);
/**
@@ -114,6 +119,7 @@
*
* @deprecated This is replaced with new API createPresenceServiceForSubscription()
*/
+ @UnsupportedAppUsage
int createPresenceService(IPresenceListener presenceServiceListener,
inout UceLong presenceServiceListenerHdl);
/**
@@ -141,6 +147,7 @@
*
* @hide
*/
+ @UnsupportedAppUsage
void destroyPresenceService(int presenceServiceHdl);
@@ -152,6 +159,7 @@
*
* @hide
*/
+ @UnsupportedAppUsage
boolean getServiceStatus();
/**
@@ -163,6 +171,7 @@
*
* @deprecated use API getPresenceServiceForSubscription()
*/
+ @UnsupportedAppUsage
IPresenceService getPresenceService();
/**
@@ -185,6 +194,7 @@
*
* @hide
*/
+ @UnsupportedAppUsage
IOptionsService getOptionsService();
/**
diff --git a/telephony/java/com/android/internal/telephony/ICarrierConfigLoader.aidl b/telephony/java/com/android/internal/telephony/ICarrierConfigLoader.aidl
index 5cd67d9..8e50a8f 100644
--- a/telephony/java/com/android/internal/telephony/ICarrierConfigLoader.aidl
+++ b/telephony/java/com/android/internal/telephony/ICarrierConfigLoader.aidl
@@ -23,6 +23,7 @@
*/
interface ICarrierConfigLoader {
+ @UnsupportedAppUsage
PersistableBundle getConfigForSubId(int subId, String callingPackage);
void overrideConfig(int subId, in PersistableBundle overrides);
diff --git a/telephony/java/com/android/internal/telephony/IPhoneStateListener.aidl b/telephony/java/com/android/internal/telephony/IPhoneStateListener.aidl
index 322ce45..4a263f0 100644
--- a/telephony/java/com/android/internal/telephony/IPhoneStateListener.aidl
+++ b/telephony/java/com/android/internal/telephony/IPhoneStateListener.aidl
@@ -54,7 +54,7 @@
void onCarrierNetworkChange(in boolean active);
void onUserMobileDataStateChanged(in boolean enabled);
void onPhoneCapabilityChanged(in PhoneCapability capability);
- void onPreferredDataSubIdChanged(in int subId);
+ void onActiveDataSubIdChanged(in int subId);
void onRadioPowerStateChanged(in int state);
void onCallAttributesChanged(in CallAttributes callAttributes);
void onEmergencyNumberListChanged(in Map emergencyNumberList);
diff --git a/telephony/java/com/android/internal/telephony/IPhoneSubInfo.aidl b/telephony/java/com/android/internal/telephony/IPhoneSubInfo.aidl
index 93964f3..ec16696 100644
--- a/telephony/java/com/android/internal/telephony/IPhoneSubInfo.aidl
+++ b/telephony/java/com/android/internal/telephony/IPhoneSubInfo.aidl
@@ -60,6 +60,7 @@
/**
* Retrieves the unique sbuscriber ID, e.g., IMSI for GSM phones.
*/
+ @UnsupportedAppUsage
String getSubscriberId(String callingPackage);
/**
@@ -75,6 +76,7 @@
/**
* Retrieves the serial number of the ICC, if applicable.
*/
+ @UnsupportedAppUsage
String getIccSerialNumber(String callingPackage);
/**
diff --git a/telephony/java/com/android/internal/telephony/ISetOpportunisticDataCallback.aidl b/telephony/java/com/android/internal/telephony/ISetOpportunisticDataCallback.aidl
new file mode 100644
index 0000000..7a78f34
--- /dev/null
+++ b/telephony/java/com/android/internal/telephony/ISetOpportunisticDataCallback.aidl
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.internal.telephony;
+
+/**
+ * Callback to provide asynchronous result of setPreferredOpportunisticData.
+ * @hide
+ */
+oneway interface ISetOpportunisticDataCallback {
+ void onComplete(int result);
+}
diff --git a/telephony/java/com/android/internal/telephony/ISub.aidl b/telephony/java/com/android/internal/telephony/ISub.aidl
index 6ce9de4..4a4506f 100755
--- a/telephony/java/com/android/internal/telephony/ISub.aidl
+++ b/telephony/java/com/android/internal/telephony/ISub.aidl
@@ -17,6 +17,7 @@
package com.android.internal.telephony;
import android.telephony.SubscriptionInfo;
+import com.android.internal.telephony.ISetOpportunisticDataCallback;
interface ISub {
/**
@@ -217,10 +218,14 @@
* designed to overwrite default data subscription temporarily.
*
* @param subId which subscription is preferred to for cellular data.
+ * @param needValidation whether validation is needed before switching.
+ * @param callback callback upon request completion.
+ *
* @hide
*
*/
- void setPreferredDataSubscriptionId(int subId);
+ void setPreferredDataSubscriptionId(int subId, boolean needValidation,
+ ISetOpportunisticDataCallback callback);
/**
* Get which subscription is preferred for cellular data.
@@ -246,6 +251,7 @@
int[] getSubId(int slotIndex);
+ @UnsupportedAppUsage
int getDefaultSubId();
int clearSubInfo();
@@ -256,8 +262,10 @@
* Get the default data subscription
* @return Id of the data subscription
*/
+ @UnsupportedAppUsage
int getDefaultDataSubId();
+ @UnsupportedAppUsage
void setDefaultDataSubId(int subId);
int getDefaultVoiceSubId();
@@ -270,6 +278,7 @@
void clearDefaultsForInactiveSubIds();
+ @UnsupportedAppUsage
int[] getActiveSubIdList();
int setSubscriptionProperty(int subId, String propKey, String propValue);
diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl
index 3ca2449..6366b91 100644
--- a/telephony/java/com/android/internal/telephony/ITelephony.aidl
+++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl
@@ -76,6 +76,7 @@
* @param number the number to be dialed. If null, this
* would display the Dialer screen with no number pre-filled.
*/
+ @UnsupportedAppUsage
void dial(String number);
/**
@@ -83,6 +84,7 @@
* @param callingPackage The package making the call.
* @param number the number to be called.
*/
+ @UnsupportedAppUsage
void call(String callingPackage, String number);
/**
@@ -98,6 +100,7 @@
* @param callingPackage the name of the package making the call.
* @return returns true if the radio is on.
*/
+ @UnsupportedAppUsage
boolean isRadioOnForSubscriber(int subId, String callingPackage);
/**
@@ -105,6 +108,7 @@
* @param pin The pin to check.
* @return whether the operation was a success.
*/
+ @UnsupportedAppUsage
boolean supplyPin(String pin);
/**
@@ -182,6 +186,7 @@
* @param dialString the MMI command to be executed.
* @return true if MMI command is executed.
*/
+ @UnsupportedAppUsage
boolean handlePinMmi(String dialString);
@@ -202,11 +207,13 @@
* @param subId user preferred subId.
* @return true if MMI command is executed.
*/
+ @UnsupportedAppUsage
boolean handlePinMmiForSubscriber(int subId, String dialString);
/**
* Toggles the radio on or off.
*/
+ @UnsupportedAppUsage
void toggleRadioOnOff();
/**
@@ -218,6 +225,7 @@
/**
* Set the radio to on or off
*/
+ @UnsupportedAppUsage
boolean setRadio(boolean turnOn);
/**
@@ -234,6 +242,7 @@
/**
* Request to update location information in service state
*/
+ @UnsupportedAppUsage
void updateServiceLocation();
/**
@@ -245,6 +254,7 @@
/**
* Enable location update notifications.
*/
+ @UnsupportedAppUsage
void enableLocationUpdates();
/**
@@ -256,6 +266,7 @@
/**
* Disable location update notifications.
*/
+ @UnsupportedAppUsage
void disableLocationUpdates();
/**
@@ -267,11 +278,13 @@
/**
* Allow mobile data connections.
*/
+ @UnsupportedAppUsage
boolean enableDataConnectivity();
/**
* Disallow mobile data connections.
*/
+ @UnsupportedAppUsage
boolean disableDataConnectivity();
/**
@@ -293,6 +306,7 @@
*/
List<NeighboringCellInfo> getNeighboringCellInfo(String callingPkg);
+ @UnsupportedAppUsage
int getCallState();
/**
@@ -300,7 +314,9 @@
*/
int getCallStateForSlot(int slotIndex);
+ @UnsupportedAppUsage
int getDataActivity();
+ @UnsupportedAppUsage
int getDataState();
/**
@@ -308,6 +324,7 @@
* Returns TelephonyManager.PHONE_TYPE_CDMA if RILConstants.CDMA_PHONE
* and TelephonyManager.PHONE_TYPE_GSM if RILConstants.GSM_PHONE
*/
+ @UnsupportedAppUsage
int getActivePhoneType();
/**
@@ -444,6 +461,7 @@
* Returns the network type for data transmission
* Legacy call, permission-free
*/
+ @UnsupportedAppUsage
int getNetworkType();
/**
@@ -477,6 +495,7 @@
/**
* Return true if an ICC card is present
*/
+ @UnsupportedAppUsage
boolean hasIccCard();
/**
@@ -557,6 +576,7 @@
* successful iccOpenLogicalChannel.
* @return true if the channel was closed successfully.
*/
+ @UnsupportedAppUsage
boolean iccCloseLogicalChannel(int subId, int channel);
/**
@@ -577,6 +597,7 @@
* @return The APDU response from the ICC card with the status appended at
* the end.
*/
+ @UnsupportedAppUsage
String iccTransmitApduLogicalChannel(int subId, int channel, int cla, int instruction,
int p1, int p2, int p3, String data);
@@ -700,13 +721,12 @@
int getPreferredNetworkType(int subId);
/**
- * Check TETHER_DUN_REQUIRED and TETHER_DUN_APN settings, net.tethering.noprovisioning
- * SystemProperty to decide whether DUN APN is required for
- * tethering.
+ * Check whether DUN APN is required for tethering.
*
- * @return 0: Not required. 1: required. 2: Not set.
+ * @return {@code true} if DUN APN is required for tethering.
+ * @hide
*/
- int getTetherApnRequired();
+ boolean getTetherApnRequired();
/**
* Enables framework IMS and triggers IMS Registration.
@@ -829,6 +849,7 @@
*
* @return true on enabled
*/
+ @UnsupportedAppUsage
boolean getDataEnabled(int subId);
/**
@@ -1671,7 +1692,7 @@
/**
* Modify the user's setting for whether or not 4G LTE is enabled.
*/
- void setAdvancedCallingSetting(int subId, boolean isEnabled);
+ void setAdvancedCallingSettingEnabled(int subId, boolean isEnabled);
/**
* return true if the user's setting for VT is enabled for the subscription.
@@ -1681,7 +1702,7 @@
/**
* Modify the user's setting for whether or not VT is available for the subscrption specified.
*/
- void setVtSetting(int subId, boolean isEnabled);
+ void setVtSettingEnabled(int subId, boolean isEnabled);
/**
* return true if the user's setting for whether or not Voice over WiFi is currently enabled.
@@ -1691,7 +1712,7 @@
/**
* sets the user's setting for Voice over WiFi enabled state.
*/
- void setVoWiFiSetting(int subId, boolean isEnabled);
+ void setVoWiFiSettingEnabled(int subId, boolean isEnabled);
/**
* return true if the user's setting for Voice over WiFi while roaming is enabled.
@@ -1702,7 +1723,7 @@
* Sets the user's preference for whether or not Voice over WiFi is enabled for the current
* subscription while roaming.
*/
- void setVoWiFiRoamingSetting(int subId, boolean isEnabled);
+ void setVoWiFiRoamingSettingEnabled(int subId, boolean isEnabled);
/**
* Set the Voice over WiFi enabled state, but do not persist the setting.
diff --git a/telephony/java/com/android/internal/telephony/ITelephonyRegistry.aidl b/telephony/java/com/android/internal/telephony/ITelephonyRegistry.aidl
index 5719124..0610c5d 100644
--- a/telephony/java/com/android/internal/telephony/ITelephonyRegistry.aidl
+++ b/telephony/java/com/android/internal/telephony/ITelephonyRegistry.aidl
@@ -38,9 +38,11 @@
IOnSubscriptionsChangedListener callback);
void removeOnSubscriptionsChangedListener(String pkg,
IOnSubscriptionsChangedListener callback);
+ @UnsupportedAppUsage
void listen(String pkg, IPhoneStateListener callback, int events, boolean notifyNow);
void listenForSubscriber(in int subId, String pkg, IPhoneStateListener callback, int events,
boolean notifyNow);
+ @UnsupportedAppUsage
void notifyCallState(int state, String incomingNumber);
void notifyCallStateForPhoneId(in int phoneId, in int subId, int state, String incomingNumber);
void notifyServiceStateForPhoneId(in int phoneId, in int subId, in ServiceState state);
@@ -57,11 +59,13 @@
void notifyDataConnectionForSubscriber(int subId, int state, boolean isDataConnectivityPossible,
String apn, String apnType, in LinkProperties linkProperties,
in NetworkCapabilities networkCapabilities, int networkType, boolean roaming);
+ @UnsupportedAppUsage
void notifyDataConnectionFailed(String apnType);
void notifyDataConnectionFailedForSubscriber(int subId, String apnType);
void notifyCellLocation(in Bundle cellLocation);
void notifyCellLocationForSubscriber(in int subId, in Bundle cellLocation);
void notifyOtaspChanged(in int otaspMode);
+ @UnsupportedAppUsage
void notifyCellInfo(in List<CellInfo> cellInfo);
void notifyPhysicalChannelConfiguration(in List<PhysicalChannelConfig> configs);
void notifyPhysicalChannelConfigurationForSubscriber(in int subId,
@@ -81,7 +85,7 @@
void notifyCarrierNetworkChange(in boolean active);
void notifyUserMobileDataStateChangedForPhoneId(in int phoneId, in int subId, in boolean state);
void notifyPhoneCapabilityChanged(in PhoneCapability capability);
- void notifyPreferredDataSubIdChanged(int preferredSubId);
+ void notifyActiveDataSubIdChanged(int activeDataSubId);
void notifyRadioPowerStateChanged(in int state);
void notifyEmergencyNumberList();
void notifyCallQualityChanged(in CallQuality callQuality, int phoneId, int callNetworkType);
diff --git a/telephony/java/com/android/internal/telephony/IWapPushManager.aidl b/telephony/java/com/android/internal/telephony/IWapPushManager.aidl
index d5ecb94..1c3df65 100644
--- a/telephony/java/com/android/internal/telephony/IWapPushManager.aidl
+++ b/telephony/java/com/android/internal/telephony/IWapPushManager.aidl
@@ -30,6 +30,7 @@
* Returns true if inserting the information is successfull. Inserting the duplicated
* record in the application ID table is not allowed. Use update/delete method.
*/
+ @UnsupportedAppUsage
boolean addPackage(String x_app_id, String content_type,
String package_name, String class_name,
int app_type, boolean need_signature, boolean further_processing);
@@ -38,6 +39,7 @@
* Updates receiver application that is last added.
* Returns true if updating the information is successfull.
*/
+ @UnsupportedAppUsage
boolean updatePackage(String x_app_id, String content_type,
String package_name, String class_name,
int app_type, boolean need_signature, boolean further_processing);
@@ -46,6 +48,7 @@
* Delites receiver application information.
* Returns true if deleting is successfull.
*/
+ @UnsupportedAppUsage
boolean deletePackage(String x_app_id, String content_type,
String package_name, String class_name);
}
diff --git a/telephony/java/com/android/internal/telephony/PhoneConstants.java b/telephony/java/com/android/internal/telephony/PhoneConstants.java
index e87d28c..d5061a3 100644
--- a/telephony/java/com/android/internal/telephony/PhoneConstants.java
+++ b/telephony/java/com/android/internal/telephony/PhoneConstants.java
@@ -141,6 +141,8 @@
/** APN type for Emergency PDN. This is not an IA apn, but is used
* for access to carrier services in an emergency call situation. */
public static final String APN_TYPE_EMERGENCY = "emergency";
+ /** APN type for Mission Critical Services */
+ public static final String APN_TYPE_MCX = "mcx";
/** Array of all APN types */
public static final String[] APN_TYPES = {APN_TYPE_DEFAULT,
APN_TYPE_MMS,
@@ -151,7 +153,8 @@
APN_TYPE_IMS,
APN_TYPE_CBS,
APN_TYPE_IA,
- APN_TYPE_EMERGENCY
+ APN_TYPE_EMERGENCY,
+ APN_TYPE_MCX
};
public static final int RIL_CARD_MAX_APPS = 8;
diff --git a/telephony/java/com/android/internal/telephony/RILConstants.java b/telephony/java/com/android/internal/telephony/RILConstants.java
index 77b7979..5205973 100644
--- a/telephony/java/com/android/internal/telephony/RILConstants.java
+++ b/telephony/java/com/android/internal/telephony/RILConstants.java
@@ -470,6 +470,7 @@
int RIL_REQUEST_START_KEEPALIVE = 144;
int RIL_REQUEST_STOP_KEEPALIVE = 145;
int RIL_REQUEST_ENABLE_MODEM = 146;
+ int RIL_REQUEST_GET_MODEM_STATUS = 147;
/* The following requests are not defined in RIL.h */
int RIL_REQUEST_HAL_NON_RIL_BASE = 200;
diff --git a/test-base/hiddenapi/Android.bp b/test-base/hiddenapi/Android.bp
new file mode 100644
index 0000000..c4e0fab
--- /dev/null
+++ b/test-base/hiddenapi/Android.bp
@@ -0,0 +1,29 @@
+//
+// Copyright (C) 2019 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+// Provided solely to contribute information about which hidden parts of the android.test.base
+// library are used by apps. The source files are stubs of the actual files in ../src which use the
+// UnsupportedAppUsage annotation to tag those methods that are accessible via the hiddenapi.
+// Relies on the convention that modules with name <x>-hiddenapi provide hiddenapi information for
+// module <x> that is on the bootclasspath.
+java_library {
+ name: "android.test.base-hiddenapi",
+ compile_dex: true,
+
+ srcs: ["src/**/*.java"],
+
+ libs: ["android.test.base"],
+}
diff --git a/test-base/hiddenapi/src/android/test/AndroidTestCase.java b/test-base/hiddenapi/src/android/test/AndroidTestCase.java
new file mode 100644
index 0000000..2b9beb1
--- /dev/null
+++ b/test-base/hiddenapi/src/android/test/AndroidTestCase.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.test;
+
+import android.annotation.UnsupportedAppUsage;
+import android.content.Context;
+
+import junit.framework.TestCase;
+
+/**
+ * @deprecated Stub only
+ */
+@SuppressWarnings({ "unchecked", "deprecation", "all" })
+@Deprecated
+public class AndroidTestCase extends TestCase {
+
+ /**
+ * Stub only
+ */
+ @UnsupportedAppUsage
+ public void setTestContext(Context context) {
+ throw new RuntimeException("Stub!");
+ }
+
+ /**
+ * Stub only
+ */
+ @UnsupportedAppUsage
+ public Context getTestContext() {
+ throw new RuntimeException("Stub!");
+ }
+}
diff --git a/test-base/hiddenapi/src/android/test/InstrumentationTestCase.java b/test-base/hiddenapi/src/android/test/InstrumentationTestCase.java
new file mode 100644
index 0000000..139cd18
--- /dev/null
+++ b/test-base/hiddenapi/src/android/test/InstrumentationTestCase.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.test;
+
+import android.annotation.UnsupportedAppUsage;
+
+import junit.framework.TestCase;
+
+import java.lang.reflect.Method;
+
+/**
+ * @deprecated Stub only
+ */
+@SuppressWarnings({ "unchecked", "deprecation", "all" })
+@Deprecated
+public class InstrumentationTestCase extends TestCase {
+
+ /**
+ * Stub only
+ */
+ @UnsupportedAppUsage
+ private void runMethod(Method runMethod, int tolerance) throws Throwable {
+ throw new RuntimeException("Stub!");
+ }
+}
diff --git a/test-base/hiddenapi/src/junit/framework/TestCase.java b/test-base/hiddenapi/src/junit/framework/TestCase.java
new file mode 100644
index 0000000..5a54861
--- /dev/null
+++ b/test-base/hiddenapi/src/junit/framework/TestCase.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package junit.framework;
+
+import android.annotation.UnsupportedAppUsage;
+
+/**
+ * Stub only
+ */
+@SuppressWarnings({ "unchecked", "deprecation", "all" })
+public abstract class TestCase extends Assert implements Test {
+
+ /**
+ * the name of the test case
+ */
+ @UnsupportedAppUsage
+ private String fName;
+
+ /**
+ * Stub only
+ */
+ public int countTestCases() {
+ throw new RuntimeException("Stub!");
+ }
+
+ /**
+ * Stub only
+ */
+ public void run(TestResult result) {
+ throw new RuntimeException("Stub!");
+ }
+}
diff --git a/test-base/hiddenapi/src/junit/framework/TestSuite.java b/test-base/hiddenapi/src/junit/framework/TestSuite.java
new file mode 100644
index 0000000..368c661
--- /dev/null
+++ b/test-base/hiddenapi/src/junit/framework/TestSuite.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package junit.framework;
+
+import android.annotation.UnsupportedAppUsage;
+
+import java.lang.reflect.Method;
+
+/**
+ * Stub only
+ */
+@SuppressWarnings({ "unchecked", "deprecation", "all" })
+public class TestSuite implements Test {
+
+ /**
+ * Stub only
+ */
+ @UnsupportedAppUsage
+ private boolean isPublicTestMethod(Method m) {
+ throw new RuntimeException("Stub!");
+ }
+
+ /**
+ * Stub only
+ */
+ @UnsupportedAppUsage
+ private boolean isTestMethod(Method m) {
+ throw new RuntimeException("Stub!");
+ }
+
+ /**
+ * Stub only
+ */
+ public int countTestCases() {
+ throw new RuntimeException("Stub!");
+ }
+
+ /**
+ * Stub only
+ */
+ public void run(TestResult result) {
+ throw new RuntimeException("Stub!");
+ }
+}
diff --git a/tests/net/Android.mk b/tests/net/Android.mk
index 7e1b400..2ef141f 100644
--- a/tests/net/Android.mk
+++ b/tests/net/Android.mk
@@ -14,7 +14,7 @@
LOCAL_STATIC_JAVA_LIBRARIES := \
frameworks-base-testutils \
framework-protos \
- android-support-test \
+ androidx.test.rules \
mockito-target-minus-junit4 \
platform-test-annotations \
services.core \
diff --git a/tests/net/AndroidManifest.xml b/tests/net/AndroidManifest.xml
index 6dae3f1..dcacb6d 100644
--- a/tests/net/AndroidManifest.xml
+++ b/tests/net/AndroidManifest.xml
@@ -51,7 +51,7 @@
</application>
<instrumentation
- android:name="android.support.test.runner.AndroidJUnitRunner"
+ android:name="androidx.test.runner.AndroidJUnitRunner"
android:targetPackage="com.android.frameworks.tests.net"
android:label="Frameworks Networking Tests" />
</manifest>
diff --git a/tests/net/AndroidTest.xml b/tests/net/AndroidTest.xml
index 6e020a3..939ae49 100644
--- a/tests/net/AndroidTest.xml
+++ b/tests/net/AndroidTest.xml
@@ -22,7 +22,7 @@
<option name="test-tag" value="FrameworksNetTests" />
<test class="com.android.tradefed.testtype.AndroidJUnitTest" >
<option name="package" value="com.android.frameworks.tests.net" />
- <option name="runner" value="android.support.test.runner.AndroidJUnitRunner" />
+ <option name="runner" value="androidx.test.runner.AndroidJUnitRunner" />
<option name="hidden-api-checks" value="false"/>
</test>
</configuration>
diff --git a/tests/net/OWNERS b/tests/net/OWNERS
index 7311eee..d3836d4 100644
--- a/tests/net/OWNERS
+++ b/tests/net/OWNERS
@@ -1,8 +1,8 @@
set noparent
codewiz@google.com
-ek@google.com
jchalard@google.com
+junyulai@google.com
lorenzo@google.com
reminv@google.com
satk@google.com
diff --git a/tests/net/java/android/app/usage/NetworkStatsManagerTest.java b/tests/net/java/android/app/usage/NetworkStatsManagerTest.java
index 25e1474..fd555c1 100644
--- a/tests/net/java/android/app/usage/NetworkStatsManagerTest.java
+++ b/tests/net/java/android/app/usage/NetworkStatsManagerTest.java
@@ -26,7 +26,6 @@
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.ArgumentMatchers.argThat;
import static org.mockito.ArgumentMatchers.eq;
-import static org.mockito.Mockito.atLeastOnce;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@@ -38,9 +37,10 @@
import android.net.NetworkStatsHistory;
import android.net.NetworkTemplate;
import android.os.RemoteException;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.InstrumentationRegistry;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import org.junit.Before;
import org.junit.Test;
diff --git a/tests/net/java/android/net/ConnectivityManagerTest.java b/tests/net/java/android/net/ConnectivityManagerTest.java
index 6174c6c..7ede144 100644
--- a/tests/net/java/android/net/ConnectivityManagerTest.java
+++ b/tests/net/java/android/net/ConnectivityManagerTest.java
@@ -34,7 +34,6 @@
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.mockito.Mockito.any;
@@ -47,19 +46,20 @@
import static org.mockito.Mockito.when;
import android.app.PendingIntent;
-import android.net.ConnectivityManager;
-import android.net.NetworkCapabilities;
import android.content.Context;
+import android.content.pm.ApplicationInfo;
+import android.net.ConnectivityManager;
+import android.net.ConnectivityManager.NetworkCallback;
+import android.net.NetworkCapabilities;
+import android.os.Build.VERSION_CODES;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.os.Messenger;
-import android.content.pm.ApplicationInfo;
-import android.os.Build.VERSION_CODES;
-import android.net.ConnectivityManager.NetworkCallback;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import org.junit.Before;
import org.junit.Test;
diff --git a/tests/net/java/android/net/DnsPacketTest.java b/tests/net/java/android/net/DnsPacketTest.java
index 032e526..9ede2b8 100644
--- a/tests/net/java/android/net/DnsPacketTest.java
+++ b/tests/net/java/android/net/DnsPacketTest.java
@@ -20,8 +20,8 @@
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -36,19 +36,19 @@
int qCount, int aCount, int nsCount, int arCount) {
assertEquals(header.id, id);
assertEquals(header.flags, flag);
- assertEquals(header.getSectionCount(DnsPacket.QDSECTION), qCount);
- assertEquals(header.getSectionCount(DnsPacket.ANSECTION), aCount);
- assertEquals(header.getSectionCount(DnsPacket.NSSECTION), nsCount);
- assertEquals(header.getSectionCount(DnsPacket.ARSECTION), arCount);
+ assertEquals(header.getRecordCount(DnsPacket.QDSECTION), qCount);
+ assertEquals(header.getRecordCount(DnsPacket.ANSECTION), aCount);
+ assertEquals(header.getRecordCount(DnsPacket.NSSECTION), nsCount);
+ assertEquals(header.getRecordCount(DnsPacket.ARSECTION), arCount);
}
- private void assertSectionParses(DnsPacket.DnsSection section, String dname,
+ private void assertRecordParses(DnsPacket.DnsRecord record, String dname,
int dtype, int dclass, int ttl, byte[] rr) {
- assertEquals(section.dName, dname);
- assertEquals(section.nsType, dtype);
- assertEquals(section.nsClass, dclass);
- assertEquals(section.ttl, ttl);
- assertTrue(Arrays.equals(section.getRR(), rr));
+ assertEquals(record.dName, dname);
+ assertEquals(record.nsType, dtype);
+ assertEquals(record.nsClass, dclass);
+ assertEquals(record.ttl, ttl);
+ assertTrue(Arrays.equals(record.getRR(), rr));
}
class TestDnsPacket extends DnsPacket {
@@ -59,8 +59,8 @@
public DnsHeader getHeader() {
return mHeader;
}
- public List<DnsSection> getSectionList(int secType) {
- return mSections[secType];
+ public List<DnsRecord> getRecordList(int secType) {
+ return mRecords[secType];
}
}
@@ -101,16 +101,16 @@
// Header part
assertHeaderParses(packet.getHeader(), 0x5566, 0x8180, 1, 1, 0, 0);
- // Section part
- List<DnsPacket.DnsSection> qdSectionList =
- packet.getSectionList(DnsPacket.QDSECTION);
- assertEquals(qdSectionList.size(), 1);
- assertSectionParses(qdSectionList.get(0), "www.google.com", 1, 1, 0, null);
+ // Record part
+ List<DnsPacket.DnsRecord> qdRecordList =
+ packet.getRecordList(DnsPacket.QDSECTION);
+ assertEquals(qdRecordList.size(), 1);
+ assertRecordParses(qdRecordList.get(0), "www.google.com", 1, 1, 0, null);
- List<DnsPacket.DnsSection> anSectionList =
- packet.getSectionList(DnsPacket.ANSECTION);
- assertEquals(anSectionList.size(), 1);
- assertSectionParses(anSectionList.get(0), "www.google.com", 1, 1, 0x12b,
+ List<DnsPacket.DnsRecord> anRecordList =
+ packet.getRecordList(DnsPacket.ANSECTION);
+ assertEquals(anRecordList.size(), 1);
+ assertRecordParses(anRecordList.get(0), "www.google.com", 1, 1, 0x12b,
new byte[]{ (byte) 0xac, (byte) 0xd9, (byte) 0xa1, (byte) 0x84 });
}
@@ -143,16 +143,16 @@
// Header part
assertHeaderParses(packet.getHeader(), 0x7722, 0x8180, 1, 1, 0, 0);
- // Section part
- List<DnsPacket.DnsSection> qdSectionList =
- packet.getSectionList(DnsPacket.QDSECTION);
- assertEquals(qdSectionList.size(), 1);
- assertSectionParses(qdSectionList.get(0), "www.google.com", 28, 1, 0, null);
+ // Record part
+ List<DnsPacket.DnsRecord> qdRecordList =
+ packet.getRecordList(DnsPacket.QDSECTION);
+ assertEquals(qdRecordList.size(), 1);
+ assertRecordParses(qdRecordList.get(0), "www.google.com", 28, 1, 0, null);
- List<DnsPacket.DnsSection> anSectionList =
- packet.getSectionList(DnsPacket.ANSECTION);
- assertEquals(anSectionList.size(), 1);
- assertSectionParses(anSectionList.get(0), "www.google.com", 28, 1, 0x37,
+ List<DnsPacket.DnsRecord> anRecordList =
+ packet.getRecordList(DnsPacket.ANSECTION);
+ assertEquals(anRecordList.size(), 1);
+ assertRecordParses(anRecordList.get(0), "www.google.com", 28, 1, 0x37,
new byte[]{ 0x24, 0x04, 0x68, 0x00, 0x40, 0x05, 0x08, 0x0d,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x04 });
}
diff --git a/tests/net/java/android/net/IpMemoryStoreTest.java b/tests/net/java/android/net/IpMemoryStoreTest.java
index eae9710..57ecc8f 100644
--- a/tests/net/java/android/net/IpMemoryStoreTest.java
+++ b/tests/net/java/android/net/IpMemoryStoreTest.java
@@ -17,8 +17,9 @@
package android.net;
import android.content.Context;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import org.junit.Before;
import org.junit.Test;
diff --git a/tests/net/java/android/net/IpPrefixTest.java b/tests/net/java/android/net/IpPrefixTest.java
index 1f1ba2e..3cc0e36 100644
--- a/tests/net/java/android/net/IpPrefixTest.java
+++ b/tests/net/java/android/net/IpPrefixTest.java
@@ -25,15 +25,16 @@
import static org.junit.Assert.fail;
import android.os.Parcel;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
import java.net.InetAddress;
import java.util.Random;
-import org.junit.runner.RunWith;
-import org.junit.Test;
-
@RunWith(AndroidJUnit4.class)
@SmallTest
public class IpPrefixTest {
diff --git a/tests/net/java/android/net/IpSecAlgorithmTest.java b/tests/net/java/android/net/IpSecAlgorithmTest.java
index 85e8361..8e9d08c 100644
--- a/tests/net/java/android/net/IpSecAlgorithmTest.java
+++ b/tests/net/java/android/net/IpSecAlgorithmTest.java
@@ -20,17 +20,18 @@
import static org.junit.Assert.fail;
import android.os.Parcel;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
import java.util.AbstractMap.SimpleEntry;
import java.util.Arrays;
import java.util.Map.Entry;
import java.util.Random;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
/** Unit tests for {@link IpSecAlgorithm}. */
@SmallTest
@RunWith(AndroidJUnit4.class)
diff --git a/tests/net/java/android/net/IpSecConfigTest.java b/tests/net/java/android/net/IpSecConfigTest.java
index be1a455..215506c 100644
--- a/tests/net/java/android/net/IpSecConfigTest.java
+++ b/tests/net/java/android/net/IpSecConfigTest.java
@@ -22,7 +22,8 @@
import static org.junit.Assert.assertTrue;
import android.os.Parcel;
-import android.support.test.filters.SmallTest;
+
+import androidx.test.filters.SmallTest;
import org.junit.Test;
import org.junit.runner.RunWith;
diff --git a/tests/net/java/android/net/IpSecManagerTest.java b/tests/net/java/android/net/IpSecManagerTest.java
index 8160924..730e2d5 100644
--- a/tests/net/java/android/net/IpSecManagerTest.java
+++ b/tests/net/java/android/net/IpSecManagerTest.java
@@ -19,6 +19,7 @@
import static android.system.OsConstants.AF_INET;
import static android.system.OsConstants.IPPROTO_UDP;
import static android.system.OsConstants.SOCK_DGRAM;
+
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.fail;
@@ -30,21 +31,22 @@
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
-import android.test.mock.MockContext;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
import android.system.Os;
+import android.test.mock.MockContext;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import com.android.server.IpSecService;
-import java.net.InetAddress;
-import java.net.Socket;
-import java.net.UnknownHostException;
-
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
+import java.net.InetAddress;
+import java.net.Socket;
+import java.net.UnknownHostException;
+
/** Unit tests for {@link IpSecManager}. */
@SmallTest
@RunWith(AndroidJUnit4.class)
diff --git a/tests/net/java/android/net/IpSecTransformTest.java b/tests/net/java/android/net/IpSecTransformTest.java
index ffd1f06..2308a3c 100644
--- a/tests/net/java/android/net/IpSecTransformTest.java
+++ b/tests/net/java/android/net/IpSecTransformTest.java
@@ -19,7 +19,7 @@
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
-import android.support.test.filters.SmallTest;
+import androidx.test.filters.SmallTest;
import org.junit.Test;
import org.junit.runner.RunWith;
diff --git a/tests/net/java/android/net/LinkAddressTest.java b/tests/net/java/android/net/LinkAddressTest.java
index c1ad946..be7bd1b 100644
--- a/tests/net/java/android/net/LinkAddressTest.java
+++ b/tests/net/java/android/net/LinkAddressTest.java
@@ -26,6 +26,7 @@
import static android.system.OsConstants.RT_SCOPE_LINK;
import static android.system.OsConstants.RT_SCOPE_SITE;
import static android.system.OsConstants.RT_SCOPE_UNIVERSE;
+
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotEquals;
@@ -33,24 +34,22 @@
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
+import android.os.Parcel;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
import java.net.Inet4Address;
-import java.net.Inet6Address;
import java.net.InetAddress;
import java.net.InterfaceAddress;
import java.net.NetworkInterface;
import java.net.SocketException;
import java.util.Arrays;
-import java.util.Collections;
-import java.util.Comparator;
import java.util.List;
-import android.os.Parcel;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
-
-import org.junit.runner.RunWith;
-import org.junit.Test;
-
@RunWith(AndroidJUnit4.class)
@SmallTest
public class LinkAddressTest {
diff --git a/tests/net/java/android/net/LinkPropertiesTest.java b/tests/net/java/android/net/LinkPropertiesTest.java
index bdde096..9a7d487 100644
--- a/tests/net/java/android/net/LinkPropertiesTest.java
+++ b/tests/net/java/android/net/LinkPropertiesTest.java
@@ -24,11 +24,12 @@
import android.net.LinkProperties.CompareResult;
import android.net.LinkProperties.ProvisioningChange;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
import android.system.OsConstants;
import android.util.ArraySet;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.internal.util.TestUtils;
import org.junit.Test;
diff --git a/tests/net/java/android/net/MacAddressTest.java b/tests/net/java/android/net/MacAddressTest.java
index 8be807d..b0e5fb1 100644
--- a/tests/net/java/android/net/MacAddressTest.java
+++ b/tests/net/java/android/net/MacAddressTest.java
@@ -18,12 +18,12 @@
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
diff --git a/tests/net/java/android/net/NetworkCapabilitiesTest.java b/tests/net/java/android/net/NetworkCapabilitiesTest.java
index 84f7359..4d4915b 100644
--- a/tests/net/java/android/net/NetworkCapabilitiesTest.java
+++ b/tests/net/java/android/net/NetworkCapabilitiesTest.java
@@ -42,10 +42,11 @@
import static org.junit.Assert.fail;
import android.os.Parcel;
-import android.support.test.runner.AndroidJUnit4;
import android.test.suitebuilder.annotation.SmallTest;
import android.util.ArraySet;
+import androidx.test.runner.AndroidJUnit4;
+
import org.junit.Test;
import org.junit.runner.RunWith;
diff --git a/tests/net/java/android/net/NetworkStatsHistoryTest.java b/tests/net/java/android/net/NetworkStatsHistoryTest.java
index 301d04d..13558cd 100644
--- a/tests/net/java/android/net/NetworkStatsHistoryTest.java
+++ b/tests/net/java/android/net/NetworkStatsHistoryTest.java
@@ -16,14 +16,14 @@
package android.net;
+import static android.net.NetworkStatsHistory.DataStreamUtils.readVarLong;
+import static android.net.NetworkStatsHistory.DataStreamUtils.writeVarLong;
+import static android.net.NetworkStatsHistory.Entry.UNKNOWN;
import static android.net.NetworkStatsHistory.FIELD_ALL;
import static android.net.NetworkStatsHistory.FIELD_OPERATIONS;
import static android.net.NetworkStatsHistory.FIELD_RX_BYTES;
import static android.net.NetworkStatsHistory.FIELD_RX_PACKETS;
import static android.net.NetworkStatsHistory.FIELD_TX_BYTES;
-import static android.net.NetworkStatsHistory.DataStreamUtils.readVarLong;
-import static android.net.NetworkStatsHistory.DataStreamUtils.writeVarLong;
-import static android.net.NetworkStatsHistory.Entry.UNKNOWN;
import static android.net.TrafficStats.GB_IN_BYTES;
import static android.net.TrafficStats.MB_IN_BYTES;
import static android.text.format.DateUtils.DAY_IN_MILLIS;
@@ -32,29 +32,30 @@
import static android.text.format.DateUtils.SECOND_IN_MILLIS;
import static android.text.format.DateUtils.WEEK_IN_MILLIS;
import static android.text.format.DateUtils.YEAR_IN_MILLIS;
+
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import android.content.Context;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
-import android.test.suitebuilder.annotation.Suppress;
import android.util.Log;
+import androidx.test.InstrumentationRegistry;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.frameworks.tests.net.R;
+import org.junit.After;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.util.Random;
-import org.junit.After;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
@RunWith(AndroidJUnit4.class)
@SmallTest
public class NetworkStatsHistoryTest {
diff --git a/tests/net/java/android/net/NetworkStatsTest.java b/tests/net/java/android/net/NetworkStatsTest.java
index 2c2afd4..b5b0384 100644
--- a/tests/net/java/android/net/NetworkStatsTest.java
+++ b/tests/net/java/android/net/NetworkStatsTest.java
@@ -19,6 +19,7 @@
import static android.net.NetworkStats.DEFAULT_NETWORK_ALL;
import static android.net.NetworkStats.DEFAULT_NETWORK_NO;
import static android.net.NetworkStats.DEFAULT_NETWORK_YES;
+import static android.net.NetworkStats.IFACE_ALL;
import static android.net.NetworkStats.INTERFACES_ALL;
import static android.net.NetworkStats.METERED_ALL;
import static android.net.NetworkStats.METERED_NO;
@@ -26,31 +27,30 @@
import static android.net.NetworkStats.ROAMING_ALL;
import static android.net.NetworkStats.ROAMING_NO;
import static android.net.NetworkStats.ROAMING_YES;
-import static android.net.NetworkStats.SET_DEFAULT;
-import static android.net.NetworkStats.SET_FOREGROUND;
+import static android.net.NetworkStats.SET_ALL;
import static android.net.NetworkStats.SET_DBG_VPN_IN;
import static android.net.NetworkStats.SET_DBG_VPN_OUT;
-import static android.net.NetworkStats.SET_ALL;
-import static android.net.NetworkStats.IFACE_ALL;
+import static android.net.NetworkStats.SET_DEFAULT;
+import static android.net.NetworkStats.SET_FOREGROUND;
import static android.net.NetworkStats.TAG_ALL;
import static android.net.NetworkStats.TAG_NONE;
import static android.net.NetworkStats.UID_ALL;
+
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-import android.net.NetworkStats.Entry;
import android.os.Process;
-import android.support.test.runner.AndroidJUnit4;
-import android.support.test.filters.SmallTest;
import android.util.ArrayMap;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.google.android.collect.Sets;
-import java.util.HashSet;
-
-import org.junit.runner.RunWith;
import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import java.util.HashSet;
@RunWith(AndroidJUnit4.class)
@SmallTest
diff --git a/tests/net/java/android/net/NetworkTest.java b/tests/net/java/android/net/NetworkTest.java
index 94d01e9..0bee7cd 100644
--- a/tests/net/java/android/net/NetworkTest.java
+++ b/tests/net/java/android/net/NetworkTest.java
@@ -25,22 +25,22 @@
import android.net.LocalSocket;
import android.net.LocalSocketAddress;
import android.net.Network;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
import java.io.File;
import java.io.FileDescriptor;
import java.io.FileInputStream;
-import java.io.IOException;
import java.net.DatagramSocket;
-import java.net.InetAddress;
import java.net.Inet6Address;
+import java.net.InetAddress;
import java.net.SocketException;
import java.util.Objects;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
@RunWith(AndroidJUnit4.class)
@SmallTest
public class NetworkTest {
diff --git a/tests/net/java/android/net/NetworkUtilsTest.java b/tests/net/java/android/net/NetworkUtilsTest.java
index ba6e0f2..7748288 100644
--- a/tests/net/java/android/net/NetworkUtilsTest.java
+++ b/tests/net/java/android/net/NetworkUtilsTest.java
@@ -18,7 +18,7 @@
import static junit.framework.Assert.assertEquals;
-import android.support.test.runner.AndroidJUnit4;
+import androidx.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -27,7 +27,7 @@
import java.util.TreeSet;
@RunWith(AndroidJUnit4.class)
-@android.support.test.filters.SmallTest
+@androidx.test.filters.SmallTest
public class NetworkUtilsTest {
@Test
public void testRoutedIPv4AddressCount() {
diff --git a/tests/net/java/android/net/StaticIpConfigurationTest.java b/tests/net/java/android/net/StaticIpConfigurationTest.java
index 2b5ad37..8449ca7 100644
--- a/tests/net/java/android/net/StaticIpConfigurationTest.java
+++ b/tests/net/java/android/net/StaticIpConfigurationTest.java
@@ -23,8 +23,9 @@
import static org.junit.Assert.assertTrue;
import android.os.Parcel;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
diff --git a/tests/net/java/android/net/UidRangeTest.java b/tests/net/java/android/net/UidRangeTest.java
index 860d732..ea1df09 100644
--- a/tests/net/java/android/net/UidRangeTest.java
+++ b/tests/net/java/android/net/UidRangeTest.java
@@ -16,15 +16,13 @@
package android.net;
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
-import android.support.test.runner.AndroidJUnit4;
-import android.support.test.filters.SmallTest;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
-import org.junit.runner.RunWith;
import org.junit.Test;
+import org.junit.runner.RunWith;
@RunWith(AndroidJUnit4.class)
@SmallTest
diff --git a/tests/net/java/android/net/captiveportal/CaptivePortalProbeSpecTest.java b/tests/net/java/android/net/captiveportal/CaptivePortalProbeSpecTest.java
index 40a8b3e..f948086 100644
--- a/tests/net/java/android/net/captiveportal/CaptivePortalProbeSpecTest.java
+++ b/tests/net/java/android/net/captiveportal/CaptivePortalProbeSpecTest.java
@@ -20,14 +20,13 @@
import static junit.framework.Assert.assertNull;
import static junit.framework.Assert.assertTrue;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import java.net.MalformedURLException;
-import java.net.URL;
import java.text.ParseException;
@RunWith(AndroidJUnit4.class)
diff --git a/tests/net/java/android/net/dhcp/DhcpServingParamsParcelExtTest.java b/tests/net/java/android/net/dhcp/DhcpServingParamsParcelExtTest.java
index 4a6f20a..e01ac7f 100644
--- a/tests/net/java/android/net/dhcp/DhcpServingParamsParcelExtTest.java
+++ b/tests/net/java/android/net/dhcp/DhcpServingParamsParcelExtTest.java
@@ -25,8 +25,9 @@
import static org.junit.Assert.assertTrue;
import android.net.LinkAddress;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import org.junit.Before;
import org.junit.Test;
diff --git a/tests/net/java/android/net/ip/InterfaceControllerTest.java b/tests/net/java/android/net/ip/InterfaceControllerTest.java
index d27a4f9..7a56b3a 100644
--- a/tests/net/java/android/net/ip/InterfaceControllerTest.java
+++ b/tests/net/java/android/net/ip/InterfaceControllerTest.java
@@ -28,8 +28,9 @@
import android.net.InterfaceConfigurationParcel;
import android.net.LinkAddress;
import android.net.util.SharedLog;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import org.junit.Before;
import org.junit.Test;
diff --git a/tests/net/java/android/net/ip/IpServerTest.java b/tests/net/java/android/net/ip/IpServerTest.java
index f7542a7..05912e8 100644
--- a/tests/net/java/android/net/ip/IpServerTest.java
+++ b/tests/net/java/android/net/ip/IpServerTest.java
@@ -65,10 +65,11 @@
import android.os.INetworkManagementService;
import android.os.RemoteException;
import android.os.test.TestLooper;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
import android.text.TextUtils;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
diff --git a/tests/net/java/android/net/ipmemorystore/ParcelableTests.java b/tests/net/java/android/net/ipmemorystore/ParcelableTests.java
index 1fc67a8..76cccc9 100644
--- a/tests/net/java/android/net/ipmemorystore/ParcelableTests.java
+++ b/tests/net/java/android/net/ipmemorystore/ParcelableTests.java
@@ -21,8 +21,9 @@
import android.os.Parcel;
import android.os.Parcelable;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
diff --git a/tests/net/java/android/net/netlink/ConntrackMessageTest.java b/tests/net/java/android/net/netlink/ConntrackMessageTest.java
index 3aab942..5c86757 100644
--- a/tests/net/java/android/net/netlink/ConntrackMessageTest.java
+++ b/tests/net/java/android/net/netlink/ConntrackMessageTest.java
@@ -20,19 +20,18 @@
import static org.junit.Assume.assumeTrue;
import android.system.OsConstants;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import libcore.util.HexEncoding;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
-import org.junit.runner.RunWith;
import org.junit.Test;
+import org.junit.runner.RunWith;
import java.net.Inet4Address;
import java.net.InetAddress;
-import java.nio.ByteBuffer;
import java.nio.ByteOrder;
-import java.util.Arrays;
-
@RunWith(AndroidJUnit4.class)
@SmallTest
diff --git a/tests/net/java/android/net/netlink/InetDiagSocketTest.java b/tests/net/java/android/net/netlink/InetDiagSocketTest.java
index 122edba..b6038ab 100644
--- a/tests/net/java/android/net/netlink/InetDiagSocketTest.java
+++ b/tests/net/java/android/net/netlink/InetDiagSocketTest.java
@@ -25,8 +25,6 @@
import static android.system.OsConstants.IPPROTO_UDP;
import static android.system.OsConstants.SOCK_DGRAM;
import static android.system.OsConstants.SOCK_STREAM;
-import static android.system.OsConstants.SOL_SOCKET;
-import static android.system.OsConstants.SO_RCVTIMEO;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
@@ -38,29 +36,25 @@
import android.net.ConnectivityManager;
import android.net.netlink.StructNlMsgHdr;
import android.os.Process;
-import android.support.test.runner.AndroidJUnit4;
-import android.support.test.filters.SmallTest;
-import android.support.test.InstrumentationRegistry;
import android.system.Os;
-import android.system.StructTimeval;
-import android.util.Log;
-import java.io.FileDescriptor;
-import java.net.DatagramSocket;
-import java.net.InetAddress;
-import java.net.Inet4Address;
-import java.net.Inet6Address;
-import java.net.InetSocketAddress;
-import java.net.ServerSocket;
-import java.net.Socket;
-import java.net.SocketAddress;
-import java.nio.ByteBuffer;
-import java.nio.ByteOrder;
+
+import androidx.test.InstrumentationRegistry;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import libcore.util.HexEncoding;
import org.junit.Before;
-import org.junit.runner.RunWith;
import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import java.io.FileDescriptor;
+import java.net.Inet4Address;
+import java.net.Inet6Address;
+import java.net.InetAddress;
+import java.net.InetSocketAddress;
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
@RunWith(AndroidJUnit4.class)
@SmallTest
diff --git a/tests/net/java/android/net/netlink/NetlinkErrorMessageTest.java b/tests/net/java/android/net/netlink/NetlinkErrorMessageTest.java
index 6647760..44ab605 100644
--- a/tests/net/java/android/net/netlink/NetlinkErrorMessageTest.java
+++ b/tests/net/java/android/net/netlink/NetlinkErrorMessageTest.java
@@ -16,9 +16,10 @@
package android.net.netlink;
-import static android.net.netlink.StructNlMsgHdr.NLM_F_REQUEST;
import static android.net.netlink.StructNlMsgHdr.NLM_F_ACK;
import static android.net.netlink.StructNlMsgHdr.NLM_F_REPLACE;
+import static android.net.netlink.StructNlMsgHdr.NLM_F_REQUEST;
+
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
@@ -27,18 +28,17 @@
import android.net.netlink.NetlinkErrorMessage;
import android.net.netlink.NetlinkMessage;
import android.net.netlink.StructNlMsgErr;
-import android.support.test.runner.AndroidJUnit4;
-import android.support.test.filters.SmallTest;
-import android.util.Log;
-import java.nio.ByteBuffer;
-import java.nio.ByteOrder;
-
-import org.junit.runner.RunWith;
-import org.junit.Test;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import libcore.util.HexEncoding;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
@RunWith(AndroidJUnit4.class)
@SmallTest
diff --git a/tests/net/java/android/net/netlink/NetlinkSocketTest.java b/tests/net/java/android/net/netlink/NetlinkSocketTest.java
index 11be40b..3916578 100644
--- a/tests/net/java/android/net/netlink/NetlinkSocketTest.java
+++ b/tests/net/java/android/net/netlink/NetlinkSocketTest.java
@@ -18,31 +18,29 @@
import static android.net.netlink.NetlinkSocket.DEFAULT_RECV_BUFSIZE;
import static android.system.OsConstants.NETLINK_ROUTE;
+
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import android.net.netlink.NetlinkSocket;
import android.net.netlink.RtNetlinkNeighborMessage;
-import android.net.netlink.StructNdMsg;
import android.net.netlink.StructNlMsgHdr;
-import android.support.test.runner.AndroidJUnit4;
-import android.support.test.filters.SmallTest;
-import android.system.ErrnoException;
import android.system.NetlinkSocketAddress;
import android.system.Os;
-import android.util.Log;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import libcore.io.IoUtils;
-import java.io.InterruptedIOException;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
import java.io.FileDescriptor;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
-import org.junit.runner.RunWith;
-import org.junit.Test;
-
-
@RunWith(AndroidJUnit4.class)
@SmallTest
public class NetlinkSocketTest {
diff --git a/tests/net/java/android/net/netlink/RtNetlinkNeighborMessageTest.java b/tests/net/java/android/net/netlink/RtNetlinkNeighborMessageTest.java
index c9fd74f..8162522 100644
--- a/tests/net/java/android/net/netlink/RtNetlinkNeighborMessageTest.java
+++ b/tests/net/java/android/net/netlink/RtNetlinkNeighborMessageTest.java
@@ -25,23 +25,22 @@
import android.net.netlink.RtNetlinkNeighborMessage;
import android.net.netlink.StructNdMsg;
import android.net.netlink.StructNlMsgHdr;
-import android.support.test.runner.AndroidJUnit4;
-import android.support.test.filters.SmallTest;
import android.system.OsConstants;
-import android.util.Log;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
+import libcore.util.HexEncoding;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
import java.net.Inet4Address;
import java.net.InetAddress;
-import java.net.UnknownHostException;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.util.Arrays;
-import org.junit.runner.RunWith;
-import org.junit.Test;
-
-import libcore.util.HexEncoding;
-
@RunWith(AndroidJUnit4.class)
@SmallTest
public class RtNetlinkNeighborMessageTest {
diff --git a/tests/net/java/android/net/nsd/NsdManagerTest.java b/tests/net/java/android/net/nsd/NsdManagerTest.java
index 0a5a6aa..2d2bccb 100644
--- a/tests/net/java/android/net/nsd/NsdManagerTest.java
+++ b/tests/net/java/android/net/nsd/NsdManagerTest.java
@@ -16,29 +16,31 @@
package android.net.nsd;
+import static com.android.internal.util.TestUtils.waitForIdleHandler;
+
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.fail;
import static org.mockito.Mockito.any;
import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.never;
import static org.mockito.Mockito.reset;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.timeout;
-import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
-import static com.android.internal.util.TestUtils.waitForIdleHandler;
-import android.os.HandlerThread;
-import android.os.Handler;
-import android.os.Looper;
import android.content.Context;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+import android.os.Handler;
+import android.os.HandlerThread;
+import android.os.Looper;
import android.os.Message;
import android.os.Messenger;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.internal.util.AsyncChannel;
+
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -46,8 +48,6 @@
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
-import java.util.function.Consumer;
-
@RunWith(AndroidJUnit4.class)
@SmallTest
public class NsdManagerTest {
diff --git a/tests/net/java/android/net/nsd/NsdServiceInfoTest.java b/tests/net/java/android/net/nsd/NsdServiceInfoTest.java
index e48b522..94dfc75 100644
--- a/tests/net/java/android/net/nsd/NsdServiceInfoTest.java
+++ b/tests/net/java/android/net/nsd/NsdServiceInfoTest.java
@@ -24,20 +24,18 @@
import android.os.Bundle;
import android.os.Parcel;
import android.os.StrictMode;
-import android.net.nsd.NsdServiceInfo;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
-import android.util.Log;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.Map;
-import java.net.InetAddress;
-import java.net.UnknownHostException;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+import java.util.Arrays;
+import java.util.Map;
+
@RunWith(AndroidJUnit4.class)
@SmallTest
public class NsdServiceInfoTest {
diff --git a/tests/net/java/android/net/shared/Inet4AddressUtilsTest.java b/tests/net/java/android/net/shared/Inet4AddressUtilsTest.java
index 6da8514..35f8c79 100644
--- a/tests/net/java/android/net/shared/Inet4AddressUtilsTest.java
+++ b/tests/net/java/android/net/shared/Inet4AddressUtilsTest.java
@@ -32,8 +32,9 @@
import static org.junit.Assert.fail;
import android.net.InetAddresses;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
diff --git a/tests/net/java/android/net/shared/InitialConfigurationTest.java b/tests/net/java/android/net/shared/InitialConfigurationTest.java
index 78792bd..27bc13d 100644
--- a/tests/net/java/android/net/shared/InitialConfigurationTest.java
+++ b/tests/net/java/android/net/shared/InitialConfigurationTest.java
@@ -24,8 +24,9 @@
import android.net.IpPrefix;
import android.net.LinkAddress;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import org.junit.Before;
import org.junit.Test;
diff --git a/tests/net/java/android/net/shared/IpConfigurationParcelableUtilTest.java b/tests/net/java/android/net/shared/IpConfigurationParcelableUtilTest.java
index fb4d43c..3e86e77 100644
--- a/tests/net/java/android/net/shared/IpConfigurationParcelableUtilTest.java
+++ b/tests/net/java/android/net/shared/IpConfigurationParcelableUtilTest.java
@@ -27,8 +27,9 @@
import android.net.LinkAddress;
import android.net.StaticIpConfiguration;
import android.net.apf.ApfCapabilities;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import org.junit.Before;
import org.junit.Test;
diff --git a/tests/net/java/android/net/shared/LinkPropertiesParcelableUtilTest.java b/tests/net/java/android/net/shared/LinkPropertiesParcelableUtilTest.java
index b6d01db..2d0e03d 100644
--- a/tests/net/java/android/net/shared/LinkPropertiesParcelableUtilTest.java
+++ b/tests/net/java/android/net/shared/LinkPropertiesParcelableUtilTest.java
@@ -29,8 +29,9 @@
import android.net.ProxyInfo;
import android.net.RouteInfo;
import android.net.Uri;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import org.junit.Before;
import org.junit.Test;
diff --git a/tests/net/java/android/net/shared/ProvisioningConfigurationTest.java b/tests/net/java/android/net/shared/ProvisioningConfigurationTest.java
index 6ea47d2..6fad89e 100644
--- a/tests/net/java/android/net/shared/ProvisioningConfigurationTest.java
+++ b/tests/net/java/android/net/shared/ProvisioningConfigurationTest.java
@@ -27,8 +27,9 @@
import android.net.Network;
import android.net.StaticIpConfiguration;
import android.net.apf.ApfCapabilities;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import org.junit.Before;
import org.junit.Test;
diff --git a/tests/net/java/android/net/util/InterfaceParamsTest.java b/tests/net/java/android/net/util/InterfaceParamsTest.java
index 21728af..141455c 100644
--- a/tests/net/java/android/net/util/InterfaceParamsTest.java
+++ b/tests/net/java/android/net/util/InterfaceParamsTest.java
@@ -21,13 +21,12 @@
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
-
@RunWith(AndroidJUnit4.class)
@SmallTest
public class InterfaceParamsTest {
diff --git a/tests/net/java/android/net/util/InterfaceSetTest.java b/tests/net/java/android/net/util/InterfaceSetTest.java
index 8012838..ea084b6 100644
--- a/tests/net/java/android/net/util/InterfaceSetTest.java
+++ b/tests/net/java/android/net/util/InterfaceSetTest.java
@@ -20,8 +20,8 @@
import static junit.framework.Assert.assertFalse;
import static junit.framework.Assert.assertTrue;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
diff --git a/tests/net/java/android/net/util/IpUtilsTest.java b/tests/net/java/android/net/util/IpUtilsTest.java
index 8903bf9..193d85d 100644
--- a/tests/net/java/android/net/util/IpUtilsTest.java
+++ b/tests/net/java/android/net/util/IpUtilsTest.java
@@ -18,14 +18,14 @@
import static org.junit.Assert.assertEquals;
-import android.support.test.runner.AndroidJUnit4;
-import android.support.test.filters.SmallTest;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
import java.nio.ByteBuffer;
-import org.junit.runner.RunWith;
-import org.junit.Test;
-
@RunWith(AndroidJUnit4.class)
@SmallTest
public class IpUtilsTest {
diff --git a/tests/net/java/android/net/util/SharedLogTest.java b/tests/net/java/android/net/util/SharedLogTest.java
index 8604860..e1dba36 100644
--- a/tests/net/java/android/net/util/SharedLogTest.java
+++ b/tests/net/java/android/net/util/SharedLogTest.java
@@ -19,16 +19,14 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import java.io.ByteArrayOutputStream;
import java.io.PrintWriter;
-import java.util.ArrayList;
-import java.util.Vector;
@RunWith(AndroidJUnit4.class)
@SmallTest
diff --git a/tests/net/java/android/net/util/VersionedBroadcastListenerTest.java b/tests/net/java/android/net/util/VersionedBroadcastListenerTest.java
index 39f59f1..0d27d5b 100644
--- a/tests/net/java/android/net/util/VersionedBroadcastListenerTest.java
+++ b/tests/net/java/android/net/util/VersionedBroadcastListenerTest.java
@@ -26,21 +26,19 @@
import android.os.Looper;
import android.os.UserHandle;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import com.android.internal.util.test.BroadcastInterceptingContext;
import org.junit.After;
import org.junit.Before;
import org.junit.BeforeClass;
-import org.junit.runner.RunWith;
import org.junit.Test;
+import org.junit.runner.RunWith;
import org.mockito.Mock;
-import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
-
@RunWith(AndroidJUnit4.class)
@SmallTest
public class VersionedBroadcastListenerTest {
diff --git a/tests/net/java/com/android/internal/net/NetworkStatsFactoryTest.java b/tests/net/java/com/android/internal/net/NetworkStatsFactoryTest.java
index 90bf7b1..4ec4fdd 100644
--- a/tests/net/java/com/android/internal/net/NetworkStatsFactoryTest.java
+++ b/tests/net/java/com/android/internal/net/NetworkStatsFactoryTest.java
@@ -24,33 +24,36 @@
import static android.net.NetworkStats.SET_FOREGROUND;
import static android.net.NetworkStats.TAG_NONE;
import static android.net.NetworkStats.UID_ALL;
+
import static com.android.server.NetworkManagementSocketTagger.kernelToTag;
+
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
import android.content.res.Resources;
import android.net.NetworkStats;
import android.net.TrafficStats;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.InstrumentationRegistry;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import com.android.frameworks.tests.net.R;
+import libcore.io.IoUtils;
+import libcore.io.Streams;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.InputStream;
import java.io.OutputStream;
-import libcore.io.IoUtils;
-import libcore.io.Streams;
-
-import org.junit.runner.RunWith;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
/**
* Tests for {@link NetworkStatsFactory}.
*/
diff --git a/tests/net/java/com/android/internal/util/BitUtilsTest.java b/tests/net/java/com/android/internal/util/BitUtilsTest.java
index f4dc12a..01fb0df 100644
--- a/tests/net/java/com/android/internal/util/BitUtilsTest.java
+++ b/tests/net/java/com/android/internal/util/BitUtilsTest.java
@@ -16,14 +16,24 @@
package com.android.internal.util;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
-import java.nio.ByteBuffer;
+import static com.android.internal.util.BitUtils.bytesToBEInt;
+import static com.android.internal.util.BitUtils.bytesToLEInt;
+import static com.android.internal.util.BitUtils.getUint16;
+import static com.android.internal.util.BitUtils.getUint32;
+import static com.android.internal.util.BitUtils.getUint8;
+import static com.android.internal.util.BitUtils.uint16;
+import static com.android.internal.util.BitUtils.uint32;
+import static com.android.internal.util.BitUtils.uint8;
+
+import static org.junit.Assert.assertEquals;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import org.junit.Test;
import org.junit.runner.RunWith;
-import static org.junit.Assert.assertEquals;
-import static com.android.internal.util.BitUtils.*;
+import java.nio.ByteBuffer;
@SmallTest
@RunWith(AndroidJUnit4.class)
diff --git a/tests/net/java/com/android/internal/util/RingBufferTest.java b/tests/net/java/com/android/internal/util/RingBufferTest.java
index 90a373a..eff334f 100644
--- a/tests/net/java/com/android/internal/util/RingBufferTest.java
+++ b/tests/net/java/com/android/internal/util/RingBufferTest.java
@@ -16,19 +16,18 @@
package com.android.internal.util;
-import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.fail;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
+
import java.util.Arrays;
import java.util.Objects;
-
@SmallTest
@RunWith(AndroidJUnit4.class)
public class RingBufferTest {
diff --git a/tests/net/java/com/android/server/ConnectivityServiceTest.java b/tests/net/java/com/android/server/ConnectivityServiceTest.java
index c126026..9453a80 100644
--- a/tests/net/java/com/android/server/ConnectivityServiceTest.java
+++ b/tests/net/java/com/android/server/ConnectivityServiceTest.java
@@ -125,6 +125,7 @@
import android.net.NetworkRequest;
import android.net.NetworkSpecifier;
import android.net.NetworkStackClient;
+import android.net.NetworkState;
import android.net.NetworkUtils;
import android.net.ProxyInfo;
import android.net.RouteInfo;
@@ -147,15 +148,17 @@
import android.os.SystemClock;
import android.os.UserHandle;
import android.provider.Settings;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
import android.test.mock.MockContentResolver;
import android.text.TextUtils;
import android.util.ArraySet;
import android.util.Log;
+import androidx.test.InstrumentationRegistry;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.internal.net.VpnConfig;
+import com.android.internal.net.VpnInfo;
import com.android.internal.util.ArrayUtils;
import com.android.internal.util.WakeupMessage;
import com.android.internal.util.test.BroadcastInterceptingContext;
@@ -202,7 +205,6 @@
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.function.Predicate;
-
/**
* Tests for {@link ConnectivityService}.
*
@@ -907,11 +909,19 @@
return mConnected; // Similar trickery
}
- public void connect() {
+ private void connect(boolean isAlwaysMetered) {
mNetworkCapabilities.set(mMockNetworkAgent.getNetworkCapabilities());
mConnected = true;
mConfig = new VpnConfig();
- mConfig.isMetered = false;
+ mConfig.isMetered = isAlwaysMetered;
+ }
+
+ public void connectAsAlwaysMetered() {
+ connect(true /* isAlwaysMetered */);
+ }
+
+ public void connect() {
+ connect(false /* isAlwaysMetered */);
}
@Override
@@ -4273,48 +4283,91 @@
mCellNetworkAgent = new MockNetworkAgent(TRANSPORT_CELLULAR);
mWiFiNetworkAgent = new MockNetworkAgent(TRANSPORT_WIFI);
- Network[] onlyCell = new Network[]{mCellNetworkAgent.getNetwork()};
- Network[] onlyWifi = new Network[]{mWiFiNetworkAgent.getNetwork()};
+ Network[] onlyCell = new Network[] {mCellNetworkAgent.getNetwork()};
+ Network[] onlyWifi = new Network[] {mWiFiNetworkAgent.getNetwork()};
+
+ LinkProperties cellLp = new LinkProperties();
+ cellLp.setInterfaceName(MOBILE_IFNAME);
+ LinkProperties wifiLp = new LinkProperties();
+ wifiLp.setInterfaceName(WIFI_IFNAME);
// Simple connection should have updated ifaces
mCellNetworkAgent.connect(false);
+ mCellNetworkAgent.sendLinkProperties(cellLp);
waitForIdle();
- verify(mStatsService, atLeastOnce()).forceUpdateIfaces(onlyCell);
+ verify(mStatsService, atLeastOnce())
+ .forceUpdateIfaces(
+ eq(onlyCell),
+ eq(new VpnInfo[0]),
+ any(NetworkState[].class),
+ eq(MOBILE_IFNAME));
reset(mStatsService);
// Default network switch should update ifaces.
mWiFiNetworkAgent.connect(false);
+ mWiFiNetworkAgent.sendLinkProperties(wifiLp);
waitForIdle();
- verify(mStatsService, atLeastOnce()).forceUpdateIfaces(onlyWifi);
+ assertEquals(wifiLp, mService.getActiveLinkProperties());
+ verify(mStatsService, atLeastOnce())
+ .forceUpdateIfaces(
+ eq(onlyWifi),
+ eq(new VpnInfo[0]),
+ any(NetworkState[].class),
+ eq(WIFI_IFNAME));
reset(mStatsService);
// Disconnect should update ifaces.
mWiFiNetworkAgent.disconnect();
waitForIdle();
- verify(mStatsService, atLeastOnce()).forceUpdateIfaces(onlyCell);
+ verify(mStatsService, atLeastOnce())
+ .forceUpdateIfaces(
+ eq(onlyCell),
+ eq(new VpnInfo[0]),
+ any(NetworkState[].class),
+ eq(MOBILE_IFNAME));
reset(mStatsService);
// Metered change should update ifaces
mCellNetworkAgent.addCapability(NetworkCapabilities.NET_CAPABILITY_NOT_METERED);
waitForIdle();
- verify(mStatsService, atLeastOnce()).forceUpdateIfaces(onlyCell);
+ verify(mStatsService, atLeastOnce())
+ .forceUpdateIfaces(
+ eq(onlyCell),
+ eq(new VpnInfo[0]),
+ any(NetworkState[].class),
+ eq(MOBILE_IFNAME));
reset(mStatsService);
mCellNetworkAgent.removeCapability(NetworkCapabilities.NET_CAPABILITY_NOT_METERED);
waitForIdle();
- verify(mStatsService, atLeastOnce()).forceUpdateIfaces(onlyCell);
+ verify(mStatsService, atLeastOnce())
+ .forceUpdateIfaces(
+ eq(onlyCell),
+ eq(new VpnInfo[0]),
+ any(NetworkState[].class),
+ eq(MOBILE_IFNAME));
reset(mStatsService);
// Captive portal change shouldn't update ifaces
mCellNetworkAgent.addCapability(NetworkCapabilities.NET_CAPABILITY_CAPTIVE_PORTAL);
waitForIdle();
- verify(mStatsService, never()).forceUpdateIfaces(onlyCell);
+ verify(mStatsService, never())
+ .forceUpdateIfaces(
+ eq(onlyCell),
+ eq(new VpnInfo[0]),
+ any(NetworkState[].class),
+ eq(MOBILE_IFNAME));
reset(mStatsService);
// Roaming change should update ifaces
mCellNetworkAgent.addCapability(NetworkCapabilities.NET_CAPABILITY_NOT_ROAMING);
waitForIdle();
- verify(mStatsService, atLeastOnce()).forceUpdateIfaces(onlyCell);
+ verify(mStatsService, atLeastOnce())
+ .forceUpdateIfaces(
+ eq(onlyCell),
+ eq(new VpnInfo[0]),
+ any(NetworkState[].class),
+ eq(MOBILE_IFNAME));
reset(mStatsService);
}
@@ -4970,6 +5023,202 @@
}
@Test
+ public void testIsActiveNetworkMeteredOverWifi() {
+ // Returns true by default when no network is available.
+ assertTrue(mCm.isActiveNetworkMetered());
+ mWiFiNetworkAgent = new MockNetworkAgent(TRANSPORT_WIFI);
+ mWiFiNetworkAgent.addCapability(NET_CAPABILITY_NOT_METERED);
+ mWiFiNetworkAgent.connect(true);
+ waitForIdle();
+
+ assertFalse(mCm.isActiveNetworkMetered());
+ }
+
+ @Test
+ public void testIsActiveNetworkMeteredOverCell() {
+ // Returns true by default when no network is available.
+ assertTrue(mCm.isActiveNetworkMetered());
+ mCellNetworkAgent = new MockNetworkAgent(TRANSPORT_CELLULAR);
+ mCellNetworkAgent.removeCapability(NET_CAPABILITY_NOT_METERED);
+ mCellNetworkAgent.connect(true);
+ waitForIdle();
+
+ assertTrue(mCm.isActiveNetworkMetered());
+ }
+
+ @Test
+ public void testIsActiveNetworkMeteredOverVpnTrackingPlatformDefault() {
+ // Returns true by default when no network is available.
+ assertTrue(mCm.isActiveNetworkMetered());
+ mCellNetworkAgent = new MockNetworkAgent(TRANSPORT_CELLULAR);
+ mCellNetworkAgent.removeCapability(NET_CAPABILITY_NOT_METERED);
+ mCellNetworkAgent.connect(true);
+ waitForIdle();
+ assertTrue(mCm.isActiveNetworkMetered());
+
+ // Connect VPN network. By default it is using current default network (Cell).
+ MockNetworkAgent vpnNetworkAgent = new MockNetworkAgent(TRANSPORT_VPN);
+ final ArraySet<UidRange> ranges = new ArraySet<>();
+ final int uid = Process.myUid();
+ ranges.add(new UidRange(uid, uid));
+ mMockVpn.setNetworkAgent(vpnNetworkAgent);
+ mMockVpn.setUids(ranges);
+ vpnNetworkAgent.connect(true);
+ mMockVpn.connect();
+ waitForIdle();
+ // Ensure VPN is now the active network.
+ assertEquals(vpnNetworkAgent.getNetwork(), mCm.getActiveNetwork());
+
+ // Expect VPN to be metered.
+ assertTrue(mCm.isActiveNetworkMetered());
+
+ // Connect WiFi.
+ mWiFiNetworkAgent = new MockNetworkAgent(TRANSPORT_WIFI);
+ mWiFiNetworkAgent.addCapability(NET_CAPABILITY_NOT_METERED);
+ mWiFiNetworkAgent.connect(true);
+ waitForIdle();
+ // VPN should still be the active network.
+ assertEquals(vpnNetworkAgent.getNetwork(), mCm.getActiveNetwork());
+
+ // Expect VPN to be unmetered as it should now be using WiFi (new default).
+ assertFalse(mCm.isActiveNetworkMetered());
+
+ // Disconnecting Cell should not affect VPN's meteredness.
+ mCellNetworkAgent.disconnect();
+ waitForIdle();
+
+ assertFalse(mCm.isActiveNetworkMetered());
+
+ // Disconnect WiFi; Now there is no platform default network.
+ mWiFiNetworkAgent.disconnect();
+ waitForIdle();
+
+ // VPN without any underlying networks is treated as metered.
+ assertTrue(mCm.isActiveNetworkMetered());
+
+ vpnNetworkAgent.disconnect();
+ mMockVpn.disconnect();
+ }
+
+ @Test
+ public void testIsActiveNetworkMeteredOverVpnSpecifyingUnderlyingNetworks() {
+ // Returns true by default when no network is available.
+ assertTrue(mCm.isActiveNetworkMetered());
+ mCellNetworkAgent = new MockNetworkAgent(TRANSPORT_CELLULAR);
+ mCellNetworkAgent.removeCapability(NET_CAPABILITY_NOT_METERED);
+ mCellNetworkAgent.connect(true);
+ waitForIdle();
+ assertTrue(mCm.isActiveNetworkMetered());
+
+ mWiFiNetworkAgent = new MockNetworkAgent(TRANSPORT_WIFI);
+ mWiFiNetworkAgent.addCapability(NET_CAPABILITY_NOT_METERED);
+ mWiFiNetworkAgent.connect(true);
+ waitForIdle();
+ assertFalse(mCm.isActiveNetworkMetered());
+
+ // Connect VPN network.
+ MockNetworkAgent vpnNetworkAgent = new MockNetworkAgent(TRANSPORT_VPN);
+ final ArraySet<UidRange> ranges = new ArraySet<>();
+ final int uid = Process.myUid();
+ ranges.add(new UidRange(uid, uid));
+ mMockVpn.setNetworkAgent(vpnNetworkAgent);
+ mMockVpn.setUids(ranges);
+ vpnNetworkAgent.connect(true);
+ mMockVpn.connect();
+ waitForIdle();
+ // Ensure VPN is now the active network.
+ assertEquals(vpnNetworkAgent.getNetwork(), mCm.getActiveNetwork());
+ // VPN is using Cell
+ mService.setUnderlyingNetworksForVpn(
+ new Network[] { mCellNetworkAgent.getNetwork() });
+ waitForIdle();
+
+ // Expect VPN to be metered.
+ assertTrue(mCm.isActiveNetworkMetered());
+
+ // VPN is now using WiFi
+ mService.setUnderlyingNetworksForVpn(
+ new Network[] { mWiFiNetworkAgent.getNetwork() });
+ waitForIdle();
+
+ // Expect VPN to be unmetered
+ assertFalse(mCm.isActiveNetworkMetered());
+
+ // VPN is using Cell | WiFi.
+ mService.setUnderlyingNetworksForVpn(
+ new Network[] { mCellNetworkAgent.getNetwork(), mWiFiNetworkAgent.getNetwork() });
+ waitForIdle();
+
+ // Expect VPN to be metered.
+ assertTrue(mCm.isActiveNetworkMetered());
+
+ // VPN is using WiFi | Cell.
+ mService.setUnderlyingNetworksForVpn(
+ new Network[] { mWiFiNetworkAgent.getNetwork(), mCellNetworkAgent.getNetwork() });
+ waitForIdle();
+
+ // Order should not matter and VPN should still be metered.
+ assertTrue(mCm.isActiveNetworkMetered());
+
+ // VPN is not using any underlying networks.
+ mService.setUnderlyingNetworksForVpn(new Network[0]);
+ waitForIdle();
+
+ // VPN without underlying networks is treated as metered.
+ assertTrue(mCm.isActiveNetworkMetered());
+
+ vpnNetworkAgent.disconnect();
+ mMockVpn.disconnect();
+ }
+
+ @Test
+ public void testIsActiveNetworkMeteredOverAlwaysMeteredVpn() {
+ // Returns true by default when no network is available.
+ assertTrue(mCm.isActiveNetworkMetered());
+ mWiFiNetworkAgent = new MockNetworkAgent(TRANSPORT_WIFI);
+ mWiFiNetworkAgent.addCapability(NET_CAPABILITY_NOT_METERED);
+ mWiFiNetworkAgent.connect(true);
+ waitForIdle();
+ assertFalse(mCm.isActiveNetworkMetered());
+
+ // Connect VPN network.
+ MockNetworkAgent vpnNetworkAgent = new MockNetworkAgent(TRANSPORT_VPN);
+ final ArraySet<UidRange> ranges = new ArraySet<>();
+ final int uid = Process.myUid();
+ ranges.add(new UidRange(uid, uid));
+ mMockVpn.setNetworkAgent(vpnNetworkAgent);
+ mMockVpn.setUids(ranges);
+ vpnNetworkAgent.connect(true);
+ mMockVpn.connectAsAlwaysMetered();
+ waitForIdle();
+ assertEquals(vpnNetworkAgent.getNetwork(), mCm.getActiveNetwork());
+
+ // VPN is tracking current platform default (WiFi).
+ mService.setUnderlyingNetworksForVpn(null);
+ waitForIdle();
+
+ // Despite VPN using WiFi (which is unmetered), VPN itself is marked as always metered.
+ assertTrue(mCm.isActiveNetworkMetered());
+
+ // VPN explicitly declares WiFi as its underlying network.
+ mService.setUnderlyingNetworksForVpn(
+ new Network[] { mWiFiNetworkAgent.getNetwork() });
+ waitForIdle();
+
+ // Doesn't really matter whether VPN declares its underlying networks explicitly.
+ assertTrue(mCm.isActiveNetworkMetered());
+
+ // With WiFi lost, VPN is basically without any underlying networks. And in that case it is
+ // anyways suppose to be metered.
+ mWiFiNetworkAgent.disconnect();
+ waitForIdle();
+
+ assertTrue(mCm.isActiveNetworkMetered());
+
+ vpnNetworkAgent.disconnect();
+ }
+
+ @Test
public void testNetworkBlockedStatus() {
final TestNetworkCallback cellNetworkCallback = new TestNetworkCallback();
final NetworkRequest cellRequest = new NetworkRequest.Builder()
diff --git a/tests/net/java/com/android/server/IpSecServiceParameterizedTest.java b/tests/net/java/com/android/server/IpSecServiceParameterizedTest.java
index a844cfe..7c40adf 100644
--- a/tests/net/java/com/android/server/IpSecServiceParameterizedTest.java
+++ b/tests/net/java/com/android/server/IpSecServiceParameterizedTest.java
@@ -18,6 +18,7 @@
import static android.system.OsConstants.AF_INET;
import static android.system.OsConstants.AF_INET6;
+
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.fail;
@@ -45,13 +46,10 @@
import android.net.NetworkUtils;
import android.os.Binder;
import android.os.ParcelFileDescriptor;
-import android.support.test.filters.SmallTest;
import android.system.Os;
import android.test.mock.MockContext;
-import java.net.Socket;
-import java.util.Arrays;
-import java.util.Collection;
+import androidx.test.filters.SmallTest;
import org.junit.Before;
import org.junit.Ignore;
@@ -59,6 +57,10 @@
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
+import java.net.Socket;
+import java.util.Arrays;
+import java.util.Collection;
+
/** Unit tests for {@link IpSecService}. */
@SmallTest
@RunWith(Parameterized.class)
diff --git a/tests/net/java/com/android/server/IpSecServiceRefcountedResourceTest.java b/tests/net/java/com/android/server/IpSecServiceRefcountedResourceTest.java
index cf8f715..68ff777 100644
--- a/tests/net/java/com/android/server/IpSecServiceRefcountedResourceTest.java
+++ b/tests/net/java/com/android/server/IpSecServiceRefcountedResourceTest.java
@@ -31,22 +31,23 @@
import android.os.Binder;
import android.os.IBinder;
import android.os.RemoteException;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import com.android.server.IpSecService.IResource;
import com.android.server.IpSecService.RefcountedResource;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.concurrent.ThreadLocalRandom;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
/** Unit tests for {@link IpSecService.RefcountedResource}. */
@SmallTest
@RunWith(AndroidJUnit4.class)
diff --git a/tests/net/java/com/android/server/IpSecServiceTest.java b/tests/net/java/com/android/server/IpSecServiceTest.java
index 5be7c7b..b5c3e92 100644
--- a/tests/net/java/com/android/server/IpSecServiceTest.java
+++ b/tests/net/java/com/android/server/IpSecServiceTest.java
@@ -20,6 +20,7 @@
import static android.system.OsConstants.EADDRINUSE;
import static android.system.OsConstants.IPPROTO_UDP;
import static android.system.OsConstants.SOCK_DGRAM;
+
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
@@ -39,19 +40,24 @@
import android.net.IpSecConfig;
import android.net.IpSecManager;
import android.net.IpSecSpiResponse;
-import android.net.IpSecTransform;
import android.net.IpSecUdpEncapResponse;
import android.os.Binder;
import android.os.ParcelFileDescriptor;
import android.os.Process;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
import android.system.ErrnoException;
import android.system.Os;
import android.system.StructStat;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import dalvik.system.SocketTagger;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.ArgumentMatcher;
+
import java.io.FileDescriptor;
import java.net.InetAddress;
import java.net.ServerSocket;
@@ -60,11 +66,6 @@
import java.util.ArrayList;
import java.util.List;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.ArgumentMatcher;
-
/** Unit tests for {@link IpSecService}. */
@SmallTest
@RunWith(AndroidJUnit4.class)
diff --git a/tests/net/java/com/android/server/NetworkManagementServiceTest.java b/tests/net/java/com/android/server/NetworkManagementServiceTest.java
index 56a075b..6fb3225 100644
--- a/tests/net/java/com/android/server/NetworkManagementServiceTest.java
+++ b/tests/net/java/com/android/server/NetworkManagementServiceTest.java
@@ -26,21 +26,19 @@
import android.content.Context;
import android.net.INetd;
import android.net.LinkAddress;
-import android.net.LocalSocket;
import android.net.LocalServerSocket;
+import android.net.LocalSocket;
import android.os.BatteryStats;
import android.os.Binder;
import android.os.IBinder;
-import android.support.test.runner.AndroidJUnit4;
import android.test.suitebuilder.annotation.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.internal.app.IBatteryStats;
import com.android.server.NetworkManagementService.SystemServices;
import com.android.server.net.BaseNetworkObserver;
-import java.io.IOException;
-import java.io.OutputStream;
-
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -48,6 +46,9 @@
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
+import java.io.IOException;
+import java.io.OutputStream;
+
/**
* Tests for {@link NetworkManagementService}.
*/
diff --git a/tests/net/java/com/android/server/NsdServiceTest.java b/tests/net/java/com/android/server/NsdServiceTest.java
index b88c784..a90fa68 100644
--- a/tests/net/java/com/android/server/NsdServiceTest.java
+++ b/tests/net/java/com/android/server/NsdServiceTest.java
@@ -22,23 +22,25 @@
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.reset;
import static org.mockito.Mockito.timeout;
-import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
+import android.content.ContentResolver;
+import android.content.Context;
+import android.net.nsd.NsdManager;
+import android.net.nsd.NsdServiceInfo;
import android.os.Handler;
import android.os.HandlerThread;
import android.os.Looper;
import android.os.Message;
-import android.content.Context;
-import android.content.ContentResolver;
-import android.net.nsd.NsdManager;
-import android.net.nsd.NsdServiceInfo;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.server.NsdService.DaemonConnection;
import com.android.server.NsdService.DaemonConnectionSupplier;
import com.android.server.NsdService.NativeCallbackReceiver;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
diff --git a/tests/net/java/com/android/server/connectivity/DnsManagerTest.java b/tests/net/java/com/android/server/connectivity/DnsManagerTest.java
index 38322e9..15ba43d 100644
--- a/tests/net/java/com/android/server/connectivity/DnsManagerTest.java
+++ b/tests/net/java/com/android/server/connectivity/DnsManagerTest.java
@@ -37,10 +37,11 @@
import android.net.shared.PrivateDnsConfig;
import android.os.INetworkManagementService;
import android.provider.Settings;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
import android.test.mock.MockContentResolver;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.internal.util.test.FakeSettingsProvider;
import org.junit.Before;
diff --git a/tests/net/java/com/android/server/connectivity/IpConnectivityEventBuilderTest.java b/tests/net/java/com/android/server/connectivity/IpConnectivityEventBuilderTest.java
index 0656c5f..70495cc 100644
--- a/tests/net/java/com/android/server/connectivity/IpConnectivityEventBuilderTest.java
+++ b/tests/net/java/com/android/server/connectivity/IpConnectivityEventBuilderTest.java
@@ -16,52 +16,44 @@
package com.android.server.connectivity;
-import static android.net.metrics.INetdEventListener.EVENT_GETADDRINFO;
-import static android.net.metrics.INetdEventListener.EVENT_GETHOSTBYNAME;
-import static com.android.server.connectivity.MetricsTestUtil.aBool;
-import static com.android.server.connectivity.MetricsTestUtil.aByteArray;
import static com.android.server.connectivity.MetricsTestUtil.aLong;
import static com.android.server.connectivity.MetricsTestUtil.aString;
import static com.android.server.connectivity.MetricsTestUtil.aType;
import static com.android.server.connectivity.MetricsTestUtil.anInt;
-import static com.android.server.connectivity.MetricsTestUtil.anIntArray;
-import static com.android.server.connectivity.MetricsTestUtil.b;
import static com.android.server.connectivity.MetricsTestUtil.describeIpEvent;
-import static com.android.server.connectivity.metrics.nano.IpConnectivityLogClass.IpConnectivityLog;
import static com.android.server.connectivity.metrics.nano.IpConnectivityLogClass.BLUETOOTH;
import static com.android.server.connectivity.metrics.nano.IpConnectivityLogClass.CELLULAR;
-import static com.android.server.connectivity.metrics.nano.IpConnectivityLogClass.ETHERNET;
+import static com.android.server.connectivity.metrics.nano.IpConnectivityLogClass.IpConnectivityLog;
import static com.android.server.connectivity.metrics.nano.IpConnectivityLogClass.MULTIPLE;
import static com.android.server.connectivity.metrics.nano.IpConnectivityLogClass.WIFI;
+
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
import android.net.ConnectivityMetricsEvent;
import android.net.metrics.ApfProgramEvent;
import android.net.metrics.ApfStats;
-import android.net.metrics.ConnectStats;
import android.net.metrics.DefaultNetworkEvent;
import android.net.metrics.DhcpClientEvent;
import android.net.metrics.DhcpErrorEvent;
-import android.net.metrics.DnsEvent;
-import android.net.metrics.DnsEvent;
import android.net.metrics.IpManagerEvent;
import android.net.metrics.IpReachabilityEvent;
import android.net.metrics.NetworkEvent;
import android.net.metrics.RaEvent;
import android.net.metrics.ValidationProbeEvent;
import android.net.metrics.WakeupStats;
-import android.support.test.runner.AndroidJUnit4;
import android.test.suitebuilder.annotation.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.server.connectivity.metrics.nano.IpConnectivityLogClass.IpConnectivityEvent;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
import java.util.Arrays;
import java.util.List;
-import org.junit.runner.RunWith;
-import org.junit.Test;
-
// TODO: instead of comparing textpb to textpb, parse textpb and compare proto to proto.
@RunWith(AndroidJUnit4.class)
@SmallTest
diff --git a/tests/net/java/com/android/server/connectivity/IpConnectivityMetricsTest.java b/tests/net/java/com/android/server/connectivity/IpConnectivityMetricsTest.java
index 1a0cb74..d5b2c87 100644
--- a/tests/net/java/com/android/server/connectivity/IpConnectivityMetricsTest.java
+++ b/tests/net/java/com/android/server/connectivity/IpConnectivityMetricsTest.java
@@ -47,11 +47,12 @@
import android.net.metrics.RaEvent;
import android.net.metrics.ValidationProbeEvent;
import android.os.Parcelable;
-import android.support.test.runner.AndroidJUnit4;
import android.system.OsConstants;
import android.test.suitebuilder.annotation.SmallTest;
import android.util.Base64;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.internal.util.BitUtils;
import com.android.server.connectivity.metrics.nano.IpConnectivityLogClass;
diff --git a/tests/net/java/com/android/server/connectivity/LingerMonitorTest.java b/tests/net/java/com/android/server/connectivity/LingerMonitorTest.java
index aa6cbda..38352b3 100644
--- a/tests/net/java/com/android/server/connectivity/LingerMonitorTest.java
+++ b/tests/net/java/com/android/server/connectivity/LingerMonitorTest.java
@@ -38,10 +38,11 @@
import android.net.NetworkInfo;
import android.net.NetworkMisc;
import android.os.INetworkManagementService;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
import android.text.format.DateUtils;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.internal.R;
import com.android.server.ConnectivityService;
import com.android.server.connectivity.NetworkNotificationManager.NotificationType;
diff --git a/tests/net/java/com/android/server/connectivity/MultipathPolicyTrackerTest.java b/tests/net/java/com/android/server/connectivity/MultipathPolicyTrackerTest.java
index e58811b..b783467 100644
--- a/tests/net/java/com/android/server/connectivity/MultipathPolicyTrackerTest.java
+++ b/tests/net/java/com/android/server/connectivity/MultipathPolicyTrackerTest.java
@@ -28,7 +28,6 @@
import static com.android.server.net.NetworkPolicyManagerInternal.QUOTA_TYPE_MULTIPATH;
import static com.android.server.net.NetworkPolicyManagerService.OPPORTUNISTIC_QUOTA_UNKNOWN;
-import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
import static org.mockito.ArgumentMatchers.any;
@@ -54,13 +53,14 @@
import android.net.StringNetworkSpecifier;
import android.os.Handler;
import android.provider.Settings;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
import android.telephony.TelephonyManager;
import android.test.mock.MockContentResolver;
import android.util.DataUnit;
import android.util.RecurrenceRule;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.internal.R;
import com.android.internal.util.test.FakeSettingsProvider;
import com.android.server.LocalServices;
diff --git a/tests/net/java/com/android/server/connectivity/Nat464XlatTest.java b/tests/net/java/com/android/server/connectivity/Nat464XlatTest.java
index 37c0df8..cc09fb7 100644
--- a/tests/net/java/com/android/server/connectivity/Nat464XlatTest.java
+++ b/tests/net/java/com/android/server/connectivity/Nat464XlatTest.java
@@ -37,8 +37,9 @@
import android.os.Handler;
import android.os.INetworkManagementService;
import android.os.test.TestLooper;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import com.android.server.ConnectivityService;
diff --git a/tests/net/java/com/android/server/connectivity/NetdEventListenerServiceTest.java b/tests/net/java/com/android/server/connectivity/NetdEventListenerServiceTest.java
index 67805c9..e4117b8 100644
--- a/tests/net/java/com/android/server/connectivity/NetdEventListenerServiceTest.java
+++ b/tests/net/java/com/android/server/connectivity/NetdEventListenerServiceTest.java
@@ -18,43 +18,37 @@
import static android.net.metrics.INetdEventListener.EVENT_GETADDRINFO;
import static android.net.metrics.INetdEventListener.EVENT_GETHOSTBYNAME;
+
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
-import static org.mockito.Mockito.any;
import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.anyInt;
-import static org.mockito.Mockito.eq;
-import static org.mockito.Mockito.timeout;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.Network;
import android.net.NetworkCapabilities;
-import android.support.test.runner.AndroidJUnit4;
import android.system.OsConstants;
import android.test.suitebuilder.annotation.SmallTest;
import android.util.Base64;
-import com.android.server.connectivity.metrics.nano.IpConnectivityLogClass.DNSLookupBatch;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.server.connectivity.metrics.nano.IpConnectivityLogClass.IpConnectivityEvent;
import com.android.server.connectivity.metrics.nano.IpConnectivityLogClass.IpConnectivityLog;
-import java.io.FileOutputStream;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Comparator;
-import java.util.List;
-
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
+import java.io.FileOutputStream;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.Arrays;
+import java.util.Comparator;
+import java.util.List;
+
@RunWith(AndroidJUnit4.class)
@SmallTest
public class NetdEventListenerServiceTest {
diff --git a/tests/net/java/com/android/server/connectivity/NetworkNotificationManagerTest.java b/tests/net/java/com/android/server/connectivity/NetworkNotificationManagerTest.java
index 273b8fc..9580763 100644
--- a/tests/net/java/com/android/server/connectivity/NetworkNotificationManagerTest.java
+++ b/tests/net/java/com/android/server/connectivity/NetworkNotificationManagerTest.java
@@ -35,10 +35,11 @@
import android.content.res.Resources;
import android.net.NetworkCapabilities;
import android.net.NetworkInfo;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
import android.telephony.TelephonyManager;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.server.connectivity.NetworkNotificationManager.NotificationType;
import org.junit.Before;
diff --git a/tests/net/java/com/android/server/connectivity/PermissionMonitorTest.java b/tests/net/java/com/android/server/connectivity/PermissionMonitorTest.java
index f2bd770..354c08f 100644
--- a/tests/net/java/com/android/server/connectivity/PermissionMonitorTest.java
+++ b/tests/net/java/com/android/server/connectivity/PermissionMonitorTest.java
@@ -50,8 +50,9 @@
import android.os.Build;
import android.os.INetworkManagementService;
import android.os.UserHandle;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import org.junit.Before;
import org.junit.Test;
diff --git a/tests/net/java/com/android/server/connectivity/TetheringTest.java b/tests/net/java/com/android/server/connectivity/TetheringTest.java
index 533d7ad..a12b0a0 100644
--- a/tests/net/java/com/android/server/connectivity/TetheringTest.java
+++ b/tests/net/java/com/android/server/connectivity/TetheringTest.java
@@ -98,11 +98,12 @@
import android.os.UserManager;
import android.os.test.TestLooper;
import android.provider.Settings;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
import android.telephony.CarrierConfigManager;
import android.test.mock.MockContentResolver;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.internal.util.ArrayUtils;
import com.android.internal.util.StateMachine;
import com.android.internal.util.test.BroadcastInterceptingContext;
diff --git a/tests/net/java/com/android/server/connectivity/VpnTest.java b/tests/net/java/com/android/server/connectivity/VpnTest.java
index b5d1ff9..2cae250 100644
--- a/tests/net/java/com/android/server/connectivity/VpnTest.java
+++ b/tests/net/java/com/android/server/connectivity/VpnTest.java
@@ -73,11 +73,12 @@
import android.os.SystemClock;
import android.os.UserHandle;
import android.os.UserManager;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
import android.util.ArrayMap;
import android.util.ArraySet;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.internal.R;
import com.android.internal.net.VpnConfig;
diff --git a/tests/net/java/com/android/server/connectivity/tethering/EntitlementManagerTest.java b/tests/net/java/com/android/server/connectivity/tethering/EntitlementManagerTest.java
index 193f380..3944fad 100644
--- a/tests/net/java/com/android/server/connectivity/tethering/EntitlementManagerTest.java
+++ b/tests/net/java/com/android/server/connectivity/tethering/EntitlementManagerTest.java
@@ -42,11 +42,12 @@
import android.os.ResultReceiver;
import android.os.test.TestLooper;
import android.provider.Settings;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
import android.telephony.CarrierConfigManager;
import android.test.mock.MockContentResolver;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.internal.R;
import com.android.internal.util.State;
import com.android.internal.util.StateMachine;
@@ -225,7 +226,7 @@
mCallbacklatch.countDown();
}
};
- mEnMgr.getLatestTetheringEntitlementValue(TETHERING_WIFI, receiver, true);
+ mEnMgr.getLatestTetheringEntitlementResult(TETHERING_WIFI, receiver, true);
callbackTimeoutHelper(mCallbacklatch);
assertFalse(mEnMgr.everRunUiEntitlement);
@@ -241,7 +242,7 @@
mCallbacklatch.countDown();
}
};
- mEnMgr.getLatestTetheringEntitlementValue(TETHERING_WIFI, receiver, false);
+ mEnMgr.getLatestTetheringEntitlementResult(TETHERING_WIFI, receiver, false);
callbackTimeoutHelper(mCallbacklatch);
assertFalse(mEnMgr.everRunUiEntitlement);
// 3. No cache value and ui entitlement check is needed.
@@ -254,7 +255,7 @@
mCallbacklatch.countDown();
}
};
- mEnMgr.getLatestTetheringEntitlementValue(TETHERING_WIFI, receiver, true);
+ mEnMgr.getLatestTetheringEntitlementResult(TETHERING_WIFI, receiver, true);
mLooper.dispatchAll();
callbackTimeoutHelper(mCallbacklatch);
assertTrue(mEnMgr.everRunUiEntitlement);
@@ -268,7 +269,7 @@
mCallbacklatch.countDown();
}
};
- mEnMgr.getLatestTetheringEntitlementValue(TETHERING_WIFI, receiver, false);
+ mEnMgr.getLatestTetheringEntitlementResult(TETHERING_WIFI, receiver, false);
callbackTimeoutHelper(mCallbacklatch);
assertFalse(mEnMgr.everRunUiEntitlement);
// 5. Cache value is TETHER_ERROR_PROVISION_FAILED and ui entitlement check is needed.
@@ -281,7 +282,7 @@
mCallbacklatch.countDown();
}
};
- mEnMgr.getLatestTetheringEntitlementValue(TETHERING_WIFI, receiver, true);
+ mEnMgr.getLatestTetheringEntitlementResult(TETHERING_WIFI, receiver, true);
mLooper.dispatchAll();
callbackTimeoutHelper(mCallbacklatch);
assertTrue(mEnMgr.everRunUiEntitlement);
@@ -295,7 +296,7 @@
mCallbacklatch.countDown();
}
};
- mEnMgr.getLatestTetheringEntitlementValue(TETHERING_WIFI, receiver, true);
+ mEnMgr.getLatestTetheringEntitlementResult(TETHERING_WIFI, receiver, true);
callbackTimeoutHelper(mCallbacklatch);
assertFalse(mEnMgr.everRunUiEntitlement);
// 7. Test get value for other downstream type.
@@ -307,7 +308,7 @@
mCallbacklatch.countDown();
}
};
- mEnMgr.getLatestTetheringEntitlementValue(TETHERING_USB, receiver, false);
+ mEnMgr.getLatestTetheringEntitlementResult(TETHERING_USB, receiver, false);
callbackTimeoutHelper(mCallbacklatch);
assertFalse(mEnMgr.everRunUiEntitlement);
}
diff --git a/tests/net/java/com/android/server/connectivity/tethering/OffloadControllerTest.java b/tests/net/java/com/android/server/connectivity/tethering/OffloadControllerTest.java
index b98f63b..be54b1a 100644
--- a/tests/net/java/com/android/server/connectivity/tethering/OffloadControllerTest.java
+++ b/tests/net/java/com/android/server/connectivity/tethering/OffloadControllerTest.java
@@ -23,7 +23,9 @@
import static android.net.NetworkStats.UID_ALL;
import static android.net.TrafficStats.UID_TETHERING;
import static android.provider.Settings.Global.TETHER_OFFLOAD_DISABLED;
+
import static com.android.server.connectivity.tethering.OffloadHardwareInterface.ForwardedStats;
+
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
@@ -35,7 +37,6 @@
import static org.mockito.Mockito.clearInvocations;
import static org.mockito.Mockito.inOrder;
import static org.mockito.Mockito.never;
-import static org.mockito.Mockito.reset;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;
@@ -52,30 +53,30 @@
import android.net.util.SharedLog;
import android.os.ConditionVariable;
import android.os.Handler;
-import android.os.Looper;
import android.os.INetworkManagementService;
+import android.os.Looper;
import android.provider.Settings;
import android.provider.Settings.SettingNotFoundException;
-
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
import android.test.mock.MockContentResolver;
-import com.android.internal.util.test.FakeSettingsProvider;
-import java.net.InetAddress;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Set;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
+import com.android.internal.util.test.FakeSettingsProvider;
import org.junit.After;
import org.junit.Before;
-import org.junit.runner.RunWith;
import org.junit.Test;
+import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
import org.mockito.InOrder;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
+import java.net.InetAddress;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Set;
@RunWith(AndroidJUnit4.class)
@SmallTest
diff --git a/tests/net/java/com/android/server/connectivity/tethering/TetheringConfigurationTest.java b/tests/net/java/com/android/server/connectivity/tethering/TetheringConfigurationTest.java
index 01b904d8..36a1b7c 100644
--- a/tests/net/java/com/android/server/connectivity/tethering/TetheringConfigurationTest.java
+++ b/tests/net/java/com/android/server/connectivity/tethering/TetheringConfigurationTest.java
@@ -24,9 +24,7 @@
import static android.provider.Settings.Global.TETHER_ENABLE_LEGACY_DHCP_SERVER;
import static android.telephony.SubscriptionManager.INVALID_SUBSCRIPTION_ID;
-import static com.android.server.connectivity.tethering.TetheringConfiguration.DUN_NOT_REQUIRED;
-import static com.android.server.connectivity.tethering.TetheringConfiguration.DUN_REQUIRED;
-import static com.android.server.connectivity.tethering.TetheringConfiguration.DUN_UNSPECIFIED;
+import static com.android.internal.R.array.config_tether_upstream_types;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
@@ -38,11 +36,12 @@
import android.content.res.Resources;
import android.net.util.SharedLog;
import android.provider.Settings;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
import android.telephony.TelephonyManager;
import android.test.mock.MockContentResolver;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.internal.util.test.BroadcastInterceptingContext;
import com.android.internal.util.test.FakeSettingsProvider;
@@ -52,6 +51,7 @@
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
+import java.util.Arrays;
import java.util.Iterator;
@RunWith(AndroidJUnit4.class)
@@ -112,74 +112,103 @@
.thenReturn(new String[]{ "test_wlan\\d" });
when(mResources.getStringArray(com.android.internal.R.array.config_tether_bluetooth_regexs))
.thenReturn(new String[0]);
- when(mResources.getIntArray(com.android.internal.R.array.config_tether_upstream_types))
- .thenReturn(new int[0]);
+ when(mResources.getIntArray(config_tether_upstream_types)).thenReturn(new int[0]);
when(mResources.getStringArray(
com.android.internal.R.array.config_mobile_hotspot_provision_app))
.thenReturn(new String[0]);
mContentResolver = new MockContentResolver();
mContentResolver.addProvider(Settings.AUTHORITY, new FakeSettingsProvider());
+ mHasTelephonyManager = true;
mMockContext = new MockContext(mContext);
}
+ private TetheringConfiguration getTetheringConfiguration(int[] legacyTetherUpstreamTypes) {
+ when(mResources.getIntArray(config_tether_upstream_types)).thenReturn(
+ legacyTetherUpstreamTypes);
+ return new TetheringConfiguration(mMockContext, mLog, INVALID_SUBSCRIPTION_ID);
+ }
+
+ @Test
+ public void testNoTelephonyManagerMeansNoDun() {
+ mHasTelephonyManager = false;
+ final TetheringConfiguration cfg = getTetheringConfiguration(
+ new int[]{TYPE_MOBILE_DUN, TYPE_WIFI});
+ assertFalse(cfg.isDunRequired);
+ assertFalse(cfg.preferredUpstreamIfaceTypes.contains(TYPE_MOBILE_DUN));
+ // Just to prove we haven't clobbered Wi-Fi:
+ assertTrue(cfg.preferredUpstreamIfaceTypes.contains(TYPE_WIFI));
+ }
+
@Test
public void testDunFromTelephonyManagerMeansDun() {
- when(mResources.getIntArray(com.android.internal.R.array.config_tether_upstream_types))
- .thenReturn(new int[]{TYPE_MOBILE, TYPE_WIFI, TYPE_MOBILE_HIPRI});
- mHasTelephonyManager = true;
- when(mTelephonyManager.getTetherApnRequired()).thenReturn(DUN_REQUIRED);
+ when(mTelephonyManager.getTetherApnRequired()).thenReturn(true);
- final TetheringConfiguration cfg = new TetheringConfiguration(
- mMockContext, mLog, INVALID_SUBSCRIPTION_ID);
- assertTrue(cfg.isDunRequired);
- assertTrue(cfg.preferredUpstreamIfaceTypes.contains(TYPE_MOBILE_DUN));
- assertFalse(cfg.preferredUpstreamIfaceTypes.contains(TYPE_MOBILE));
- assertFalse(cfg.preferredUpstreamIfaceTypes.contains(TYPE_MOBILE_HIPRI));
- // Just to prove we haven't clobbered Wi-Fi:
- assertTrue(cfg.preferredUpstreamIfaceTypes.contains(TYPE_WIFI));
+ final TetheringConfiguration cfgWifi = getTetheringConfiguration(new int[]{TYPE_WIFI});
+ final TetheringConfiguration cfgMobileWifiHipri = getTetheringConfiguration(
+ new int[]{TYPE_MOBILE, TYPE_WIFI, TYPE_MOBILE_HIPRI});
+ final TetheringConfiguration cfgWifiDun = getTetheringConfiguration(
+ new int[]{TYPE_WIFI, TYPE_MOBILE_DUN});
+ final TetheringConfiguration cfgMobileWifiHipriDun = getTetheringConfiguration(
+ new int[]{TYPE_MOBILE, TYPE_WIFI, TYPE_MOBILE_HIPRI, TYPE_MOBILE_DUN});
+
+ for (TetheringConfiguration cfg : Arrays.asList(cfgWifi, cfgMobileWifiHipri,
+ cfgWifiDun, cfgMobileWifiHipriDun)) {
+ String msg = "config=" + cfg.toString();
+ assertTrue(msg, cfg.isDunRequired);
+ assertTrue(msg, cfg.preferredUpstreamIfaceTypes.contains(TYPE_MOBILE_DUN));
+ assertFalse(msg, cfg.preferredUpstreamIfaceTypes.contains(TYPE_MOBILE));
+ assertFalse(msg, cfg.preferredUpstreamIfaceTypes.contains(TYPE_MOBILE_HIPRI));
+ // Just to prove we haven't clobbered Wi-Fi:
+ assertTrue(msg, cfg.preferredUpstreamIfaceTypes.contains(TYPE_WIFI));
+ }
}
@Test
public void testDunNotRequiredFromTelephonyManagerMeansNoDun() {
- when(mResources.getIntArray(com.android.internal.R.array.config_tether_upstream_types))
- .thenReturn(new int[]{TYPE_MOBILE_DUN, TYPE_WIFI});
- mHasTelephonyManager = true;
- when(mTelephonyManager.getTetherApnRequired()).thenReturn(DUN_NOT_REQUIRED);
+ when(mTelephonyManager.getTetherApnRequired()).thenReturn(false);
- final TetheringConfiguration cfg = new TetheringConfiguration(
- mMockContext, mLog, INVALID_SUBSCRIPTION_ID);
- assertFalse(cfg.isDunRequired);
- assertFalse(cfg.preferredUpstreamIfaceTypes.contains(TYPE_MOBILE_DUN));
- assertTrue(cfg.preferredUpstreamIfaceTypes.contains(TYPE_MOBILE));
- assertTrue(cfg.preferredUpstreamIfaceTypes.contains(TYPE_MOBILE_HIPRI));
- // Just to prove we haven't clobbered Wi-Fi:
- assertTrue(cfg.preferredUpstreamIfaceTypes.contains(TYPE_WIFI));
- }
+ final TetheringConfiguration cfgWifi = getTetheringConfiguration(new int[]{TYPE_WIFI});
+ final TetheringConfiguration cfgMobileWifiHipri = getTetheringConfiguration(
+ new int[]{TYPE_MOBILE, TYPE_WIFI, TYPE_MOBILE_HIPRI});
+ final TetheringConfiguration cfgWifiDun = getTetheringConfiguration(
+ new int[]{TYPE_WIFI, TYPE_MOBILE_DUN});
+ final TetheringConfiguration cfgWifiMobile = getTetheringConfiguration(
+ new int[]{TYPE_WIFI, TYPE_MOBILE});
+ final TetheringConfiguration cfgWifiHipri = getTetheringConfiguration(
+ new int[]{TYPE_WIFI, TYPE_MOBILE_HIPRI});
+ final TetheringConfiguration cfgMobileWifiHipriDun = getTetheringConfiguration(
+ new int[]{TYPE_MOBILE, TYPE_WIFI, TYPE_MOBILE_HIPRI, TYPE_MOBILE_DUN});
- @Test
- public void testDunFromUpstreamConfigMeansDun() {
- when(mResources.getIntArray(com.android.internal.R.array.config_tether_upstream_types))
- .thenReturn(new int[]{TYPE_MOBILE_DUN, TYPE_WIFI});
- mHasTelephonyManager = false;
- when(mTelephonyManager.getTetherApnRequired()).thenReturn(DUN_UNSPECIFIED);
+ String msg;
+ // TYPE_MOBILE_DUN should not be present in all of the combinations.
+ // TYPE_WIFI should not be affected.
+ for (TetheringConfiguration cfg : Arrays.asList(cfgWifi, cfgMobileWifiHipri, cfgWifiDun,
+ cfgWifiMobile, cfgWifiHipri, cfgMobileWifiHipriDun)) {
+ msg = "config=" + cfg.toString();
+ assertFalse(msg, cfg.isDunRequired);
+ assertFalse(msg, cfg.preferredUpstreamIfaceTypes.contains(TYPE_MOBILE_DUN));
+ assertTrue(msg, cfg.preferredUpstreamIfaceTypes.contains(TYPE_WIFI));
+ }
- final TetheringConfiguration cfg = new TetheringConfiguration(
- mMockContext, mLog, INVALID_SUBSCRIPTION_ID);
- assertTrue(cfg.isDunRequired);
- assertTrue(cfg.preferredUpstreamIfaceTypes.contains(TYPE_MOBILE_DUN));
- // Just to prove we haven't clobbered Wi-Fi:
- assertTrue(cfg.preferredUpstreamIfaceTypes.contains(TYPE_WIFI));
- // Check that we have not added new cellular interface types
- assertFalse(cfg.preferredUpstreamIfaceTypes.contains(TYPE_MOBILE));
- assertFalse(cfg.preferredUpstreamIfaceTypes.contains(TYPE_MOBILE_HIPRI));
+ for (TetheringConfiguration cfg : Arrays.asList(cfgWifi, cfgMobileWifiHipri, cfgWifiDun,
+ cfgMobileWifiHipriDun)) {
+ msg = "config=" + cfg.toString();
+ assertTrue(msg, cfg.preferredUpstreamIfaceTypes.contains(TYPE_MOBILE));
+ assertTrue(msg, cfg.preferredUpstreamIfaceTypes.contains(TYPE_MOBILE_HIPRI));
+ }
+ msg = "config=" + cfgWifiMobile.toString();
+ assertTrue(msg, cfgWifiMobile.preferredUpstreamIfaceTypes.contains(TYPE_MOBILE));
+ assertFalse(msg, cfgWifiMobile.preferredUpstreamIfaceTypes.contains(TYPE_MOBILE_HIPRI));
+ msg = "config=" + cfgWifiHipri.toString();
+ assertFalse(msg, cfgWifiHipri.preferredUpstreamIfaceTypes.contains(TYPE_MOBILE));
+ assertTrue(msg, cfgWifiHipri.preferredUpstreamIfaceTypes.contains(TYPE_MOBILE_HIPRI));
+
}
@Test
public void testNoDefinedUpstreamTypesAddsEthernet() {
- when(mResources.getIntArray(com.android.internal.R.array.config_tether_upstream_types))
- .thenReturn(new int[]{});
- mHasTelephonyManager = false;
- when(mTelephonyManager.getTetherApnRequired()).thenReturn(DUN_UNSPECIFIED);
+ when(mResources.getIntArray(config_tether_upstream_types)).thenReturn(new int[]{});
+ when(mTelephonyManager.getTetherApnRequired()).thenReturn(false);
final TetheringConfiguration cfg = new TetheringConfiguration(
mMockContext, mLog, INVALID_SUBSCRIPTION_ID);
@@ -187,8 +216,10 @@
assertTrue(upstreamIterator.hasNext());
assertEquals(TYPE_ETHERNET, upstreamIterator.next().intValue());
// The following is because the code always adds some kind of mobile
- // upstream, be it DUN or, in this case where we use DUN_UNSPECIFIED,
- // both vanilla and hipri mobile types.
+ // upstream, be it DUN or, in this case where DUN is NOT required,
+ // make sure there is at least one of MOBILE or HIPRI. With the empty
+ // list of the configuration in this test, it will always add both
+ // MOBILE and HIPRI, in that order.
assertTrue(upstreamIterator.hasNext());
assertEquals(TYPE_MOBILE, upstreamIterator.next().intValue());
assertTrue(upstreamIterator.hasNext());
@@ -198,10 +229,9 @@
@Test
public void testDefinedUpstreamTypesSansEthernetAddsEthernet() {
- when(mResources.getIntArray(com.android.internal.R.array.config_tether_upstream_types))
- .thenReturn(new int[]{TYPE_WIFI, TYPE_MOBILE_HIPRI});
- mHasTelephonyManager = false;
- when(mTelephonyManager.getTetherApnRequired()).thenReturn(DUN_UNSPECIFIED);
+ when(mResources.getIntArray(config_tether_upstream_types)).thenReturn(
+ new int[]{TYPE_WIFI, TYPE_MOBILE_HIPRI});
+ when(mTelephonyManager.getTetherApnRequired()).thenReturn(false);
final TetheringConfiguration cfg = new TetheringConfiguration(
mMockContext, mLog, INVALID_SUBSCRIPTION_ID);
@@ -217,10 +247,9 @@
@Test
public void testDefinedUpstreamTypesWithEthernetDoesNotAddEthernet() {
- when(mResources.getIntArray(com.android.internal.R.array.config_tether_upstream_types))
+ when(mResources.getIntArray(config_tether_upstream_types))
.thenReturn(new int[]{TYPE_WIFI, TYPE_ETHERNET, TYPE_MOBILE_HIPRI});
- mHasTelephonyManager = false;
- when(mTelephonyManager.getTetherApnRequired()).thenReturn(DUN_UNSPECIFIED);
+ when(mTelephonyManager.getTetherApnRequired()).thenReturn(false);
final TetheringConfiguration cfg = new TetheringConfiguration(
mMockContext, mLog, INVALID_SUBSCRIPTION_ID);
@@ -276,9 +305,7 @@
when(mResourcesForSubId.getStringArray(
com.android.internal.R.array.config_tether_bluetooth_regexs))
.thenReturn(new String[0]);
- when(mResourcesForSubId.getIntArray(
- com.android.internal.R.array.config_tether_upstream_types))
- .thenReturn(new int[0]);
+ when(mResourcesForSubId.getIntArray(config_tether_upstream_types)).thenReturn(new int[0]);
when(mResourcesForSubId.getStringArray(
com.android.internal.R.array.config_mobile_hotspot_provision_app))
.thenReturn(PROVISIONING_APP_NAME);
diff --git a/tests/net/java/com/android/server/connectivity/tethering/UpstreamNetworkMonitorTest.java b/tests/net/java/com/android/server/connectivity/tethering/UpstreamNetworkMonitorTest.java
index 0afd607..5a1f853 100644
--- a/tests/net/java/com/android/server/connectivity/tethering/UpstreamNetworkMonitorTest.java
+++ b/tests/net/java/com/android/server/connectivity/tethering/UpstreamNetworkMonitorTest.java
@@ -41,8 +41,6 @@
import static org.mockito.Mockito.when;
import android.content.Context;
-import android.os.Handler;
-import android.os.Message;
import android.net.ConnectivityManager;
import android.net.ConnectivityManager.NetworkCallback;
import android.net.IConnectivityManager;
@@ -54,16 +52,19 @@
import android.net.NetworkRequest;
import android.net.NetworkState;
import android.net.util.SharedLog;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+import android.os.Handler;
+import android.os.Message;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import com.android.internal.util.State;
import com.android.internal.util.StateMachine;
import org.junit.After;
import org.junit.Before;
-import org.junit.runner.RunWith;
import org.junit.Test;
+import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
@@ -76,7 +77,6 @@
import java.util.Objects;
import java.util.Set;
-
@RunWith(AndroidJUnit4.class)
@SmallTest
public class UpstreamNetworkMonitorTest {
diff --git a/tests/net/java/com/android/server/net/NetworkStatsAccessTest.java b/tests/net/java/com/android/server/net/NetworkStatsAccessTest.java
index b870bbd..6e725dd 100644
--- a/tests/net/java/com/android/server/net/NetworkStatsAccessTest.java
+++ b/tests/net/java/com/android/server/net/NetworkStatsAccessTest.java
@@ -26,10 +26,11 @@
import android.app.admin.DevicePolicyManagerInternal;
import android.content.Context;
import android.content.pm.PackageManager;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
import android.telephony.TelephonyManager;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.server.LocalServices;
import org.junit.After;
diff --git a/tests/net/java/com/android/server/net/NetworkStatsCollectionTest.java b/tests/net/java/com/android/server/net/NetworkStatsCollectionTest.java
index 6f14332..830c928 100644
--- a/tests/net/java/com/android/server/net/NetworkStatsCollectionTest.java
+++ b/tests/net/java/com/android/server/net/NetworkStatsCollectionTest.java
@@ -26,12 +26,13 @@
import static android.os.Process.myUid;
import static android.text.format.DateUtils.HOUR_IN_MILLIS;
import static android.text.format.DateUtils.MINUTE_IN_MILLIS;
+
+import static com.android.server.net.NetworkStatsCollection.multiplySafe;
+
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.fail;
-import static com.android.server.net.NetworkStatsCollection.multiplySafe;
-
import android.content.res.Resources;
import android.net.ConnectivityManager;
import android.net.NetworkIdentity;
@@ -40,20 +41,26 @@
import android.net.NetworkTemplate;
import android.os.Process;
import android.os.UserHandle;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
import android.telephony.SubscriptionPlan;
import android.telephony.TelephonyManager;
import android.test.MoreAsserts;
import android.text.format.DateUtils;
import android.util.RecurrenceRule;
+import androidx.test.InstrumentationRegistry;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.frameworks.tests.net.R;
import libcore.io.IoUtils;
import libcore.io.Streams;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;
@@ -68,11 +75,6 @@
import java.util.ArrayList;
import java.util.List;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
/**
* Tests for {@link NetworkStatsCollection}.
*/
diff --git a/tests/net/java/com/android/server/net/NetworkStatsObserversTest.java b/tests/net/java/com/android/server/net/NetworkStatsObserversTest.java
index 185c3eb..43a3803 100644
--- a/tests/net/java/com/android/server/net/NetworkStatsObserversTest.java
+++ b/tests/net/java/com/android/server/net/NetworkStatsObserversTest.java
@@ -17,7 +17,6 @@
package com.android.server.net;
import static android.net.ConnectivityManager.TYPE_MOBILE;
-import static android.net.ConnectivityManager.TYPE_WIFI;
import static android.net.NetworkStats.DEFAULT_NETWORK_NO;
import static android.net.NetworkStats.DEFAULT_NETWORK_YES;
import static android.net.NetworkStats.METERED_NO;
@@ -33,11 +32,8 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyInt;
-import static org.mockito.Matchers.isA;
-import static org.mockito.Mockito.when;
import android.app.usage.NetworkStatsManager;
import android.net.DataUsageRequest;
@@ -49,22 +45,17 @@
import android.os.HandlerThread;
import android.os.IBinder;
import android.os.Looper;
-import android.os.Message;
import android.os.Messenger;
import android.os.Process;
import android.os.UserHandle;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
import android.telephony.TelephonyManager;
import android.util.ArrayMap;
-import com.android.internal.net.VpnInfo;
-import com.android.server.net.NetworkStatsService;
-import com.android.server.net.NetworkStatsServiceTest.LatchedHandler;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
-import java.util.ArrayList;
-import java.util.Objects;
-import java.util.List;
+import com.android.internal.net.VpnInfo;
+import com.android.server.net.NetworkStatsServiceTest.LatchedHandler;
import org.junit.Before;
import org.junit.Test;
@@ -73,6 +64,8 @@
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
+import java.util.Objects;
+
/**
* Tests for {@link NetworkStatsObservers}.
*/
diff --git a/tests/net/java/com/android/server/net/NetworkStatsServiceTest.java b/tests/net/java/com/android/server/net/NetworkStatsServiceTest.java
index f89f303..598448b 100644
--- a/tests/net/java/com/android/server/net/NetworkStatsServiceTest.java
+++ b/tests/net/java/com/android/server/net/NetworkStatsServiceTest.java
@@ -70,7 +70,6 @@
import android.content.Context;
import android.content.Intent;
import android.net.DataUsageRequest;
-import android.net.IConnectivityManager;
import android.net.INetworkManagementEventObserver;
import android.net.INetworkStatsSession;
import android.net.LinkProperties;
@@ -92,15 +91,15 @@
import android.os.Messenger;
import android.os.PowerManager;
import android.os.SimpleClock;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
import android.telephony.TelephonyManager;
+import androidx.test.InstrumentationRegistry;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.internal.net.VpnInfo;
import com.android.internal.util.ArrayUtils;
import com.android.internal.util.test.BroadcastInterceptingContext;
-import com.android.server.LocalServices;
import com.android.server.net.NetworkStatsService.NetworkStatsSettings;
import com.android.server.net.NetworkStatsService.NetworkStatsSettings.Config;
@@ -163,7 +162,6 @@
private @Mock INetworkManagementService mNetManager;
private @Mock NetworkStatsSettings mSettings;
- private @Mock IConnectivityManager mConnManager;
private @Mock IBinder mBinder;
private @Mock AlarmManager mAlarmManager;
private HandlerThread mHandlerThread;
@@ -205,7 +203,6 @@
Handler.Callback callback = new NetworkStatsService.HandlerCallback(mService);
mHandler = new Handler(mHandlerThread.getLooper(), callback);
mService.setHandler(mHandler, callback);
- mService.bindConnectivityManager(mConnManager);
mElapsedRealtime = 0L;
@@ -234,7 +231,6 @@
mNetManager = null;
mSettings = null;
- mConnManager = null;
mSession.close();
mService = null;
@@ -245,12 +241,12 @@
// pretend that wifi network comes online; service should ask about full
// network state, and poll any existing interfaces before updating.
expectDefaultSettings();
- expectNetworkState(buildWifiState());
+ NetworkState[] states = new NetworkState[] {buildWifiState()};
expectNetworkStatsSummary(buildEmptyStats());
expectNetworkStatsUidDetail(buildEmptyStats());
expectBandwidthControlCheck();
- mService.forceUpdateIfaces(NETWORKS_WIFI);
+ mService.forceUpdateIfaces(NETWORKS_WIFI, new VpnInfo[0], states, getActiveIface(states));
// verify service has empty history for wifi
assertNetworkTotal(sTemplateWifi, 0L, 0L, 0L, 0L, 0);
@@ -289,12 +285,12 @@
// pretend that wifi network comes online; service should ask about full
// network state, and poll any existing interfaces before updating.
expectDefaultSettings();
- expectNetworkState(buildWifiState());
+ NetworkState[] states = new NetworkState[] {buildWifiState()};
expectNetworkStatsSummary(buildEmptyStats());
expectNetworkStatsUidDetail(buildEmptyStats());
expectBandwidthControlCheck();
- mService.forceUpdateIfaces(NETWORKS_WIFI);
+ mService.forceUpdateIfaces(NETWORKS_WIFI, new VpnInfo[0], states, getActiveIface(states));
// verify service has empty history for wifi
assertNetworkTotal(sTemplateWifi, 0L, 0L, 0L, 0L, 0);
@@ -363,12 +359,12 @@
// pretend that wifi network comes online; service should ask about full
// network state, and poll any existing interfaces before updating.
expectSettings(0L, HOUR_IN_MILLIS, WEEK_IN_MILLIS);
- expectNetworkState(buildWifiState());
+ NetworkState[] states = new NetworkState[] {buildWifiState()};
expectNetworkStatsSummary(buildEmptyStats());
expectNetworkStatsUidDetail(buildEmptyStats());
expectBandwidthControlCheck();
- mService.forceUpdateIfaces(NETWORKS_WIFI);
+ mService.forceUpdateIfaces(NETWORKS_WIFI, new VpnInfo[0], states, getActiveIface(states));
// modify some number on wifi, and trigger poll event
@@ -405,12 +401,12 @@
public void testUidStatsAcrossNetworks() throws Exception {
// pretend first mobile network comes online
expectDefaultSettings();
- expectNetworkState(buildMobile3gState(IMSI_1));
+ NetworkState[] states = new NetworkState[] {buildMobile3gState(IMSI_1)};
expectNetworkStatsSummary(buildEmptyStats());
expectNetworkStatsUidDetail(buildEmptyStats());
expectBandwidthControlCheck();
- mService.forceUpdateIfaces(NETWORKS_MOBILE);
+ mService.forceUpdateIfaces(NETWORKS_MOBILE, new VpnInfo[0], states, getActiveIface(states));
// create some traffic on first network
@@ -437,7 +433,7 @@
// disappearing, to verify we don't count backwards.
incrementCurrentTime(HOUR_IN_MILLIS);
expectDefaultSettings();
- expectNetworkState(buildMobile3gState(IMSI_2));
+ states = new NetworkState[] {buildMobile3gState(IMSI_2)};
expectNetworkStatsSummary(new NetworkStats(getElapsedRealtime(), 1)
.addIfaceValues(TEST_IFACE, 2048L, 16L, 512L, 4L));
expectNetworkStatsUidDetail(new NetworkStats(getElapsedRealtime(), 3)
@@ -446,7 +442,7 @@
.addValues(TEST_IFACE, UID_BLUE, SET_DEFAULT, TAG_NONE, 512L, 4L, 0L, 0L, 0L));
expectBandwidthControlCheck();
- mService.forceUpdateIfaces(NETWORKS_MOBILE);
+ mService.forceUpdateIfaces(NETWORKS_MOBILE, new VpnInfo[0], states, getActiveIface(states));
forcePollAndWaitForIdle();
@@ -481,12 +477,12 @@
public void testUidRemovedIsMoved() throws Exception {
// pretend that network comes online
expectDefaultSettings();
- expectNetworkState(buildWifiState());
+ NetworkState[] states = new NetworkState[] {buildWifiState()};
expectNetworkStatsSummary(buildEmptyStats());
expectNetworkStatsUidDetail(buildEmptyStats());
expectBandwidthControlCheck();
- mService.forceUpdateIfaces(NETWORKS_WIFI);
+ mService.forceUpdateIfaces(NETWORKS_WIFI, new VpnInfo[0], states, getActiveIface(states));
// create some traffic
@@ -540,12 +536,12 @@
public void testUid3g4gCombinedByTemplate() throws Exception {
// pretend that network comes online
expectDefaultSettings();
- expectNetworkState(buildMobile3gState(IMSI_1));
+ NetworkState[] states = new NetworkState[] {buildMobile3gState(IMSI_1)};
expectNetworkStatsSummary(buildEmptyStats());
expectNetworkStatsUidDetail(buildEmptyStats());
expectBandwidthControlCheck();
- mService.forceUpdateIfaces(NETWORKS_MOBILE);
+ mService.forceUpdateIfaces(NETWORKS_MOBILE, new VpnInfo[0], states, getActiveIface(states));
// create some traffic
@@ -566,14 +562,14 @@
// now switch over to 4g network
incrementCurrentTime(HOUR_IN_MILLIS);
expectDefaultSettings();
- expectNetworkState(buildMobile4gState(TEST_IFACE2));
+ states = new NetworkState[] {buildMobile4gState(TEST_IFACE2)};
expectNetworkStatsSummary(buildEmptyStats());
expectNetworkStatsUidDetail(new NetworkStats(getElapsedRealtime(), 1)
.addValues(TEST_IFACE, UID_RED, SET_DEFAULT, TAG_NONE, 1024L, 8L, 1024L, 8L, 0L)
.addValues(TEST_IFACE, UID_RED, SET_DEFAULT, 0xF00D, 512L, 4L, 512L, 4L, 0L));
expectBandwidthControlCheck();
- mService.forceUpdateIfaces(NETWORKS_MOBILE);
+ mService.forceUpdateIfaces(NETWORKS_MOBILE, new VpnInfo[0], states, getActiveIface(states));
forcePollAndWaitForIdle();
@@ -598,12 +594,12 @@
public void testSummaryForAllUid() throws Exception {
// pretend that network comes online
expectDefaultSettings();
- expectNetworkState(buildWifiState());
+ NetworkState[] states = new NetworkState[] {buildWifiState()};
expectNetworkStatsSummary(buildEmptyStats());
expectNetworkStatsUidDetail(buildEmptyStats());
expectBandwidthControlCheck();
- mService.forceUpdateIfaces(NETWORKS_WIFI);
+ mService.forceUpdateIfaces(NETWORKS_WIFI, new VpnInfo[0], states, getActiveIface(states));
// create some traffic for two apps
@@ -657,12 +653,12 @@
public void testDetailedUidStats() throws Exception {
// pretend that network comes online
expectDefaultSettings();
- expectNetworkState(buildWifiState());
+ NetworkState[] states = new NetworkState[] {buildWifiState()};
expectNetworkStatsSummary(buildEmptyStats());
expectNetworkStatsUidDetail(buildEmptyStats());
expectBandwidthControlCheck();
- mService.forceUpdateIfaces(NETWORKS_WIFI);
+ mService.forceUpdateIfaces(NETWORKS_WIFI, new VpnInfo[0], states, getActiveIface(states));
NetworkStats.Entry entry1 = new NetworkStats.Entry(
TEST_IFACE, UID_RED, SET_DEFAULT, TAG_NONE, 50L, 5L, 50L, 5L, 0L);
@@ -700,13 +696,13 @@
stackedProp.setInterfaceName(stackedIface);
final NetworkState wifiState = buildWifiState();
wifiState.linkProperties.addStackedLink(stackedProp);
- expectNetworkState(wifiState);
+ NetworkState[] states = new NetworkState[] {wifiState};
expectNetworkStatsSummary(buildEmptyStats());
expectNetworkStatsUidDetail(buildEmptyStats());
expectBandwidthControlCheck();
- mService.forceUpdateIfaces(NETWORKS_WIFI);
+ mService.forceUpdateIfaces(NETWORKS_WIFI, new VpnInfo[0], states, getActiveIface(states));
NetworkStats.Entry uidStats = new NetworkStats.Entry(
TEST_IFACE, UID_BLUE, SET_DEFAULT, 0xF00D, 1024L, 8L, 512L, 4L, 0L);
@@ -745,12 +741,12 @@
public void testForegroundBackground() throws Exception {
// pretend that network comes online
expectDefaultSettings();
- expectNetworkState(buildWifiState());
+ NetworkState[] states = new NetworkState[] {buildWifiState()};
expectNetworkStatsSummary(buildEmptyStats());
expectNetworkStatsUidDetail(buildEmptyStats());
expectBandwidthControlCheck();
- mService.forceUpdateIfaces(NETWORKS_WIFI);
+ mService.forceUpdateIfaces(NETWORKS_WIFI, new VpnInfo[0], states, getActiveIface(states));
// create some initial traffic
@@ -803,12 +799,12 @@
public void testMetered() throws Exception {
// pretend that network comes online
expectDefaultSettings();
- expectNetworkState(buildWifiState(true /* isMetered */));
+ NetworkState[] states = new NetworkState[] {buildWifiState(true /* isMetered */)};
expectNetworkStatsSummary(buildEmptyStats());
expectNetworkStatsUidDetail(buildEmptyStats());
expectBandwidthControlCheck();
- mService.forceUpdateIfaces(NETWORKS_WIFI);
+ mService.forceUpdateIfaces(NETWORKS_WIFI, new VpnInfo[0], states, getActiveIface(states));
// create some initial traffic
@@ -843,12 +839,13 @@
public void testRoaming() throws Exception {
// pretend that network comes online
expectDefaultSettings();
- expectNetworkState(buildMobile3gState(IMSI_1, true /* isRoaming */));
+ NetworkState[] states =
+ new NetworkState[] {buildMobile3gState(IMSI_1, true /* isRoaming */)};
expectNetworkStatsSummary(buildEmptyStats());
expectNetworkStatsUidDetail(buildEmptyStats());
expectBandwidthControlCheck();
- mService.forceUpdateIfaces(NETWORKS_MOBILE);
+ mService.forceUpdateIfaces(NETWORKS_MOBILE, new VpnInfo[0], states, getActiveIface(states));
// Create some traffic
@@ -882,12 +879,12 @@
public void testTethering() throws Exception {
// pretend first mobile network comes online
expectDefaultSettings();
- expectNetworkState(buildMobile3gState(IMSI_1));
+ NetworkState[] states = new NetworkState[] {buildMobile3gState(IMSI_1)};
expectNetworkStatsSummary(buildEmptyStats());
expectNetworkStatsUidDetail(buildEmptyStats());
expectBandwidthControlCheck();
- mService.forceUpdateIfaces(NETWORKS_MOBILE);
+ mService.forceUpdateIfaces(NETWORKS_MOBILE, new VpnInfo[0], states, getActiveIface(states));
// create some tethering traffic
@@ -925,12 +922,12 @@
// pretend that wifi network comes online; service should ask about full
// network state, and poll any existing interfaces before updating.
expectDefaultSettings();
- expectNetworkState(buildWifiState());
+ NetworkState[] states = new NetworkState[] {buildWifiState()};
expectNetworkStatsSummary(buildEmptyStats());
expectNetworkStatsUidDetail(buildEmptyStats());
expectBandwidthControlCheck();
- mService.forceUpdateIfaces(NETWORKS_WIFI);
+ mService.forceUpdateIfaces(NETWORKS_WIFI, new VpnInfo[0], states, getActiveIface(states));
// verify service has empty history for wifi
assertNetworkTotal(sTemplateWifi, 0L, 0L, 0L, 0L, 0);
@@ -1077,11 +1074,11 @@
expectBandwidthControlCheck();
}
- private void expectNetworkState(NetworkState... state) throws Exception {
- when(mConnManager.getAllNetworkState()).thenReturn(state);
-
- final LinkProperties linkProp = state.length > 0 ? state[0].linkProperties : null;
- when(mConnManager.getActiveLinkProperties()).thenReturn(linkProp);
+ private String getActiveIface(NetworkState... states) throws Exception {
+ if (states == null || states.length == 0 || states[0].linkProperties == null) {
+ return null;
+ }
+ return states[0].linkProperties.getInterfaceName();
}
private void expectNetworkStatsSummary(NetworkStats summary) throws Exception {
@@ -1090,8 +1087,6 @@
private void expectNetworkStatsSummary(NetworkStats summary, NetworkStats tetherStats)
throws Exception {
- when(mConnManager.getAllVpnInfo()).thenReturn(new VpnInfo[0]);
-
expectNetworkStatsTethering(STATS_PER_IFACE, tetherStats);
expectNetworkStatsSummaryDev(summary.clone());
expectNetworkStatsSummaryXt(summary.clone());
diff --git a/tests/net/java/com/android/server/net/ipmemorystore/IpMemoryStoreServiceTest.java b/tests/net/java/com/android/server/net/ipmemorystore/IpMemoryStoreServiceTest.java
index e57433a..be10680 100644
--- a/tests/net/java/com/android/server/net/ipmemorystore/IpMemoryStoreServiceTest.java
+++ b/tests/net/java/com/android/server/net/ipmemorystore/IpMemoryStoreServiceTest.java
@@ -39,9 +39,10 @@
import android.net.ipmemorystore.StatusParcelable;
import android.os.IBinder;
import android.os.RemoteException;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.InstrumentationRegistry;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import org.junit.After;
import org.junit.Before;
diff --git a/tests/net/java/com/android/server/net/ipmemorystore/NetworkAttributesTest.java b/tests/net/java/com/android/server/net/ipmemorystore/NetworkAttributesTest.java
index fe19eee..dc20185 100644
--- a/tests/net/java/com/android/server/net/ipmemorystore/NetworkAttributesTest.java
+++ b/tests/net/java/com/android/server/net/ipmemorystore/NetworkAttributesTest.java
@@ -19,8 +19,9 @@
import static org.junit.Assert.assertEquals;
import android.net.ipmemorystore.NetworkAttributes;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
diff --git a/tests/net/java/com/android/server/net/ipmemorystore/RelevanceUtilsTests.java b/tests/net/java/com/android/server/net/ipmemorystore/RelevanceUtilsTests.java
index 8d367e2..7413b91 100644
--- a/tests/net/java/com/android/server/net/ipmemorystore/RelevanceUtilsTests.java
+++ b/tests/net/java/com/android/server/net/ipmemorystore/RelevanceUtilsTests.java
@@ -22,8 +22,8 @@
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
diff --git a/tests/testables/Android.bp b/tests/testables/Android.bp
index f07f09d..0bad7a4 100644
--- a/tests/testables/Android.bp
+++ b/tests/testables/Android.bp
@@ -25,7 +25,7 @@
libs: [
"android.test.runner",
"android.test.mock",
- "android-support-test",
+ "androidx.test.rules",
"mockito-target-inline-minus-junit4",
],
diff --git a/tests/testables/src/android/testing/AndroidTestingRunner.java b/tests/testables/src/android/testing/AndroidTestingRunner.java
index cf5d4cf..0375220 100644
--- a/tests/testables/src/android/testing/AndroidTestingRunner.java
+++ b/tests/testables/src/android/testing/AndroidTestingRunner.java
@@ -14,13 +14,13 @@
package android.testing;
-import android.support.test.internal.runner.junit4.statement.RunAfters;
-import android.support.test.internal.runner.junit4.statement.RunBefores;
-import android.support.test.internal.runner.junit4.statement.UiThreadStatement;
-
import android.testing.TestableLooper.LooperFrameworkMethod;
import android.testing.TestableLooper.RunWithLooper;
+import androidx.test.internal.runner.junit4.statement.RunAfters;
+import androidx.test.internal.runner.junit4.statement.RunBefores;
+import androidx.test.internal.runner.junit4.statement.UiThreadStatement;
+
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
diff --git a/tests/testables/src/android/testing/BaseFragmentTest.java b/tests/testables/src/android/testing/BaseFragmentTest.java
index 5fa065a..c76b93c 100644
--- a/tests/testables/src/android/testing/BaseFragmentTest.java
+++ b/tests/testables/src/android/testing/BaseFragmentTest.java
@@ -24,13 +24,14 @@
import android.graphics.PixelFormat;
import android.os.Handler;
import android.os.Parcelable;
-import android.support.test.InstrumentationRegistry;
import android.view.LayoutInflater;
import android.view.View;
import android.view.WindowManager;
import android.view.WindowManager.LayoutParams;
import android.widget.FrameLayout;
+import androidx.test.InstrumentationRegistry;
+
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
diff --git a/tests/testables/src/android/testing/TestableInstrumentation.java b/tests/testables/src/android/testing/TestableInstrumentation.java
index 3207b48..f586206 100644
--- a/tests/testables/src/android/testing/TestableInstrumentation.java
+++ b/tests/testables/src/android/testing/TestableInstrumentation.java
@@ -19,9 +19,10 @@
import android.os.Looper;
import android.os.Message;
import android.os.TestLooperManager;
-import android.support.test.runner.AndroidJUnitRunner;
import android.util.Log;
+import androidx.test.runner.AndroidJUnitRunner;
+
import java.util.ArrayList;
/**
diff --git a/tests/testables/src/android/testing/TestableLooper.java b/tests/testables/src/android/testing/TestableLooper.java
index f8d223a..cec8b4b 100644
--- a/tests/testables/src/android/testing/TestableLooper.java
+++ b/tests/testables/src/android/testing/TestableLooper.java
@@ -20,9 +20,10 @@
import android.os.Message;
import android.os.MessageQueue;
import android.os.TestLooperManager;
-import android.support.test.InstrumentationRegistry;
import android.util.ArrayMap;
+import androidx.test.InstrumentationRegistry;
+
import org.junit.runners.model.FrameworkMethod;
import java.lang.annotation.ElementType;
diff --git a/tests/testables/src/android/testing/ViewUtils.java b/tests/testables/src/android/testing/ViewUtils.java
index 1c6016e..80c2e8d 100644
--- a/tests/testables/src/android/testing/ViewUtils.java
+++ b/tests/testables/src/android/testing/ViewUtils.java
@@ -16,7 +16,6 @@
import android.content.pm.ApplicationInfo;
import android.graphics.PixelFormat;
-import android.support.test.InstrumentationRegistry;
import android.view.View;
import android.view.WindowManager;
import android.view.WindowManager.LayoutParams;
diff --git a/tests/testables/tests/Android.mk b/tests/testables/tests/Android.mk
index 79469e3..16fbb18 100644
--- a/tests/testables/tests/Android.mk
+++ b/tests/testables/tests/Android.mk
@@ -27,7 +27,7 @@
LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res
LOCAL_STATIC_JAVA_LIBRARIES := \
- android-support-test \
+ androidx.test.rules hamcrest-library \
mockito-target-inline-minus-junit4 \
testables
diff --git a/tests/testables/tests/AndroidManifest.xml b/tests/testables/tests/AndroidManifest.xml
index 61f0be6..2bfb04f 100644
--- a/tests/testables/tests/AndroidManifest.xml
+++ b/tests/testables/tests/AndroidManifest.xml
@@ -25,7 +25,7 @@
<uses-library android:name="android.test.runner" />
</application>
- <instrumentation android:name="android.support.test.runner.AndroidJUnitRunner"
+ <instrumentation android:name="androidx.test.runner.AndroidJUnitRunner"
android:targetPackage="com.android.testables"
android:label="Tests for Testables">
</instrumentation>
diff --git a/tests/testables/tests/src/android/testing/DexmakerShareClassLoaderRuleTest.java b/tests/testables/tests/src/android/testing/DexmakerShareClassLoaderRuleTest.java
index 2528d09..13addb1 100644
--- a/tests/testables/tests/src/android/testing/DexmakerShareClassLoaderRuleTest.java
+++ b/tests/testables/tests/src/android/testing/DexmakerShareClassLoaderRuleTest.java
@@ -22,8 +22,8 @@
import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
import org.junit.Before;
import org.junit.Test;
diff --git a/tests/testables/tests/src/android/testing/TestableContentResolverTest.java b/tests/testables/tests/src/android/testing/TestableContentResolverTest.java
index 71afda0..f531369 100644
--- a/tests/testables/tests/src/android/testing/TestableContentResolverTest.java
+++ b/tests/testables/tests/src/android/testing/TestableContentResolverTest.java
@@ -2,8 +2,9 @@
import android.content.ContentProvider;
import android.content.IContentProvider;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.filters.SmallTest;
+
+import androidx.test.InstrumentationRegistry;
+import androidx.test.filters.SmallTest;
import org.junit.Assert;
import org.junit.Before;
diff --git a/tests/testables/tests/src/android/testing/TestablePermissionsTest.java b/tests/testables/tests/src/android/testing/TestablePermissionsTest.java
index c56146e..4626de7 100644
--- a/tests/testables/tests/src/android/testing/TestablePermissionsTest.java
+++ b/tests/testables/tests/src/android/testing/TestablePermissionsTest.java
@@ -20,11 +20,10 @@
import static org.junit.Assert.assertEquals;
import android.Manifest.permission;
-import android.content.pm.PackageManager;
import android.net.Uri;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.filters.SmallTest;
-import android.testing.TestableLooper.RunWithLooper;
+
+import androidx.test.InstrumentationRegistry;
+import androidx.test.filters.SmallTest;
import org.junit.Rule;
import org.junit.Test;
diff --git a/tests/testables/tests/src/android/testing/TestableResourcesTest.java b/tests/testables/tests/src/android/testing/TestableResourcesTest.java
index dc7cf95..dd4325c 100644
--- a/tests/testables/tests/src/android/testing/TestableResourcesTest.java
+++ b/tests/testables/tests/src/android/testing/TestableResourcesTest.java
@@ -21,9 +21,10 @@
import static org.junit.Assert.fail;
import android.content.res.Resources;
-import android.support.test.InstrumentationRegistry;
import android.test.suitebuilder.annotation.SmallTest;
+import androidx.test.InstrumentationRegistry;
+
import com.android.testables.R;
import org.junit.Rule;
diff --git a/tests/testables/tests/src/android/testing/TestableSettingsProviderTest.java b/tests/testables/tests/src/android/testing/TestableSettingsProviderTest.java
index ac61deb..0333d51 100644
--- a/tests/testables/tests/src/android/testing/TestableSettingsProviderTest.java
+++ b/tests/testables/tests/src/android/testing/TestableSettingsProviderTest.java
@@ -14,20 +14,22 @@
package android.testing;
+import static org.junit.Assert.*;
+
import android.content.ContentResolver;
import android.provider.Settings;
import android.provider.Settings.Global;
import android.provider.Settings.Secure;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.runner.AndroidJUnit4;
import android.test.suitebuilder.annotation.SmallTest;
+
+import androidx.test.InstrumentationRegistry;
+import androidx.test.runner.AndroidJUnit4;
+
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
-import static org.junit.Assert.*;
-
@SmallTest
@RunWith(AndroidJUnit4.class)
public class TestableSettingsProviderTest {
diff --git a/tools/apilint/apilint.py b/tools/apilint/apilint.py
index 295e3de..f967c2f 100644
--- a/tools/apilint/apilint.py
+++ b/tools/apilint/apilint.py
@@ -170,6 +170,7 @@
self.ctors = []
self.fields = []
self.methods = []
+ self.annotations = []
if sig_format == 2:
V2LineParser(raw).parse_into_class(self)
@@ -196,8 +197,10 @@
if "implements" in raw:
self.implements = raw[raw.index("implements")+1]
+ self.implements_all = [self.implements]
else:
self.implements = None
+ self.implements_all = []
else:
raise ValueError("Unknown signature format: " + sig_format)
@@ -224,7 +227,7 @@
class Package():
- NAME = re.compile("package(?: .*)? ([A-Za-z.]+)")
+ NAME = re.compile("package(?: .*)? ([A-Za-z0-9.]+)")
def __init__(self, line, raw, blame):
self.line = line
@@ -351,8 +354,8 @@
def parse_into_class(self, clazz):
clazz.split = []
- annotations = self.parse_annotations()
- if "@Deprecated" in annotations:
+ clazz.annotations = self.parse_annotations()
+ if "@Deprecated" in clazz.annotations:
clazz.split.append("deprecated")
clazz.split.extend(self.parse_modifiers())
kind = self.parse_one_of("class", "interface", "@interface", "enum")
@@ -364,12 +367,12 @@
self.parse_matching_paren("<", ">")
extends = self.parse_extends()
clazz.extends = extends[0] if extends else None
- implements = self.parse_implements()
- clazz.implements = implements[0] if implements else None
+ clazz.implements_all = self.parse_implements()
# The checks assume that interfaces are always found in implements, which isn't true for
# subinterfaces.
- if not implements and "interface" in clazz.split:
- clazz.implements = clazz.extends
+ if not clazz.implements_all and "interface" in clazz.split:
+ clazz.implements_all = [clazz.extends]
+ clazz.implements = clazz.implements_all[0] if clazz.implements_all else None
self.parse_token("{")
self.parse_eof()
@@ -761,6 +764,14 @@
noticed[clazz.fullname] = hash(clazz)
+verifiers = {}
+
+def verifier(f):
+ verifiers[f.__name__] = f
+ return f
+
+
+@verifier
def verify_constants(clazz):
"""All static final constants must be FOO_NAME style."""
if re.match("android\.R\.[a-z]+", clazz.fullname): return
@@ -778,13 +789,13 @@
if f.typ in req and f.value is None:
error(clazz, f, None, "All constants must be defined at compile time")
-
+@verifier
def verify_enums(clazz):
"""Enums are bad, mmkay?"""
if clazz.extends == "java.lang.Enum" or "enum" in clazz.split:
error(clazz, None, "F5", "Enums are not allowed")
-
+@verifier
def verify_class_names(clazz):
"""Try catching malformed class names like myMtp or MTPUser."""
if clazz.fullname.startswith("android.opengl"): return
@@ -799,6 +810,7 @@
error(clazz, None, None, "Don't expose your implementation details")
+@verifier
def verify_method_names(clazz):
"""Try catching malformed method names, like Foo() or getMTU()."""
if clazz.fullname.startswith("android.opengl"): return
@@ -812,9 +824,9 @@
error(clazz, m, "S1", "Method name must start with lowercase char")
+@verifier
def verify_callbacks(clazz):
"""Verify Callback classes.
- All callback classes must be abstract.
All methods must follow onFoo() naming style."""
if clazz.fullname == "android.speech.tts.SynthesisCallback": return
@@ -824,14 +836,12 @@
warn(clazz, None, "L1", "Class should be named FooCallback")
if clazz.name.endswith("Callback"):
- if "interface" in clazz.split:
- error(clazz, None, "CL3", "Callbacks must be abstract class to enable extension in future API levels")
-
for m in clazz.methods:
if not re.match("on[A-Z][a-z]*", m.name):
error(clazz, m, "L1", "Callback method names must be onFoo() style")
+@verifier
def verify_listeners(clazz):
"""Verify Listener classes.
All Listener classes must be interface.
@@ -853,6 +863,7 @@
error(clazz, m, "L1", "Single listener method name must match class name")
+@verifier
def verify_actions(clazz):
"""Verify intent actions.
All action names must be named ACTION_FOO.
@@ -884,6 +895,7 @@
error(clazz, f, "C4", "Inconsistent action value; expected '%s'" % (expected))
+@verifier
def verify_extras(clazz):
"""Verify intent extras.
All extra names must be named EXTRA_FOO.
@@ -914,6 +926,7 @@
error(clazz, f, "C4", "Inconsistent extra value; expected '%s'" % (expected))
+@verifier
def verify_equals(clazz):
"""Verify that equals() and hashCode() must be overridden together."""
eq = False
@@ -926,6 +939,7 @@
error(clazz, None, "M8", "Must override both equals and hashCode; missing one")
+@verifier
def verify_parcelable(clazz):
"""Verify that Parcelable objects aren't hiding required bits."""
if clazz.implements == "android.os.Parcelable":
@@ -944,6 +958,7 @@
error(clazz, c, "FW3", "Parcelable inflation is exposed through CREATOR, not raw constructors")
+@verifier
def verify_protected(clazz):
"""Verify that no protected methods or fields are allowed."""
for m in clazz.methods:
@@ -955,6 +970,7 @@
error(clazz, f, "M7", "Protected fields not allowed; must be public")
+@verifier
def verify_fields(clazz):
"""Verify that all exposed fields are final.
Exposed fields must follow myName style.
@@ -1000,6 +1016,7 @@
error(clazz, f, "C2", "Constants must be marked static final")
+@verifier
def verify_register(clazz):
"""Verify parity of registration methods.
Callback objects use register/unregister methods.
@@ -1033,6 +1050,7 @@
error(clazz, m, "L3", "Listener methods should be named add/remove")
+@verifier
def verify_sync(clazz):
"""Verify synchronized methods aren't exposed."""
for m in clazz.methods:
@@ -1040,6 +1058,7 @@
error(clazz, m, "M5", "Internal locks must not be exposed")
+@verifier
def verify_intent_builder(clazz):
"""Verify that Intent builders are createFooIntent() style."""
if clazz.name == "Intent": return
@@ -1052,6 +1071,7 @@
warn(clazz, m, "FW1", "Methods creating an Intent should be named createFooIntent()")
+@verifier
def verify_helper_classes(clazz):
"""Verify that helper classes are named consistently with what they extend.
All developer extendable methods should be named onFoo()."""
@@ -1100,6 +1120,7 @@
warn(clazz, m, None, "If implemented by developer, should be named onFoo(); otherwise consider marking final")
+@verifier
def verify_builder(clazz):
"""Verify builder classes.
Methods should return the builder to enable chaining."""
@@ -1132,12 +1153,14 @@
error(clazz, None, None, "Builder should be final")
+@verifier
def verify_aidl(clazz):
"""Catch people exposing raw AIDL."""
if clazz.extends == "android.os.Binder" or clazz.implements == "android.os.IInterface":
error(clazz, None, None, "Raw AIDL interfaces must not be exposed")
+@verifier
def verify_internal(clazz):
"""Catch people exposing internal classes."""
if clazz.pkg.name.startswith("com.android"):
@@ -1172,6 +1195,7 @@
"android.util"
])
+@verifier
def verify_layering(clazz):
"""Catch package layering violations.
For example, something in android.os depending on android.app."""
@@ -1206,6 +1230,7 @@
warn(clazz, m, "FW6", "Method argument type violates package layering")
+@verifier
def verify_boolean(clazz):
"""Verifies that boolean accessors are named correctly.
For example, hasFoo() and setHasFoo()."""
@@ -1246,9 +1271,11 @@
error_if_exists(sets, m.name, expected, "has" + target)
+@verifier
def verify_collections(clazz):
"""Verifies that collection types are interfaces."""
if clazz.fullname == "android.os.Bundle": return
+ if clazz.fullname == "android.os.Parcel": return
bad = ["java.util.Vector", "java.util.LinkedList", "java.util.ArrayList", "java.util.Stack",
"java.util.HashMap", "java.util.HashSet", "android.util.ArraySet", "android.util.ArrayMap"]
@@ -1260,6 +1287,23 @@
error(clazz, m, "CL2", "Argument is concrete collection; must be higher-level interface")
+@verifier
+def verify_uris(clazz):
+ bad = ["java.net.URL", "java.net.URI", "android.net.URL"]
+
+ for f in clazz.fields:
+ if f.typ in bad:
+ error(clazz, f, None, "Field must be android.net.Uri instead of " + f.typ)
+
+ for m in clazz.methods + clazz.ctors:
+ if m.typ in bad:
+ error(clazz, m, None, "Must return android.net.Uri instead of " + m.typ)
+ for arg in m.args:
+ if arg in bad:
+ error(clazz, m, None, "Argument must take android.net.Uri instead of " + arg)
+
+
+@verifier
def verify_flags(clazz):
"""Verifies that flags are non-overlapping."""
known = collections.defaultdict(int)
@@ -1276,6 +1320,7 @@
known[scope] |= val
+@verifier
def verify_exception(clazz):
"""Verifies that methods don't throw generic exceptions."""
for m in clazz.methods:
@@ -1284,17 +1329,19 @@
error(clazz, m, "S1", "Methods must not throw generic exceptions")
if t in ["android.os.RemoteException"]:
- if clazz.name == "android.content.ContentProviderClient": continue
- if clazz.name == "android.os.Binder": continue
- if clazz.name == "android.os.IBinder": continue
+ if clazz.fullname == "android.content.ContentProviderClient": continue
+ if clazz.fullname == "android.os.Binder": continue
+ if clazz.fullname == "android.os.IBinder": continue
error(clazz, m, "FW9", "Methods calling into system server should rethrow RemoteException as RuntimeException")
if len(m.args) == 0 and t in ["java.lang.IllegalArgumentException", "java.lang.NullPointerException"]:
warn(clazz, m, "S1", "Methods taking no arguments should throw IllegalStateException")
+
GOOGLE_IGNORECASE = re.compile("google", re.IGNORECASE)
+# Not marked as @verifier, because it is only conditionally applied.
def verify_google(clazz):
"""Verifies that APIs never reference Google."""
@@ -1307,6 +1354,7 @@
error(clazz, t, None, "Must never reference Google")
+@verifier
def verify_bitset(clazz):
"""Verifies that we avoid using heavy BitSet."""
@@ -1322,6 +1370,7 @@
error(clazz, m, None, "Argument type must not be heavy BitSet")
+@verifier
def verify_manager(clazz):
"""Verifies that FooManager is only obtained from Context."""
@@ -1335,6 +1384,7 @@
error(clazz, m, None, "Managers must always be obtained from Context")
+@verifier
def verify_boxed(clazz):
"""Verifies that methods avoid boxed primitives."""
@@ -1357,6 +1407,7 @@
error(clazz, m, "M11", "Must avoid boxed primitives")
+@verifier
def verify_static_utils(clazz):
"""Verifies that helper classes can't be constructed."""
if clazz.fullname.startswith("android.opengl"): return
@@ -1376,6 +1427,7 @@
error(clazz, None, None, "Fully-static utility classes must not have constructor")
+# @verifier # Disabled for now
def verify_overload_args(clazz):
"""Verifies that method overloads add new arguments at the end."""
if clazz.fullname.startswith("android.opengl"): return
@@ -1416,6 +1468,7 @@
error(clazz, m, "M2", "Expected consistent argument ordering between overloads: %s..." % (", ".join(locked_sig)))
+@verifier
def verify_callback_handlers(clazz):
"""Verifies that methods adding listener/callback have overload
for specifying delivery thread."""
@@ -1467,6 +1520,7 @@
warn(clazz, f, "L1", "Registration methods should have overload that accepts delivery Executor")
+@verifier
def verify_context_first(clazz):
"""Verifies that methods accepting a Context keep it the first argument."""
examine = clazz.ctors + clazz.methods
@@ -1479,6 +1533,7 @@
error(clazz, m, "M3", "ContentResolver is distinct, so it must be the first argument")
+@verifier
def verify_listener_last(clazz):
"""Verifies that methods accepting a Listener or Callback keep them as last arguments."""
examine = clazz.ctors + clazz.methods
@@ -1492,6 +1547,7 @@
warn(clazz, m, "M3", "Listeners should always be at end of argument list")
+@verifier
def verify_resource_names(clazz):
"""Verifies that resource names have consistent case."""
if not re.match("android\.R\.[a-z]+", clazz.fullname): return
@@ -1523,6 +1579,7 @@
error(clazz, f, "C7", "Expected resource name in this class to be FooBar_Baz style")
+@verifier
def verify_files(clazz):
"""Verifies that methods accepting File also accept streams."""
@@ -1544,6 +1601,7 @@
warn(clazz, m, "M10", "Methods accepting File should also accept FileDescriptor or streams")
+@verifier
def verify_manager_list(clazz):
"""Verifies that managers return List<? extends Parcelable> instead of arrays."""
@@ -1554,6 +1612,7 @@
warn(clazz, m, None, "Methods should return List<? extends Parcelable> instead of Parcelable[] to support ParceledListSlice under the hood")
+@verifier
def verify_abstract_inner(clazz):
"""Verifies that abstract inner classes are static."""
@@ -1562,6 +1621,7 @@
warn(clazz, None, None, "Abstract inner classes should be static to improve testability")
+@verifier
def verify_runtime_exceptions(clazz):
"""Verifies that runtime exceptions aren't listed in throws."""
@@ -1606,6 +1666,7 @@
error(clazz, m, None, "Methods must not mention RuntimeException subclasses in throws clauses")
+@verifier
def verify_error(clazz):
"""Verifies that we always use Exception instead of Error."""
if not clazz.extends: return
@@ -1615,6 +1676,7 @@
error(clazz, None, None, "Exceptions must be named FooException")
+@verifier
def verify_units(clazz):
"""Verifies that we use consistent naming for units."""
@@ -1651,10 +1713,11 @@
error(clazz, m, None, "Percentage must use ints")
+@verifier
def verify_closable(clazz):
"""Verifies that classes are AutoClosable."""
- if clazz.implements == "java.lang.AutoCloseable": return
- if clazz.implements == "java.io.Closeable": return
+ if "java.lang.AutoCloseable" in clazz.implements_all: return
+ if "java.io.Closeable" in clazz.implements_all: return
for m in clazz.methods:
if len(m.args) > 0: continue
@@ -1663,6 +1726,7 @@
return
+@verifier
def verify_member_name_not_kotlin_keyword(clazz):
"""Prevent method names which are keywords in Kotlin."""
@@ -1688,6 +1752,7 @@
error(clazz, f, None, "Field name must not be a Kotlin keyword")
+@verifier
def verify_method_name_not_kotlin_operator(clazz):
"""Warn about method names which become operators in Kotlin."""
@@ -1737,6 +1802,7 @@
unique_binary_op(m, m.name[:-6]) # Remove 'Assign' suffix
+@verifier
def verify_collections_over_arrays(clazz):
"""Warn that [] should be Collections."""
@@ -1752,6 +1818,7 @@
warn(clazz, m, None, "Method argument should be Collection<> (or subclass) instead of raw array")
+@verifier
def verify_user_handle(clazz):
"""Methods taking UserHandle should be ForUser or AsUser."""
if clazz.name.endswith("Listener") or clazz.name.endswith("Callback") or clazz.name.endswith("Callbacks"): return
@@ -1776,6 +1843,7 @@
"or 'queryFooForUser'")
+@verifier
def verify_params(clazz):
"""Parameter classes should be 'Params'."""
if clazz.name.endswith("Params"): return
@@ -1791,6 +1859,7 @@
error(clazz, None, None, "Classes holding a set of parameters should be called 'FooParams'")
+@verifier
def verify_services(clazz):
"""Service name should be FOO_BAR_SERVICE = 'foo_bar'."""
if clazz.fullname != "android.content.Context": return
@@ -1804,6 +1873,7 @@
error(clazz, f, "C4", "Inconsistent service value; expected '%s'" % (expected))
+@verifier
def verify_tense(clazz):
"""Verify tenses of method names."""
if clazz.fullname.startswith("android.opengl"): return
@@ -1813,6 +1883,7 @@
warn(clazz, m, None, "Unexpected tense; probably meant 'enabled'")
+@verifier
def verify_icu(clazz):
"""Verifies that richer ICU replacements are used."""
better = {
@@ -1844,6 +1915,7 @@
warn(clazz, m, None, "Type %s should be replaced with richer ICU type %s" % (arg, better[arg]))
+@verifier
def verify_clone(clazz):
"""Verify that clone() isn't implemented; see EJ page 61."""
for m in clazz.methods:
@@ -1851,8 +1923,12 @@
error(clazz, m, None, "Provide an explicit copy constructor instead of implementing clone()")
+@verifier
def verify_pfd(clazz):
"""Verify that android APIs use PFD over FD."""
+ if clazz.fullname == "android.os.FileUtils" or clazz.fullname == "android.system.Os":
+ return
+
examine = clazz.ctors + clazz.methods
for m in examine:
if m.typ == "java.io.FileDescriptor":
@@ -1869,6 +1945,7 @@
error(clazz, f, "FW11", "Must use ParcelFileDescriptor")
+@verifier
def verify_numbers(clazz):
"""Discourage small numbers types like short and byte."""
@@ -1890,8 +1967,10 @@
if arg in discouraged:
warn(clazz, m, "FW12", "Should avoid odd sized primitives; use int instead")
+
PRIMITIVES = {"void", "int", "float", "boolean", "short", "char", "byte", "long", "double"}
+@verifier
def verify_nullability(clazz):
"""Catches missing nullability annotations"""
@@ -1920,6 +1999,18 @@
def has_nullability(annotations):
return "@NonNull" in annotations or "@Nullable" in annotations
+
+@verifier
+def verify_intdef(clazz):
+ """intdefs must be @hide, because the constant names cannot be stored in
+ the stubs (only the values are, which is not useful)"""
+ if "@interface" not in clazz.split:
+ return
+ if "@IntDef" in clazz.annotations or "@LongDef" in clazz.annotations:
+ error(clazz, None, None, "@IntDef and @LongDef annotations must be @hide")
+
+
+@verifier
def verify_singleton(clazz):
"""Catch singleton objects with constructors."""
@@ -1954,60 +2045,10 @@
if not is_interesting(clazz): return
- verify_constants(clazz)
- verify_enums(clazz)
- verify_class_names(clazz)
- verify_method_names(clazz)
- verify_callbacks(clazz)
- verify_listeners(clazz)
- verify_actions(clazz)
- verify_extras(clazz)
- verify_equals(clazz)
- verify_parcelable(clazz)
- verify_protected(clazz)
- verify_fields(clazz)
- verify_register(clazz)
- verify_sync(clazz)
- verify_intent_builder(clazz)
- verify_helper_classes(clazz)
- verify_builder(clazz)
- verify_aidl(clazz)
- verify_internal(clazz)
- verify_layering(clazz)
- verify_boolean(clazz)
- verify_collections(clazz)
- verify_flags(clazz)
- verify_exception(clazz)
+ for v in verifiers.itervalues():
+ v(clazz)
+
if not ALLOW_GOOGLE: verify_google(clazz)
- verify_bitset(clazz)
- verify_manager(clazz)
- verify_boxed(clazz)
- verify_static_utils(clazz)
- # verify_overload_args(clazz)
- verify_callback_handlers(clazz)
- verify_context_first(clazz)
- verify_listener_last(clazz)
- verify_resource_names(clazz)
- verify_files(clazz)
- verify_manager_list(clazz)
- verify_abstract_inner(clazz)
- verify_runtime_exceptions(clazz)
- verify_error(clazz)
- verify_units(clazz)
- verify_closable(clazz)
- verify_member_name_not_kotlin_keyword(clazz)
- verify_method_name_not_kotlin_operator(clazz)
- verify_collections_over_arrays(clazz)
- verify_user_handle(clazz)
- verify_params(clazz)
- verify_services(clazz)
- verify_tense(clazz)
- verify_icu(clazz)
- verify_clone(clazz)
- verify_pfd(clazz)
- verify_numbers(clazz)
- verify_singleton(clazz)
- verify_nullability(clazz)
def examine_stream(stream, base_stream=None, in_classes_with_base=[], out_classes_with_base=None):
diff --git a/tools/apilint/apilint_test.py b/tools/apilint/apilint_test.py
index f34492d..5cb43db 100644
--- a/tools/apilint/apilint_test.py
+++ b/tools/apilint/apilint_test.py
@@ -242,6 +242,10 @@
cls = self._cls("class Class {")
return apilint.Field(cls, 1, raw, '', sig_format=2)
+ def test_parse_package(self):
+ pkg = apilint.Package(999, "package wifi.p2p {", None)
+ self.assertEquals("wifi.p2p", pkg.name)
+
def test_class(self):
cls = self._cls("@Deprecated @IntRange(from=1, to=2) public static abstract class Some.Name extends Super<Class> implements Interface<Class> {")
self.assertTrue('deprecated' in cls.split)
diff --git a/tools/hiddenapi/exclude.sh b/tools/hiddenapi/exclude.sh
index 4ffcf68..18c4054 100755
--- a/tools/hiddenapi/exclude.sh
+++ b/tools/hiddenapi/exclude.sh
@@ -9,6 +9,7 @@
LIBCORE_PACKAGES="\
android.icu \
android.system \
+ android.test \
com.android.bouncycastle \
com.android.conscrypt \
com.android.i18n.phonenumbers \
@@ -17,6 +18,7 @@
dalvik \
java \
javax \
+ junit \
libcore \
org.apache.harmony \
org.json \
diff --git a/tools/hiddenapi/generate_hiddenapi_lists.py b/tools/hiddenapi/generate_hiddenapi_lists.py
index 2a8f695..6781eba 100755
--- a/tools/hiddenapi/generate_hiddenapi_lists.py
+++ b/tools/hiddenapi/generate_hiddenapi_lists.py
@@ -29,6 +29,9 @@
FLAG_GREYLIST_MAX_O = "greylist-max-o"
FLAG_GREYLIST_MAX_P = "greylist-max-p"
FLAG_CORE_PLATFORM_API = "core-platform-api"
+FLAG_PUBLIC_API = "public-api"
+FLAG_SYSTEM_API = "system-api"
+FLAG_TEST_API = "test-api"
# List of all known flags.
FLAGS_API_LIST = [
@@ -38,7 +41,12 @@
FLAG_GREYLIST_MAX_O,
FLAG_GREYLIST_MAX_P,
]
-ALL_FLAGS = FLAGS_API_LIST + [ FLAG_CORE_PLATFORM_API ]
+ALL_FLAGS = FLAGS_API_LIST + [
+ FLAG_CORE_PLATFORM_API,
+ FLAG_PUBLIC_API,
+ FLAG_SYSTEM_API,
+ FLAG_TEST_API,
+ ]
FLAGS_API_LIST_SET = set(FLAGS_API_LIST)
ALL_FLAGS_SET = set(ALL_FLAGS)
@@ -203,14 +211,19 @@
# Iterate over all CSV lines, find entry in dict and append flags to it.
for csv in csv_values:
- self._dict[csv[0]].update(csv[1:])
+ flags = csv[1:]
+ if (FLAG_PUBLIC_API in flags) or (FLAG_SYSTEM_API in flags):
+ flags.append(FLAG_WHITELIST)
+ elif FLAG_TEST_API in flags:
+ flags.append(FLAG_GREYLIST)
+ self._dict[csv[0]].update(flags)
def assign_flag(self, flag, apis, source="<unknown>"):
"""Assigns a flag to given subset of entries.
Args:
flag (string): One of ALL_FLAGS.
- apis (set): Subset of APIs to recieve the flag.
+ apis (set): Subset of APIs to receive the flag.
source (string): Origin of `entries_subset`. Will be printed in error messages.
Throws:
diff --git a/wifi/java/android/net/wifi/IWifiManager.aidl b/wifi/java/android/net/wifi/IWifiManager.aidl
index af44b7e..6715bf7 100644
--- a/wifi/java/android/net/wifi/IWifiManager.aidl
+++ b/wifi/java/android/net/wifi/IWifiManager.aidl
@@ -141,8 +141,10 @@
void stopWatchLocalOnlyHotspot();
+ @UnsupportedAppUsage
int getWifiApEnabledState();
+ @UnsupportedAppUsage
WifiConfiguration getWifiApConfiguration();
boolean setWifiApConfiguration(in WifiConfiguration wifiConfig, String packageName);
@@ -167,6 +169,7 @@
void factoryReset(String packageName);
+ @UnsupportedAppUsage
Network getCurrentNetwork();
byte[] retrieveBackupData();