diff options
90 files changed, 903 insertions, 550 deletions
diff --git a/AconfigFlags.bp b/AconfigFlags.bp index 777228292eb5..21b1b174e55d 100644 --- a/AconfigFlags.bp +++ b/AconfigFlags.bp @@ -49,7 +49,6 @@ aconfig_declarations_group { "android.media.tv.flags-aconfig-java", "android.multiuser.flags-aconfig-java", "android.net.platform.flags-aconfig-java", - "android.net.vcn.flags-aconfig-java-export", "android.net.wifi.flags-aconfig-java", "android.nfc.flags-aconfig-java", "android.os.flags-aconfig-java", @@ -857,6 +856,11 @@ aconfig_declarations { java_aconfig_library { name: "android.app.flags-aconfig-java", aconfig_declarations: "android.app.flags-aconfig", + min_sdk_version: "34", + apex_available: [ + "//apex_available:platform", + "com.android.nfcservices", + ], defaults: ["framework-minus-apex-aconfig-java-defaults"], } @@ -1068,25 +1072,6 @@ java_aconfig_library { defaults: ["framework-minus-apex-aconfig-java-defaults"], } -// VCN -// TODO:376339506 Move the VCN code, the flag declaration and -// java_aconfig_library to framework-connectivity-b -aconfig_declarations { - name: "android.net.vcn.flags-aconfig", - package: "android.net.vcn", - container: "com.android.tethering", - exportable: true, - srcs: ["core/java/android/net/vcn/*.aconfig"], -} - -java_aconfig_library { - name: "android.net.vcn.flags-aconfig-java-export", - aconfig_declarations: "android.net.vcn.flags-aconfig", - mode: "exported", - min_sdk_version: "35", - defaults: ["framework-minus-apex-aconfig-java-defaults"], -} - // DevicePolicy aconfig_declarations { name: "device_policy_aconfig_flags", diff --git a/Android.bp b/Android.bp index 20e58ed377a8..68048c6bd445 100644 --- a/Android.bp +++ b/Android.bp @@ -87,6 +87,7 @@ filegroup { ":framework-wifi-non-updatable-sources", ":PacProcessor-aidl-sources", ":ProxyHandler-aidl-sources", + ":vcn-utils-platform-sources", ":net-utils-framework-common-srcs", // AIDL from frameworks/base/native/ @@ -314,6 +315,7 @@ java_defaults { ":framework-telephony-sources", ":framework-wifi-annotations", ":framework-wifi-non-updatable-sources", + ":vcn-utils-platform-sources", ":PacProcessor-aidl-sources", ":ProxyHandler-aidl-sources", ":net-utils-framework-common-srcs", @@ -582,7 +584,7 @@ filegroup { srcs: [ "core/java/com/android/internal/util/HexDump.java", "core/java/com/android/internal/util/WakeupMessage.java", - "core/java/android/net/vcn/util/PersistableBundleUtils.java", + "packages/Vcn/framework-b/src/android/net/vcn/util/PersistableBundleUtils.java", "telephony/java/android/telephony/Annotation.java", ], } diff --git a/core/api/current.txt b/core/api/current.txt index 7915509c1381..e3a2455ee37f 100644 --- a/core/api/current.txt +++ b/core/api/current.txt @@ -1491,6 +1491,7 @@ package android { field public static final int shadowRadius = 16843108; // 0x1010164 field public static final int shape = 16843162; // 0x101019a field public static final int shareInterpolator = 16843195; // 0x10101bb + field @FlaggedApi("android.nfc.nfc_associated_role_services") public static final int shareRolePriority; field @Deprecated public static final int sharedUserId = 16842763; // 0x101000b field @Deprecated public static final int sharedUserLabel = 16843361; // 0x1010261 field public static final int sharedUserMaxSdkVersion = 16844365; // 0x101064d @@ -29468,128 +29469,6 @@ package android.net.sip { } -package android.net.vcn { - - public final class VcnCellUnderlyingNetworkTemplate extends android.net.vcn.VcnUnderlyingNetworkTemplate { - method public int getCbs(); - method public int getDun(); - method public int getIms(); - method public int getInternet(); - method public int getMms(); - method @NonNull public java.util.Set<java.lang.String> getOperatorPlmnIds(); - method public int getOpportunistic(); - method public int getRcs(); - method public int getRoaming(); - method @NonNull public java.util.Set<java.lang.Integer> getSimSpecificCarrierIds(); - } - - public static final class VcnCellUnderlyingNetworkTemplate.Builder { - ctor public VcnCellUnderlyingNetworkTemplate.Builder(); - method @NonNull public android.net.vcn.VcnCellUnderlyingNetworkTemplate build(); - method @NonNull public android.net.vcn.VcnCellUnderlyingNetworkTemplate.Builder setCbs(int); - method @NonNull public android.net.vcn.VcnCellUnderlyingNetworkTemplate.Builder setDun(int); - method @NonNull public android.net.vcn.VcnCellUnderlyingNetworkTemplate.Builder setIms(int); - method @NonNull public android.net.vcn.VcnCellUnderlyingNetworkTemplate.Builder setInternet(int); - method @NonNull public android.net.vcn.VcnCellUnderlyingNetworkTemplate.Builder setMetered(int); - method @NonNull public android.net.vcn.VcnCellUnderlyingNetworkTemplate.Builder setMinDownstreamBandwidthKbps(int, int); - method @NonNull public android.net.vcn.VcnCellUnderlyingNetworkTemplate.Builder setMinUpstreamBandwidthKbps(int, int); - method @NonNull public android.net.vcn.VcnCellUnderlyingNetworkTemplate.Builder setMms(int); - method @NonNull public android.net.vcn.VcnCellUnderlyingNetworkTemplate.Builder setOperatorPlmnIds(@NonNull java.util.Set<java.lang.String>); - method @NonNull public android.net.vcn.VcnCellUnderlyingNetworkTemplate.Builder setOpportunistic(int); - method @NonNull public android.net.vcn.VcnCellUnderlyingNetworkTemplate.Builder setRcs(int); - method @NonNull public android.net.vcn.VcnCellUnderlyingNetworkTemplate.Builder setRoaming(int); - method @NonNull public android.net.vcn.VcnCellUnderlyingNetworkTemplate.Builder setSimSpecificCarrierIds(@NonNull java.util.Set<java.lang.Integer>); - } - - public final class VcnConfig implements android.os.Parcelable { - method public int describeContents(); - method @NonNull public java.util.Set<android.net.vcn.VcnGatewayConnectionConfig> getGatewayConnectionConfigs(); - method @NonNull public java.util.Set<java.lang.Integer> getRestrictedUnderlyingNetworkTransports(); - method public void writeToParcel(@NonNull android.os.Parcel, int); - field @NonNull public static final android.os.Parcelable.Creator<android.net.vcn.VcnConfig> CREATOR; - } - - public static final class VcnConfig.Builder { - ctor public VcnConfig.Builder(@NonNull android.content.Context); - method @NonNull public android.net.vcn.VcnConfig.Builder addGatewayConnectionConfig(@NonNull android.net.vcn.VcnGatewayConnectionConfig); - method @NonNull public android.net.vcn.VcnConfig build(); - method @NonNull public android.net.vcn.VcnConfig.Builder setRestrictedUnderlyingNetworkTransports(@NonNull java.util.Set<java.lang.Integer>); - } - - public final class VcnGatewayConnectionConfig { - method @NonNull public int[] getExposedCapabilities(); - method @NonNull public String getGatewayConnectionName(); - method @IntRange(from=0x500) public int getMaxMtu(); - method public int getMinUdpPort4500NatTimeoutSeconds(); - method @NonNull public long[] getRetryIntervalsMillis(); - method @NonNull public java.util.List<android.net.vcn.VcnUnderlyingNetworkTemplate> getVcnUnderlyingNetworkPriorities(); - method public boolean hasGatewayOption(int); - method @FlaggedApi("android.net.vcn.safe_mode_config") public boolean isSafeModeEnabled(); - field @FlaggedApi("android.net.vcn.mainline_vcn_module_api") public static final int MIN_UDP_PORT_4500_NAT_TIMEOUT_UNSET = -1; // 0xffffffff - field public static final int VCN_GATEWAY_OPTION_ENABLE_DATA_STALL_RECOVERY_WITH_MOBILITY = 0; // 0x0 - } - - public static final class VcnGatewayConnectionConfig.Builder { - ctor public VcnGatewayConnectionConfig.Builder(@NonNull String, @NonNull android.net.ipsec.ike.IkeTunnelConnectionParams); - method @NonNull public android.net.vcn.VcnGatewayConnectionConfig.Builder addExposedCapability(int); - method @NonNull public android.net.vcn.VcnGatewayConnectionConfig.Builder addGatewayOption(int); - method @NonNull public android.net.vcn.VcnGatewayConnectionConfig build(); - method @NonNull public android.net.vcn.VcnGatewayConnectionConfig.Builder removeExposedCapability(int); - method @NonNull public android.net.vcn.VcnGatewayConnectionConfig.Builder removeGatewayOption(int); - method @NonNull public android.net.vcn.VcnGatewayConnectionConfig.Builder setMaxMtu(@IntRange(from=0x500) int); - method @NonNull public android.net.vcn.VcnGatewayConnectionConfig.Builder setMinUdpPort4500NatTimeoutSeconds(@IntRange(from=0x78) int); - method @NonNull public android.net.vcn.VcnGatewayConnectionConfig.Builder setRetryIntervalsMillis(@NonNull long[]); - method @FlaggedApi("android.net.vcn.safe_mode_config") @NonNull public android.net.vcn.VcnGatewayConnectionConfig.Builder setSafeModeEnabled(boolean); - method @NonNull public android.net.vcn.VcnGatewayConnectionConfig.Builder setVcnUnderlyingNetworkPriorities(@NonNull java.util.List<android.net.vcn.VcnUnderlyingNetworkTemplate>); - } - - public class VcnManager { - method @RequiresPermission("carrier privileges") public void clearVcnConfig(@NonNull android.os.ParcelUuid) throws java.io.IOException; - method @NonNull public java.util.List<android.os.ParcelUuid> getConfiguredSubscriptionGroups(); - method public void registerVcnStatusCallback(@NonNull android.os.ParcelUuid, @NonNull java.util.concurrent.Executor, @NonNull android.net.vcn.VcnManager.VcnStatusCallback); - method @RequiresPermission("carrier privileges") public void setVcnConfig(@NonNull android.os.ParcelUuid, @NonNull android.net.vcn.VcnConfig) throws java.io.IOException; - method public void unregisterVcnStatusCallback(@NonNull android.net.vcn.VcnManager.VcnStatusCallback); - field public static final int VCN_ERROR_CODE_CONFIG_ERROR = 1; // 0x1 - field public static final int VCN_ERROR_CODE_INTERNAL_ERROR = 0; // 0x0 - field public static final int VCN_ERROR_CODE_NETWORK_ERROR = 2; // 0x2 - field public static final int VCN_STATUS_CODE_ACTIVE = 2; // 0x2 - field public static final int VCN_STATUS_CODE_INACTIVE = 1; // 0x1 - field public static final int VCN_STATUS_CODE_NOT_CONFIGURED = 0; // 0x0 - field public static final int VCN_STATUS_CODE_SAFE_MODE = 3; // 0x3 - } - - public abstract static class VcnManager.VcnStatusCallback { - ctor public VcnManager.VcnStatusCallback(); - method public abstract void onGatewayConnectionError(@NonNull String, int, @Nullable Throwable); - method public abstract void onStatusChanged(int); - } - - public abstract class VcnUnderlyingNetworkTemplate { - method public int getMetered(); - method public int getMinEntryDownstreamBandwidthKbps(); - method public int getMinEntryUpstreamBandwidthKbps(); - method public int getMinExitDownstreamBandwidthKbps(); - method public int getMinExitUpstreamBandwidthKbps(); - field public static final int MATCH_ANY = 0; // 0x0 - field public static final int MATCH_FORBIDDEN = 2; // 0x2 - field public static final int MATCH_REQUIRED = 1; // 0x1 - } - - public final class VcnWifiUnderlyingNetworkTemplate extends android.net.vcn.VcnUnderlyingNetworkTemplate { - method @NonNull public java.util.Set<java.lang.String> getSsids(); - } - - public static final class VcnWifiUnderlyingNetworkTemplate.Builder { - ctor public VcnWifiUnderlyingNetworkTemplate.Builder(); - method @NonNull public android.net.vcn.VcnWifiUnderlyingNetworkTemplate build(); - method @NonNull public android.net.vcn.VcnWifiUnderlyingNetworkTemplate.Builder setMetered(int); - method @NonNull public android.net.vcn.VcnWifiUnderlyingNetworkTemplate.Builder setMinDownstreamBandwidthKbps(int, int); - method @NonNull public android.net.vcn.VcnWifiUnderlyingNetworkTemplate.Builder setMinUpstreamBandwidthKbps(int, int); - method @NonNull public android.net.vcn.VcnWifiUnderlyingNetworkTemplate.Builder setSsids(@NonNull java.util.Set<java.lang.String>); - } - -} - package android.opengl { public class EGL14 { diff --git a/core/api/module-lib-current.txt b/core/api/module-lib-current.txt index d3775dbb036d..5790a732f134 100644 --- a/core/api/module-lib-current.txt +++ b/core/api/module-lib-current.txt @@ -273,10 +273,6 @@ package android.media.session { package android.net { - @FlaggedApi("android.net.vcn.mainline_vcn_module_api") public final class ConnectivityFrameworkInitializerBaklava { - method @FlaggedApi("android.net.vcn.mainline_vcn_module_api") public static void registerServiceWrappers(); - } - public class LocalSocket implements java.io.Closeable { ctor public LocalSocket(@NonNull java.io.FileDescriptor); } @@ -336,25 +332,6 @@ package android.net.netstats { } -package android.net.vcn { - - @FlaggedApi("android.net.vcn.mainline_vcn_module_api") public final class VcnTransportInfo implements android.os.Parcelable android.net.TransportInfo { - method @FlaggedApi("android.net.vcn.mainline_vcn_module_api") public int describeContents(); - method @FlaggedApi("android.net.vcn.mainline_vcn_module_api") public long getApplicableRedactions(); - method @FlaggedApi("android.net.vcn.mainline_vcn_module_api") public int getMinUdpPort4500NatTimeoutSeconds(); - method @FlaggedApi("android.net.vcn.mainline_vcn_module_api") @NonNull public android.net.TransportInfo makeCopy(long); - method @FlaggedApi("android.net.vcn.mainline_vcn_module_api") public void writeToParcel(@NonNull android.os.Parcel, int); - field @FlaggedApi("android.net.vcn.mainline_vcn_module_api") @NonNull public static final android.os.Parcelable.Creator<android.net.vcn.VcnTransportInfo> CREATOR; - } - - @FlaggedApi("android.net.vcn.mainline_vcn_module_api") public static final class VcnTransportInfo.Builder { - ctor @FlaggedApi("android.net.vcn.mainline_vcn_module_api") public VcnTransportInfo.Builder(); - method @FlaggedApi("android.net.vcn.mainline_vcn_module_api") @NonNull public android.net.vcn.VcnTransportInfo build(); - method @FlaggedApi("android.net.vcn.mainline_vcn_module_api") @NonNull public android.net.vcn.VcnTransportInfo.Builder setMinUdpPort4500NatTimeoutSeconds(@IntRange(from=0x78) int); - } - -} - package android.nfc { public class NfcServiceManager { diff --git a/core/api/system-current.txt b/core/api/system-current.txt index f94c97e2076c..903e18dcccdb 100644 --- a/core/api/system-current.txt +++ b/core/api/system-current.txt @@ -309,6 +309,7 @@ package android { field public static final String READ_RUNTIME_PROFILES = "android.permission.READ_RUNTIME_PROFILES"; field public static final String READ_SAFETY_CENTER_STATUS = "android.permission.READ_SAFETY_CENTER_STATUS"; field public static final String READ_SEARCH_INDEXABLES = "android.permission.READ_SEARCH_INDEXABLES"; + field @FlaggedApi("com.android.internal.telephony.flags.subscription_plan_allow_status_and_end_date") public static final String READ_SUBSCRIPTION_PLANS = "android.permission.READ_SUBSCRIPTION_PLANS"; field @FlaggedApi("android.app.system_terms_of_address_enabled") public static final String READ_SYSTEM_GRAMMATICAL_GENDER = "android.permission.READ_SYSTEM_GRAMMATICAL_GENDER"; field public static final String READ_SYSTEM_UPDATE_INFO = "android.permission.READ_SYSTEM_UPDATE_INFO"; field public static final String READ_WALLPAPER_INTERNAL = "android.permission.READ_WALLPAPER_INTERNAL"; @@ -9977,28 +9978,6 @@ package android.net.util { } -package android.net.vcn { - - public class VcnManager { - method @RequiresPermission(android.Manifest.permission.NETWORK_FACTORY) public void addVcnNetworkPolicyChangeListener(@NonNull java.util.concurrent.Executor, @NonNull android.net.vcn.VcnManager.VcnNetworkPolicyChangeListener); - method @NonNull @RequiresPermission(android.Manifest.permission.NETWORK_FACTORY) public android.net.vcn.VcnNetworkPolicyResult applyVcnNetworkPolicy(@NonNull android.net.NetworkCapabilities, @NonNull android.net.LinkProperties); - method @RequiresPermission(android.Manifest.permission.NETWORK_FACTORY) public void removeVcnNetworkPolicyChangeListener(@NonNull android.net.vcn.VcnManager.VcnNetworkPolicyChangeListener); - } - - public static interface VcnManager.VcnNetworkPolicyChangeListener { - method public void onPolicyChanged(); - } - - public final class VcnNetworkPolicyResult implements android.os.Parcelable { - method public int describeContents(); - method @NonNull public android.net.NetworkCapabilities getNetworkCapabilities(); - method public boolean isTeardownRequested(); - method public void writeToParcel(@NonNull android.os.Parcel, int); - field @NonNull public static final android.os.Parcelable.Creator<android.net.vcn.VcnNetworkPolicyResult> CREATOR; - } - -} - package android.net.wifi { public final class WifiKeystore { @@ -10484,6 +10463,7 @@ package android.nfc.cardemulation { method @FlaggedApi("android.nfc.enable_nfc_mainline") public void setDynamicAidGroup(@NonNull android.nfc.cardemulation.AidGroup); method @FlaggedApi("android.nfc.enable_nfc_mainline") public void setOffHostSecureElement(@NonNull String); method @FlaggedApi("android.nfc.nfc_observe_mode") public void setShouldDefaultToObserveMode(boolean); + method @FlaggedApi("android.nfc.nfc_associated_role_services") public boolean shareRolePriority(); method @FlaggedApi("android.nfc.nfc_observe_mode") public boolean shouldDefaultToObserveMode(); method @FlaggedApi("android.nfc.enable_nfc_mainline") public void writeToParcel(@NonNull android.os.Parcel, int); field @FlaggedApi("android.nfc.enable_nfc_mainline") @NonNull public static final android.os.Parcelable.Creator<android.nfc.cardemulation.ApduServiceInfo> CREATOR; diff --git a/core/java/android/net/EventLogTags.logtags b/core/java/android/net/EventLogTags.logtags index d5ed01496eba..32953c92d120 100644 --- a/core/java/android/net/EventLogTags.logtags +++ b/core/java/android/net/EventLogTags.logtags @@ -1,4 +1,4 @@ -# See system/core/logcat/event.logtags for a description of the format of this file. +# See system/logging/logcat/event.logtags for a description of the format of this file. option java_package android.net diff --git a/core/java/android/os/Parcel.java b/core/java/android/os/Parcel.java index f7285523c01a..a41cdd269e5e 100644 --- a/core/java/android/os/Parcel.java +++ b/core/java/android/os/Parcel.java @@ -892,6 +892,12 @@ public final class Parcel { /** * Report whether the parcel contains any marshalled file descriptors. + * + * WARNING: Parcelable definitions change over time. Unless you define + * a Parcelable yourself OR the Parcelable explicitly guarantees that + * it would never include such objects, you should not expect the return + * value to stay the same, and your code should continue to work even + * if the return value changes. */ public boolean hasFileDescriptors() { return nativeHasFileDescriptors(mNativePtr); @@ -901,6 +907,12 @@ public final class Parcel { * Report whether the parcel contains any marshalled file descriptors in the range defined by * {@code offset} and {@code length}. * + * WARNING: Parcelable definitions change over time. Unless you define + * a Parcelable yourself OR the Parcelable explicitly guarantees that + * it would never include such objects, you should not expect the return + * value to stay the same, and your code should continue to work even + * if the return value changes. + * * @param offset The offset from which the range starts. Should be between 0 and * {@link #dataSize()}. * @param length The length of the range. Should be between 0 and {@link #dataSize()} - {@code @@ -921,6 +933,12 @@ public final class Parcel { * <p>For most cases, it will use the self-reported {@link Parcelable#describeContents()} method * for that. * + * WARNING: Parcelable definitions change over time. Unless you define + * a Parcelable yourself OR the Parcelable explicitly guarantees that + * it would never include such objects, you should not expect the return + * value to stay the same, and your code should continue to work even + * if the return value changes. + * * @throws IllegalArgumentException if you provide any object not supported by above methods * (including if the unsupported object is inside a nested container). * @@ -990,6 +1008,13 @@ public final class Parcel { * * @throws UnsupportedOperationException if binder kernel driver was disabled or if method was * invoked in case of Binder RPC protocol. + * + * WARNING: Parcelable definitions change over time. Unless you define + * a Parcelable yourself OR the Parcelable explicitly guarantees that + * it would never include such objects, you should not expect the return + * value to stay the same, and your code should continue to work even + * if the return value changes. + * * @hide */ public boolean hasBinders() { @@ -1000,6 +1025,12 @@ public final class Parcel { * Report whether the parcel contains any marshalled {@link IBinder} objects in the range * defined by {@code offset} and {@code length}. * + * WARNING: Parcelable definitions change over time. Unless you define + * a Parcelable yourself OR the Parcelable explicitly guarantees that + * it would never include such objects, you should not expect the return + * value to stay the same, and your code should continue to work even + * if the return value changes. + * * @param offset The offset from which the range starts. Should be between 0 and * {@link #dataSize()}. * @param length The length of the range. Should be between 0 and {@link #dataSize()} - {@code diff --git a/core/java/android/speech/tts/EventLogTags.logtags b/core/java/android/speech/tts/EventLogTags.logtags index e209a286966a..5ba2baec6fcf 100644 --- a/core/java/android/speech/tts/EventLogTags.logtags +++ b/core/java/android/speech/tts/EventLogTags.logtags @@ -1,4 +1,4 @@ -# See system/core/logcat/event.logtags for a description of the format of this file. +# See system/logging/logcat/event.logtags for a description of the format of this file. option java_package android.speech.tts; diff --git a/core/java/android/webkit/EventLogTags.logtags b/core/java/android/webkit/EventLogTags.logtags index a90aebd71716..8bbd5a9d0246 100644 --- a/core/java/android/webkit/EventLogTags.logtags +++ b/core/java/android/webkit/EventLogTags.logtags @@ -1,4 +1,4 @@ -# See system/core/logcat/event.logtags for a description of the format of this file. +# See system/logging/logcat/event.logtags for a description of the format of this file. option java_package android.webkit; diff --git a/core/java/com/android/internal/jank/EventLogTags.logtags b/core/java/com/android/internal/jank/EventLogTags.logtags index 66ee131badac..dfec49907c69 100644 --- a/core/java/com/android/internal/jank/EventLogTags.logtags +++ b/core/java/com/android/internal/jank/EventLogTags.logtags @@ -1,4 +1,4 @@ -# See system/core/logcat/event.logtags for a description of the format of this file. +# See system/logging/logcat/event.logtags for a description of the format of this file. option java_package com.android.internal.jank; diff --git a/core/java/com/android/internal/util/ArrayUtils.java b/core/java/com/android/internal/util/ArrayUtils.java index 11123a9986f9..4d1c98daab8f 100644 --- a/core/java/com/android/internal/util/ArrayUtils.java +++ b/core/java/com/android/internal/util/ArrayUtils.java @@ -20,6 +20,7 @@ import android.annotation.NonNull; import android.annotation.Nullable; import android.compat.annotation.UnsupportedAppUsage; import android.os.Build; +import android.ravenwood.annotation.RavenwoodReplace; import android.util.ArraySet; import android.util.EmptyArray; @@ -39,6 +40,10 @@ import java.util.function.IntFunction; /** * Static utility methods for arrays that aren't already included in {@link java.util.Arrays}. + * <p> + * Test with: + * <code>atest FrameworksUtilTests:com.android.internal.util.ArrayUtilsTest</code> + * <code>atest FrameworksUtilTestsRavenwood:com.android.internal.util.ArrayUtilsTest</code> */ @android.ravenwood.annotation.RavenwoodKeepWholeClass public class ArrayUtils { @@ -85,6 +90,69 @@ public class ArrayUtils { } /** + * This is like <code>new byte[length]</code>, but it allocates the array as non-movable. This + * prevents copies of the data from being left on the Java heap as a result of heap compaction. + * Use this when the array will contain sensitive data such as a password or cryptographic key + * that needs to be wiped from memory when no longer needed. The owner of the array is still + * responsible for the zeroization; {@link #zeroize(byte[])} should be used to do so. + * + * @param length the length of the array to allocate + * @return the new array + */ + public static byte[] newNonMovableByteArray(int length) { + return (byte[]) VMRuntime.getRuntime().newNonMovableArray(byte.class, length); + } + + /** + * Like {@link #newNonMovableByteArray(int)}, but allocates a char array. + * + * @param length the length of the array to allocate + * @return the new array + */ + public static char[] newNonMovableCharArray(int length) { + return (char[]) VMRuntime.getRuntime().newNonMovableArray(char.class, length); + } + + /** + * Zeroizes a byte array as securely as possible. Use this when the array contains sensitive + * data such as a password or cryptographic key. + * <p> + * This zeroizes the array in a way that is guaranteed to not be optimized out by the compiler. + * If supported by the architecture, it zeroizes the data not just in the L1 data cache but also + * in other levels of the memory hierarchy up to and including main memory (but not above that). + * <p> + * This works on any <code>byte[]</code>, but to ensure that copies of the array aren't left on + * the Java heap the array should have been allocated with {@link #newNonMovableByteArray(int)}. + * Use on other arrays might also introduce performance anomalies. + * + * @param array the array to zeroize. If null, this method has no effect. + */ + @RavenwoodReplace public static native void zeroize(byte[] array); + + /** + * Replacement of the above method for host-side unit testing that doesn't support JNI yet. + */ + public static void zeroize$ravenwood(byte[] array) { + if (array != null) { + Arrays.fill(array, (byte) 0); + } + } + + /** + * Like {@link #zeroize(byte[])}, but for char arrays. + */ + @RavenwoodReplace public static native void zeroize(char[] array); + + /** + * Replacement of the above method for host-side unit testing that doesn't support JNI yet. + */ + public static void zeroize$ravenwood(char[] array) { + if (array != null) { + Arrays.fill(array, (char) 0); + } + } + + /** * Checks if the beginnings of two byte arrays are equal. * * @param array1 the first byte array diff --git a/core/jni/Android.bp b/core/jni/Android.bp index 0196ef5ef852..e71f607c5cce 100644 --- a/core/jni/Android.bp +++ b/core/jni/Android.bp @@ -90,6 +90,7 @@ cc_library_shared_for_libandroid_runtime { "android_view_VelocityTracker.cpp", "android_view_VerifiedKeyEvent.cpp", "android_view_VerifiedMotionEvent.cpp", + "com_android_internal_util_ArrayUtils.cpp", "com_android_internal_util_VirtualRefBasePtr.cpp", "core_jni_helpers.cpp", ":deviceproductinfoconstants_aidl", diff --git a/core/jni/AndroidRuntime.cpp b/core/jni/AndroidRuntime.cpp index c5df248ec1a9..c005d63ff797 100644 --- a/core/jni/AndroidRuntime.cpp +++ b/core/jni/AndroidRuntime.cpp @@ -215,6 +215,7 @@ extern int register_com_android_internal_os_Zygote(JNIEnv *env); extern int register_com_android_internal_os_ZygoteCommandBuffer(JNIEnv *env); extern int register_com_android_internal_os_ZygoteInit(JNIEnv *env); extern int register_com_android_internal_security_VerityUtils(JNIEnv* env); +extern int register_com_android_internal_util_ArrayUtils(JNIEnv* env); extern int register_com_android_internal_util_VirtualRefBasePtr(JNIEnv *env); extern int register_android_window_WindowInfosListener(JNIEnv* env); extern int register_android_window_ScreenCapture(JNIEnv* env); @@ -1613,6 +1614,7 @@ static const RegJNIRec gRegJNI[] = { REG_JNI(register_com_android_internal_os_ZygoteCommandBuffer), REG_JNI(register_com_android_internal_os_ZygoteInit), REG_JNI(register_com_android_internal_security_VerityUtils), + REG_JNI(register_com_android_internal_util_ArrayUtils), REG_JNI(register_com_android_internal_util_VirtualRefBasePtr), REG_JNI(register_android_hardware_Camera), REG_JNI(register_android_hardware_camera2_CameraMetadata), diff --git a/core/jni/com_android_internal_util_ArrayUtils.cpp b/core/jni/com_android_internal_util_ArrayUtils.cpp new file mode 100644 index 000000000000..c70625815b90 --- /dev/null +++ b/core/jni/com_android_internal_util_ArrayUtils.cpp @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 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_TAG "ArrayUtils" + +#include <android-base/logging.h> +#include <jni.h> +#include <nativehelper/JNIHelp.h> +#include <string.h> +#include <unistd.h> +#include <utils/Log.h> + +namespace android { + +static size_t GetCacheLineSize() { + long size = sysconf(_SC_LEVEL1_DCACHE_LINESIZE); + if (size <= 0) { + ALOGE("Unable to determine L1 data cache line size. Assuming 32 bytes"); + return 32; + } + // The cache line size should always be a power of 2. + CHECK((size & (size - 1)) == 0); + + return size; +} + +static void CleanCacheLineContainingAddress(const uint8_t* p) { +#if defined(__aarch64__) + // 'dc cvac' stands for "Data Cache line Clean by Virtual Address to point-of-Coherency". + // It writes the cache line back to the "point-of-coherency", i.e. main memory. + asm volatile("dc cvac, %0" ::"r"(p)); +#elif defined(__i386__) || defined(__x86_64__) + asm volatile("clflush (%0)" ::"r"(p)); +#elif defined(__riscv) + // This should eventually work, but it is not ready to be enabled yet: + // 1.) The Android emulator needs to add support for zicbom. + // 2.) Kernel needs to enable zicbom in usermode. + // 3.) Android clang needs to add zicbom to the target. + // asm volatile("cbo.clean (%0)" ::"r"(p)); +#elif defined(__arm__) + // arm32 has a cacheflush() syscall, but it is undocumented and only flushes the icache. + // It is not the same as cacheflush(2) as documented in the Linux man-pages project. +#else +#error "Unknown architecture" +#endif +} + +static void CleanDataCache(const uint8_t* p, size_t buffer_size, size_t cache_line_size) { + // Clean the first line that overlaps the buffer. + CleanCacheLineContainingAddress(p); + // Clean any additional lines that overlap the buffer. Use cache-line-aligned addresses to + // ensure that (a) the last cache line gets flushed, and (b) no cache line is flushed twice. + for (size_t i = cache_line_size - ((uintptr_t)p & (cache_line_size - 1)); i < buffer_size; + i += cache_line_size) { + CleanCacheLineContainingAddress(p + i); + } +} + +static void ZeroizePrimitiveArray(JNIEnv* env, jclass clazz, jarray array, size_t component_len) { + static const size_t cache_line_size = GetCacheLineSize(); + + if (array == nullptr) { + return; + } + + size_t buffer_size = env->GetArrayLength(array) * component_len; + if (buffer_size == 0) { + return; + } + + // ART guarantees that GetPrimitiveArrayCritical never copies. + jboolean isCopy; + void* elems = env->GetPrimitiveArrayCritical(array, &isCopy); + CHECK(!isCopy); + +#ifdef __BIONIC__ + memset_explicit(elems, 0, buffer_size); +#else + memset(elems, 0, buffer_size); +#endif + // Clean the data cache so that the data gets zeroized in main memory right away. Without this, + // it might not be written to main memory until the cache line happens to be evicted. + CleanDataCache(static_cast<const uint8_t*>(elems), buffer_size, cache_line_size); + + env->ReleasePrimitiveArrayCritical(array, elems, /* mode= */ 0); +} + +static void ZeroizeByteArray(JNIEnv* env, jclass clazz, jbyteArray array) { + ZeroizePrimitiveArray(env, clazz, array, sizeof(jbyte)); +} + +static void ZeroizeCharArray(JNIEnv* env, jclass clazz, jcharArray array) { + ZeroizePrimitiveArray(env, clazz, array, sizeof(jchar)); +} + +static const JNINativeMethod sMethods[] = { + {"zeroize", "([B)V", (void*)ZeroizeByteArray}, + {"zeroize", "([C)V", (void*)ZeroizeCharArray}, +}; + +int register_com_android_internal_util_ArrayUtils(JNIEnv* env) { + return jniRegisterNativeMethods(env, "com/android/internal/util/ArrayUtils", sMethods, + NELEM(sMethods)); +} + +} // namespace android diff --git a/core/res/Android.bp b/core/res/Android.bp index 4254a47877da..b54fd986b718 100644 --- a/core/res/Android.bp +++ b/core/res/Android.bp @@ -164,6 +164,7 @@ android_app { "com.android.window.flags.window-aconfig", "android.permission.flags-aconfig", "ranging_aconfig_flags", + "telephony_flags", ], } diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml index d74065589361..0d460fea7efd 100644 --- a/core/res/AndroidManifest.xml +++ b/core/res/AndroidManifest.xml @@ -6814,6 +6814,13 @@ <permission android:name="android.permission.MANAGE_SUBSCRIPTION_PLANS" android:protectionLevel="signature|privileged" /> + <!-- @SystemApi @hide Allows for reading subscription plan fields for status and end date. + @FlaggedApi(com.android.internal.telephony.flags.Flags.FLAG_SUBSCRIPTION_PLAN_ALLOW_STATUS_AND_END_DATE) + --> + <permission android:name="android.permission.READ_SUBSCRIPTION_PLANS" + android:protectionLevel="signature|privileged" + android:featureFlag="com.android.internal.telephony.flags.subscription_plan_allow_status_and_end_date" /> + <!-- C2DM permission. @hide Used internally. --> diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml index 9846b710300f..4952400441c0 100644 --- a/core/res/res/values/attrs.xml +++ b/core/res/res/values/attrs.xml @@ -4460,6 +4460,12 @@ <!-- Whether the device should default to observe mode when this service is default or in the foreground. --> <attr name="shouldDefaultToObserveMode" format="boolean"/> + <!-- Whether this service should share the same AID routing priority as the role + owner. This package and the role owner must have the same signature, and the + role owner must opt into this behavior by using the property named by + {@link android.nfc.cardemulation.CardEmulation.PROPERTY_ALLOW_SHARED_ROLE_PRIORITY } + in the <code><application&rt;</code> tag. --> + <attr name="shareRolePriority" format="boolean"/> </declare-styleable> <!-- Use <code>offhost-apdu-service</code> as the root tag of the XML resource that @@ -4487,6 +4493,7 @@ <!-- Whether the device should default to observe mode when this service is default or in the foreground. --> <attr name="shouldDefaultToObserveMode"/> + <attr name="shareRolePriority"/> </declare-styleable> <!-- Specify one or more <code>aid-group</code> elements inside a diff --git a/core/res/res/values/public-staging.xml b/core/res/res/values/public-staging.xml index b64334f7f95a..d0846326094c 100644 --- a/core/res/res/values/public-staging.xml +++ b/core/res/res/values/public-staging.xml @@ -118,6 +118,8 @@ <public name="languageSettingsActivity"/> <!-- @FlaggedApi("android.service.controls.flags.Flags.FLAG_HOME_PANEL_DREAM") --> <public name="dreamCategory"/> + <!-- @FlaggedApi(android.nfc.Flags.FLAG_NFC_ASSOCIATED_ROLE_SERVICES) --> + <public name="shareRolePriority"/> </staging-public-group> <staging-public-group type="id" first-id="0x01b60000"> diff --git a/core/tests/utiltests/src/com/android/internal/util/ArrayUtilsTest.java b/core/tests/utiltests/src/com/android/internal/util/ArrayUtilsTest.java index fc233fba082e..b28c9f7cc74f 100644 --- a/core/tests/utiltests/src/com/android/internal/util/ArrayUtilsTest.java +++ b/core/tests/utiltests/src/com/android/internal/util/ArrayUtilsTest.java @@ -496,4 +496,58 @@ public class ArrayUtilsTest { // expected } } + + // Note: the zeroize() tests only test the behavior that can be tested from a Java test. + // They do not verify that no copy of the data is left anywhere. + + @Test + @SmallTest + public void testZeroizeNonMovableByteArray() { + final int length = 10; + byte[] array = ArrayUtils.newNonMovableByteArray(length); + assertArrayEquals(array, new byte[length]); + Arrays.fill(array, (byte) 0xff); + ArrayUtils.zeroize(array); + assertArrayEquals(array, new byte[length]); + } + + @Test + @SmallTest + public void testZeroizeRegularByteArray() { + final int length = 10; + byte[] array = new byte[length]; + assertArrayEquals(array, new byte[length]); + Arrays.fill(array, (byte) 0xff); + ArrayUtils.zeroize(array); + assertArrayEquals(array, new byte[length]); + } + + @Test + @SmallTest + public void testZeroizeNonMovableCharArray() { + final int length = 10; + char[] array = ArrayUtils.newNonMovableCharArray(length); + assertArrayEquals(array, new char[length]); + Arrays.fill(array, (char) 0xff); + ArrayUtils.zeroize(array); + assertArrayEquals(array, new char[length]); + } + + @Test + @SmallTest + public void testZeroizeRegularCharArray() { + final int length = 10; + char[] array = new char[length]; + assertArrayEquals(array, new char[length]); + Arrays.fill(array, (char) 0xff); + ArrayUtils.zeroize(array); + assertArrayEquals(array, new char[length]); + } + + @Test + @SmallTest + public void testZeroize_acceptsNull() { + ArrayUtils.zeroize((byte[]) null); + ArrayUtils.zeroize((char[]) null); + } } diff --git a/nfc/api/current.txt b/nfc/api/current.txt index 2aa73db06204..0ee81cbb7a73 100644 --- a/nfc/api/current.txt +++ b/nfc/api/current.txt @@ -233,6 +233,7 @@ package android.nfc.cardemulation { field @FlaggedApi("android.nfc.nfc_event_listener") public static final int NFC_INTERNAL_ERROR_NFC_CRASH_RESTART = 1; // 0x1 field @FlaggedApi("android.nfc.nfc_event_listener") public static final int NFC_INTERNAL_ERROR_NFC_HARDWARE_ERROR = 2; // 0x2 field @FlaggedApi("android.nfc.nfc_event_listener") public static final int NFC_INTERNAL_ERROR_UNKNOWN = 0; // 0x0 + field @FlaggedApi("android.nfc.nfc_associated_role_services") public static final String PROPERTY_ALLOW_SHARED_ROLE_PRIORITY = "android.nfc.cardemulation.PROPERTY_ALLOW_SHARED_ROLE_PRIORITY"; field @FlaggedApi("android.nfc.nfc_override_recover_routing_table") public static final int PROTOCOL_AND_TECHNOLOGY_ROUTE_DEFAULT = 3; // 0x3 field @FlaggedApi("android.nfc.nfc_override_recover_routing_table") public static final int PROTOCOL_AND_TECHNOLOGY_ROUTE_DH = 0; // 0x0 field @FlaggedApi("android.nfc.nfc_override_recover_routing_table") public static final int PROTOCOL_AND_TECHNOLOGY_ROUTE_ESE = 1; // 0x1 diff --git a/nfc/api/system-current.txt b/nfc/api/system-current.txt index dd1c340cf174..cf11ac028858 100644 --- a/nfc/api/system-current.txt +++ b/nfc/api/system-current.txt @@ -254,6 +254,7 @@ package android.nfc.cardemulation { field @FlaggedApi("android.nfc.enable_card_emulation_euicc") public static final int SET_SUBSCRIPTION_ID_STATUS_FAILED_INVALID_SUBSCRIPTION_ID = 1; // 0x1 field @FlaggedApi("android.nfc.enable_card_emulation_euicc") public static final int SET_SUBSCRIPTION_ID_STATUS_FAILED_NOT_SUPPORTED = 3; // 0x3 field @FlaggedApi("android.nfc.enable_card_emulation_euicc") public static final int SET_SUBSCRIPTION_ID_STATUS_SUCCESS = 0; // 0x0 + field @FlaggedApi("android.nfc.enable_card_emulation_euicc") public static final int SET_SUBSCRIPTION_ID_STATUS_UNKNOWN = -1; // 0xffffffff } } diff --git a/nfc/java/android/nfc/cardemulation/ApduServiceInfo.java b/nfc/java/android/nfc/cardemulation/ApduServiceInfo.java index 3d293f7546a5..eac783628ed9 100644 --- a/nfc/java/android/nfc/cardemulation/ApduServiceInfo.java +++ b/nfc/java/android/nfc/cardemulation/ApduServiceInfo.java @@ -148,6 +148,12 @@ public final class ApduServiceInfo implements Parcelable { private boolean mShouldDefaultToObserveMode; /** + * Whether or not this service wants to share the same routing priority as the + * Wallet role owner. + */ + private boolean mShareRolePriority; + + /** * @hide */ @UnsupportedAppUsage @@ -284,6 +290,12 @@ public final class ApduServiceInfo implements Parcelable { mShouldDefaultToObserveMode = sa.getBoolean( R.styleable.HostApduService_shouldDefaultToObserveMode, false); + if (Flags.nfcAssociatedRoleServices()) { + mShareRolePriority = sa.getBoolean( + R.styleable.HostApduService_shareRolePriority, + false + ); + } sa.recycle(); } else { TypedArray sa = res.obtainAttributes(attrs, @@ -314,6 +326,12 @@ public final class ApduServiceInfo implements Parcelable { } } mStaticOffHostName = mOffHostName; + if (Flags.nfcAssociatedRoleServices()) { + mShareRolePriority = sa.getBoolean( + R.styleable.OffHostApduService_shareRolePriority, + false + ); + } sa.recycle(); } @@ -705,6 +723,17 @@ public final class ApduServiceInfo implements Parcelable { } /** + * Returns whether or not this service wants to share the Wallet role holder priority + * with other packages/services with the same signature. + * + * @return whether or not this service wants to share priority + */ + @FlaggedApi(Flags.FLAG_NFC_ASSOCIATED_ROLE_SERVICES) + public boolean shareRolePriority() { + return mShareRolePriority; + } + + /** * Returns description of service. * @return user readable description of service */ diff --git a/nfc/java/android/nfc/cardemulation/CardEmulation.java b/nfc/java/android/nfc/cardemulation/CardEmulation.java index cb364fb3298e..e0bc15fe6e94 100644 --- a/nfc/java/android/nfc/cardemulation/CardEmulation.java +++ b/nfc/java/android/nfc/cardemulation/CardEmulation.java @@ -246,6 +246,25 @@ public final class CardEmulation { @Retention(RetentionPolicy.SOURCE) public @interface SetServiceEnabledStatusCode {} + /** + * Property name used to indicate that an application wants to allow associated services + * to share the same AID routing priority when this application is the role holder. + * <p> + * Example: + * <pre> + * {@code + * <application> + * ... + * <property android:name="android.nfc.cardemulation.PROPERTY_ALLOW_SHARED_ROLE_PRIORITY" + * android:value="true"/> + * </application> + * } + * </pre> + */ + @FlaggedApi(Flags.FLAG_NFC_ASSOCIATED_ROLE_SERVICES) + public static final String PROPERTY_ALLOW_SHARED_ROLE_PRIORITY = + "android.nfc.cardemulation.PROPERTY_ALLOW_SHARED_ROLE_PRIORITY"; + static boolean sIsInitialized = false; static HashMap<Context, CardEmulation> sCardEmus = new HashMap<Context, CardEmulation>(); static INfcCardEmulation sService; @@ -1095,6 +1114,14 @@ public final class CardEmulation { @FlaggedApi(android.nfc.Flags.FLAG_ENABLE_CARD_EMULATION_EUICC) public static final int SET_SUBSCRIPTION_ID_STATUS_FAILED_NOT_SUPPORTED = 3; + /** + * Setting the default subscription ID failed because of unknown error. + * @hide + */ + @SystemApi + @FlaggedApi(Flags.FLAG_ENABLE_CARD_EMULATION_EUICC) + public static final int SET_SUBSCRIPTION_ID_STATUS_UNKNOWN = -1; + /** @hide */ @IntDef(prefix = "SET_SUBSCRIPTION_ID_STATUS_", value = { @@ -1102,6 +1129,7 @@ public final class CardEmulation { SET_SUBSCRIPTION_ID_STATUS_FAILED_INVALID_SUBSCRIPTION_ID, SET_SUBSCRIPTION_ID_STATUS_FAILED_INTERNAL_ERROR, SET_SUBSCRIPTION_ID_STATUS_FAILED_NOT_SUPPORTED, + SET_SUBSCRIPTION_ID_STATUS_UNKNOWN }) @Retention(RetentionPolicy.SOURCE) public @interface SetSubscriptionIdStatus {} @@ -1110,9 +1138,10 @@ public final class CardEmulation { * Sets the system's default NFC subscription id. * * <p> For devices with multiple UICC/EUICC that is configured to be NFCEE, this sets the - * default UICC NFCEE that will handle NFC offhost CE transactoions </p> + * default UICC NFCEE that will handle NFC offhost CE transactions </p> * - * @param subscriptionId the default NFC subscription Id to set. + * @param subscriptionId the default NFC subscription Id to set. User can get subscription id + * from {@link SubscriptionManager#getSubscriptionId(int)} * @return status of the operation. * * @throws UnsupportedOperationException If the device does not have @@ -1134,7 +1163,7 @@ public final class CardEmulation { * Returns the system's default NFC subscription id. * * <p> For devices with multiple UICC/EUICC that is configured to be NFCEE, this returns the - * default UICC NFCEE that will handle NFC offhost CE transactoions </p> + * default UICC NFCEE that will handle NFC offhost CE transactions </p> * <p> If the device has no UICC that can serve as NFCEE, this will return * {@link SubscriptionManager#INVALID_SUBSCRIPTION_ID}.</p> * diff --git a/nfc/lint-baseline.xml b/nfc/lint-baseline.xml index d0f797e5c6b8..c6c627e4ea8d 100644 --- a/nfc/lint-baseline.xml +++ b/nfc/lint-baseline.xml @@ -2,215 +2,6 @@ <issues format="6" by="lint 8.4.0-alpha01" type="baseline" client="" dependencies="true" name="" variant="all" version="8.4.0-alpha01"> <issue - id="NewApi" - message="Call requires API level 35 (current min is 34): `new android.nfc.cardemulation.AidGroup`" - errorLine1=" AidGroup aidGroup = new AidGroup(aids, category);" - errorLine2=" ~~~~~~~~~~~~"> - <location - file="frameworks/base/nfc/java/android/nfc/cardemulation/CardEmulation.java" - line="377" - column="29"/> - </issue> - - <issue - id="NewApi" - message="Call requires API level 35 (current min is 34): `android.nfc.cardemulation.AidGroup#getAids`" - errorLine1=" return (group != null ? group.getAids() : null);" - errorLine2=" ~~~~~~~"> - <location - file="frameworks/base/nfc/java/android/nfc/cardemulation/CardEmulation.java" - line="537" - column="43"/> - </issue> - - <issue - id="NewApi" - message="Call requires API level 35 (current min is 34): `android.nfc.cardemulation.AidGroup#getAids`" - errorLine1=" return (group != null ? group.getAids() : null);" - errorLine2=" ~~~~~~~"> - <location - file="frameworks/base/nfc/java/android/nfc/cardemulation/CardEmulation.java" - line="547" - column="47"/> - </issue> - - <issue - id="NewApi" - message="Call requires API level 35 (current min is 34): `android.nfc.cardemulation.ApduServiceInfo#getAids`" - errorLine1=" return (serviceInfo != null ? serviceInfo.getAids() : null);" - errorLine2=" ~~~~~~~"> - <location - file="frameworks/base/nfc/java/android/nfc/cardemulation/CardEmulation.java" - line="714" - column="55"/> - </issue> - - <issue - id="NewApi" - message="Call requires API level 35 (current min is 34): `android.nfc.cardemulation.ApduServiceInfo#getAids`" - errorLine1=" return (serviceInfo != null ? serviceInfo.getAids() : null);" - errorLine2=" ~~~~~~~"> - <location - file="frameworks/base/nfc/java/android/nfc/cardemulation/CardEmulation.java" - line="724" - column="59"/> - </issue> - - <issue - id="NewApi" - message="Call requires API level 35 (current min is 34): `android.nfc.cardemulation.ApduServiceInfo#isOnHost`" - errorLine1=" if (!serviceInfo.isOnHost()) {" - errorLine2=" ~~~~~~~~"> - <location - file="frameworks/base/nfc/java/android/nfc/cardemulation/CardEmulation.java" - line="755" - column="34"/> - </issue> - - <issue - id="NewApi" - message="Call requires API level 35 (current min is 34): `android.nfc.cardemulation.ApduServiceInfo#getOffHostSecureElement`" - errorLine1=" return serviceInfo.getOffHostSecureElement() == null ?" - errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~"> - <location - file="frameworks/base/nfc/java/android/nfc/cardemulation/CardEmulation.java" - line="756" - column="40"/> - </issue> - - <issue - id="NewApi" - message="Call requires API level 35 (current min is 34): `android.nfc.cardemulation.ApduServiceInfo#getOffHostSecureElement`" - errorLine1=' "OffHost" : serviceInfo.getOffHostSecureElement();' - errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~"> - <location - file="frameworks/base/nfc/java/android/nfc/cardemulation/CardEmulation.java" - line="757" - column="53"/> - </issue> - - <issue - id="NewApi" - message="Call requires API level 35 (current min is 34): `android.nfc.cardemulation.ApduServiceInfo#isOnHost`" - errorLine1=" if (!serviceInfo.isOnHost()) {" - errorLine2=" ~~~~~~~~"> - <location - file="frameworks/base/nfc/java/android/nfc/cardemulation/CardEmulation.java" - line="772" - column="38"/> - </issue> - - <issue - id="NewApi" - message="Call requires API level 35 (current min is 34): `android.nfc.cardemulation.ApduServiceInfo#getOffHostSecureElement`" - errorLine1=" return serviceInfo.getOffHostSecureElement() == null ?" - errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~"> - <location - file="frameworks/base/nfc/java/android/nfc/cardemulation/CardEmulation.java" - line="773" - column="44"/> - </issue> - - <issue - id="NewApi" - message="Call requires API level 35 (current min is 34): `android.nfc.cardemulation.ApduServiceInfo#getOffHostSecureElement`" - errorLine1=' "Offhost" : serviceInfo.getOffHostSecureElement();' - errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~"> - <location - file="frameworks/base/nfc/java/android/nfc/cardemulation/CardEmulation.java" - line="774" - column="57"/> - </issue> - - <issue - id="NewApi" - message="Call requires API level 35 (current min is 34): `android.nfc.cardemulation.ApduServiceInfo#getDescription`" - errorLine1=" return (serviceInfo != null ? serviceInfo.getDescription() : null);" - errorLine2=" ~~~~~~~~~~~~~~"> - <location - file="frameworks/base/nfc/java/android/nfc/cardemulation/CardEmulation.java" - line="798" - column="55"/> - </issue> - - <issue - id="NewApi" - message="Call requires API level 35 (current min is 34): `android.nfc.cardemulation.ApduServiceInfo#getDescription`" - errorLine1=" return (serviceInfo != null ? serviceInfo.getDescription() : null);" - errorLine2=" ~~~~~~~~~~~~~~"> - <location - file="frameworks/base/nfc/java/android/nfc/cardemulation/CardEmulation.java" - line="808" - column="59"/> - </issue> - - <issue - id="NewApi" - message="Call requires API level 35 (current min is 34): `android.app.Activity#isResumed`" - errorLine1=" if (!activity.isResumed()) {" - errorLine2=" ~~~~~~~~~"> - <location - file="frameworks/base/nfc/java/android/nfc/cardemulation/CardEmulation.java" - line="1032" - column="23"/> - </issue> - - <issue - id="NewApi" - message="Call requires API level 35 (current min is 34): `android.app.Activity#isResumed`" - errorLine1=" if (!activity.isResumed()) {" - errorLine2=" ~~~~~~~~~"> - <location - file="frameworks/base/nfc/java/android/nfc/cardemulation/CardEmulation.java" - line="1066" - column="23"/> - </issue> - - <issue - id="NewApi" - message="Call requires API level 35 (current min is 34): `android.app.Activity#isResumed`" - errorLine1=" resumed = activity.isResumed();" - errorLine2=" ~~~~~~~~~"> - <location - file="frameworks/base/nfc/java/android/nfc/NfcActivityManager.java" - line="124" - column="32"/> - </issue> - - <issue - id="NewApi" - message="Call requires API level 35 (current min is 34): `android.app.Activity#isResumed`" - errorLine1=" if (!activity.isResumed()) {" - errorLine2=" ~~~~~~~~~"> - <location - file="frameworks/base/nfc/java/android/nfc/NfcAdapter.java" - line="2457" - column="23"/> - </issue> - - <issue - id="NewApi" - message="Call requires API level 35 (current min is 34): `android.app.Activity#isResumed`" - errorLine1=" if (!activity.isResumed()) {" - errorLine2=" ~~~~~~~~~"> - <location - file="frameworks/base/nfc/java/android/nfc/cardemulation/NfcFCardEmulation.java" - line="315" - column="23"/> - </issue> - - <issue - id="NewApi" - message="Call requires API level 35 (current min is 34): `android.app.Activity#isResumed`" - errorLine1=" if (!activity.isResumed()) {" - errorLine2=" ~~~~~~~~~"> - <location - file="frameworks/base/nfc/java/android/nfc/cardemulation/NfcFCardEmulation.java" - line="351" - column="23"/> - </issue> - - <issue id="FlaggedApi" message="Method `PollingFrame()` is a flagged API and should be inside an `if (Flags.nfcReadPollingLoop())` check (or annotate the surrounding method `handleMessage` with `@FlaggedApi(Flags.FLAG_NFC_READ_POLLING_LOOP) to transfer requirement to caller`)" errorLine1=" pollingFrames.add(new PollingFrame(frame));" @@ -265,4 +56,4 @@ column="44"/> </issue> -</issues>
\ No newline at end of file +</issues> diff --git a/packages/SettingsProvider/src/com/android/providers/settings/EventLogTags.logtags b/packages/SettingsProvider/src/com/android/providers/settings/EventLogTags.logtags index 7eff16b0def4..0367fe0dab01 100644 --- a/packages/SettingsProvider/src/com/android/providers/settings/EventLogTags.logtags +++ b/packages/SettingsProvider/src/com/android/providers/settings/EventLogTags.logtags @@ -1,4 +1,4 @@ -# See system/core/logcat/event.logtags for a description of the format of this file. +# See system/logging/logcat/event.logtags for a description of the format of this file. option java_package com.android.providers.settings; diff --git a/packages/SystemUI/src/com/android/systemui/EventLogTags.logtags b/packages/SystemUI/src/com/android/systemui/EventLogTags.logtags index 08236b7e280a..ca5424bc0c52 100644 --- a/packages/SystemUI/src/com/android/systemui/EventLogTags.logtags +++ b/packages/SystemUI/src/com/android/systemui/EventLogTags.logtags @@ -1,4 +1,4 @@ -# See system/core/logcat/event.logtags for a description of the format of this file. +# See system/logging/logcat/event.logtags for a description of the format of this file. option java_package com.android.systemui; diff --git a/packages/SystemUI/src/com/android/systemui/media/dialog/OWNERS b/packages/SystemUI/src/com/android/systemui/media/dialog/OWNERS index 95b8fa74feeb..4976d94d9057 100644 --- a/packages/SystemUI/src/com/android/systemui/media/dialog/OWNERS +++ b/packages/SystemUI/src/com/android/systemui/media/dialog/OWNERS @@ -1,3 +1,3 @@ # Bug component: 1280508 -# Files in this directory should still be reviewed by a member of SystemUI team +asapperstein@google.com diff --git a/packages/Vcn/TEST_MAPPING b/packages/Vcn/TEST_MAPPING index bde88fe9b717..9722a838ab8e 100644 --- a/packages/Vcn/TEST_MAPPING +++ b/packages/Vcn/TEST_MAPPING @@ -1,4 +1,12 @@ { + "presubmit": [ + { + "name": "FrameworksVcnTests" + }, + { + "name": "CtsVcnTestCases" + } + ], "postsubmit": [ { "name": "FrameworksVcnTests" diff --git a/packages/Vcn/flags/Android.bp b/packages/Vcn/flags/Android.bp new file mode 100644 index 000000000000..3943c6f7fe24 --- /dev/null +++ b/packages/Vcn/flags/Android.bp @@ -0,0 +1,38 @@ +// +// Copyright (C) 2024 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 { + default_team: "trendy_team_enigma", + default_applicable_licenses: ["Android-Apache-2.0"], +} + +aconfig_declarations { + name: "android.net.vcn.flags-aconfig", + package: "android.net.vcn", + container: "com.android.tethering", + exportable: true, + srcs: [ + "flags.aconfig", + ], +} + +java_aconfig_library { + name: "android.net.vcn.flags-aconfig-java-export", + aconfig_declarations: "android.net.vcn.flags-aconfig", + mode: "exported", + min_sdk_version: "35", + defaults: ["framework-minus-apex-aconfig-java-defaults"], +} diff --git a/core/java/android/net/vcn/flags.aconfig b/packages/Vcn/flags/flags.aconfig index b461f95fec53..b461f95fec53 100644 --- a/core/java/android/net/vcn/flags.aconfig +++ b/packages/Vcn/flags/flags.aconfig diff --git a/packages/Vcn/framework-b/Android.bp b/packages/Vcn/framework-b/Android.bp index 8b010c7f2ee7..c3121162b7f2 100644 --- a/packages/Vcn/framework-b/Android.bp +++ b/packages/Vcn/framework-b/Android.bp @@ -19,6 +19,18 @@ package { default_applicable_licenses: ["Android-Apache-2.0"], } +filegroup { + name: "vcn-utils-platform-sources", + srcs: [ + "src/android/net/vcn/persistablebundleutils/**/*.java", + "src/android/net/vcn/util/**/*.java", + ], + path: "src", + visibility: [ + "//frameworks/base", // For VpnProfile.java and Vpn.java + ], +} + java_defaults { name: "framework-connectivity-b-defaults", sdk_version: "module_current", @@ -27,7 +39,25 @@ java_defaults { srcs: [ "src/**/*.java", + "src/**/*.aidl", + ], + + libs: [ + "android.net.ipsec.ike.stubs.module_lib", + "app-compat-annotations", + "framework-wifi.stubs.module_lib", + "unsupportedappusage", + ], + static_libs: [ + //TODO:375213246 Use a non-exported flag lib when VCN is in mainline + "android.net.vcn.flags-aconfig-java-export", ], + aidl: { + include_dirs: [ + // For connectivity-framework classes such as Network.aidl, NetworkCapabilities.aidl + "packages/modules/Connectivity/framework/aidl-export", + ], + }, } java_sdk_library { @@ -36,10 +66,37 @@ java_sdk_library { "framework-connectivity-b-defaults", ], + //TODO: b/375213246 Use "framework-connectivity-jarjar-rules" when VCN is + // in mainline + jarjar_rules: "framework-vcn-jarjar-rules.txt", + permitted_packages: [ + "android.net", + "android.net.vcn", + "com.android.server.vcn.util", + + ], + api_packages: [ + "android.net", "android.net.vcn", ], + // Allow VCN APIs to reference APIs in IKE and Connectivity + stub_only_libs: [ + "android.net.ipsec.ike.stubs.module_lib", + "framework-connectivity.stubs.module_lib", + ], + + // To use non-jarjard names of utilities such as android.util.IndentingPrintWriter + impl_only_libs: [ + "framework-connectivity-pre-jarjar", + ], + + aconfig_declarations: [ + //TODO:375213246 Use a non-exported flag lib when VCN is in mainline + "android.net.vcn.flags-aconfig-java-export", + ], + impl_library_visibility: [ // Using for test only "//cts/tests/netlegacy22.api", @@ -63,5 +120,18 @@ java_sdk_library { "//packages/modules/Wifi/service/tests/wifitests", ], - // TODO: b/375213246 Expose this library to Tethering module + apex_available: [ + // TODO: b/374174952 Remove it when VCN modularization is released + "//apex_available:platform", + + "com.android.tethering", + ], +} + +java_library { + name: "framework-connectivity-b-pre-jarjar", + defaults: ["framework-connectivity-b-defaults"], + libs: [ + "framework-connectivity-pre-jarjar", + ], } diff --git a/packages/Vcn/framework-b/api/current.txt b/packages/Vcn/framework-b/api/current.txt index d802177e249b..831b74158e67 100644 --- a/packages/Vcn/framework-b/api/current.txt +++ b/packages/Vcn/framework-b/api/current.txt @@ -1 +1,123 @@ // Signature format: 2.0 +package android.net.vcn { + + public final class VcnCellUnderlyingNetworkTemplate extends android.net.vcn.VcnUnderlyingNetworkTemplate { + method public int getCbs(); + method public int getDun(); + method public int getIms(); + method public int getInternet(); + method public int getMms(); + method @NonNull public java.util.Set<java.lang.String> getOperatorPlmnIds(); + method public int getOpportunistic(); + method public int getRcs(); + method public int getRoaming(); + method @NonNull public java.util.Set<java.lang.Integer> getSimSpecificCarrierIds(); + } + + public static final class VcnCellUnderlyingNetworkTemplate.Builder { + ctor public VcnCellUnderlyingNetworkTemplate.Builder(); + method @NonNull public android.net.vcn.VcnCellUnderlyingNetworkTemplate build(); + method @NonNull public android.net.vcn.VcnCellUnderlyingNetworkTemplate.Builder setCbs(int); + method @NonNull public android.net.vcn.VcnCellUnderlyingNetworkTemplate.Builder setDun(int); + method @NonNull public android.net.vcn.VcnCellUnderlyingNetworkTemplate.Builder setIms(int); + method @NonNull public android.net.vcn.VcnCellUnderlyingNetworkTemplate.Builder setInternet(int); + method @NonNull public android.net.vcn.VcnCellUnderlyingNetworkTemplate.Builder setMetered(int); + method @NonNull public android.net.vcn.VcnCellUnderlyingNetworkTemplate.Builder setMinDownstreamBandwidthKbps(int, int); + method @NonNull public android.net.vcn.VcnCellUnderlyingNetworkTemplate.Builder setMinUpstreamBandwidthKbps(int, int); + method @NonNull public android.net.vcn.VcnCellUnderlyingNetworkTemplate.Builder setMms(int); + method @NonNull public android.net.vcn.VcnCellUnderlyingNetworkTemplate.Builder setOperatorPlmnIds(@NonNull java.util.Set<java.lang.String>); + method @NonNull public android.net.vcn.VcnCellUnderlyingNetworkTemplate.Builder setOpportunistic(int); + method @NonNull public android.net.vcn.VcnCellUnderlyingNetworkTemplate.Builder setRcs(int); + method @NonNull public android.net.vcn.VcnCellUnderlyingNetworkTemplate.Builder setRoaming(int); + method @NonNull public android.net.vcn.VcnCellUnderlyingNetworkTemplate.Builder setSimSpecificCarrierIds(@NonNull java.util.Set<java.lang.Integer>); + } + + public final class VcnConfig implements android.os.Parcelable { + method public int describeContents(); + method @NonNull public java.util.Set<android.net.vcn.VcnGatewayConnectionConfig> getGatewayConnectionConfigs(); + method @NonNull public java.util.Set<java.lang.Integer> getRestrictedUnderlyingNetworkTransports(); + method public void writeToParcel(@NonNull android.os.Parcel, int); + field @NonNull public static final android.os.Parcelable.Creator<android.net.vcn.VcnConfig> CREATOR; + } + + public static final class VcnConfig.Builder { + ctor public VcnConfig.Builder(@NonNull android.content.Context); + method @NonNull public android.net.vcn.VcnConfig.Builder addGatewayConnectionConfig(@NonNull android.net.vcn.VcnGatewayConnectionConfig); + method @NonNull public android.net.vcn.VcnConfig build(); + method @NonNull public android.net.vcn.VcnConfig.Builder setRestrictedUnderlyingNetworkTransports(@NonNull java.util.Set<java.lang.Integer>); + } + + public final class VcnGatewayConnectionConfig { + method @NonNull public int[] getExposedCapabilities(); + method @NonNull public String getGatewayConnectionName(); + method @IntRange(from=0x500) public int getMaxMtu(); + method public int getMinUdpPort4500NatTimeoutSeconds(); + method @NonNull public long[] getRetryIntervalsMillis(); + method @NonNull public java.util.List<android.net.vcn.VcnUnderlyingNetworkTemplate> getVcnUnderlyingNetworkPriorities(); + method public boolean hasGatewayOption(int); + method @FlaggedApi("android.net.vcn.safe_mode_config") public boolean isSafeModeEnabled(); + field @FlaggedApi("android.net.vcn.mainline_vcn_module_api") public static final int MIN_UDP_PORT_4500_NAT_TIMEOUT_UNSET = -1; // 0xffffffff + field public static final int VCN_GATEWAY_OPTION_ENABLE_DATA_STALL_RECOVERY_WITH_MOBILITY = 0; // 0x0 + } + + public static final class VcnGatewayConnectionConfig.Builder { + ctor public VcnGatewayConnectionConfig.Builder(@NonNull String, @NonNull android.net.ipsec.ike.IkeTunnelConnectionParams); + method @NonNull public android.net.vcn.VcnGatewayConnectionConfig.Builder addExposedCapability(int); + method @NonNull public android.net.vcn.VcnGatewayConnectionConfig.Builder addGatewayOption(int); + method @NonNull public android.net.vcn.VcnGatewayConnectionConfig build(); + method @NonNull public android.net.vcn.VcnGatewayConnectionConfig.Builder removeExposedCapability(int); + method @NonNull public android.net.vcn.VcnGatewayConnectionConfig.Builder removeGatewayOption(int); + method @NonNull public android.net.vcn.VcnGatewayConnectionConfig.Builder setMaxMtu(@IntRange(from=0x500) int); + method @NonNull public android.net.vcn.VcnGatewayConnectionConfig.Builder setMinUdpPort4500NatTimeoutSeconds(@IntRange(from=0x78) int); + method @NonNull public android.net.vcn.VcnGatewayConnectionConfig.Builder setRetryIntervalsMillis(@NonNull long[]); + method @FlaggedApi("android.net.vcn.safe_mode_config") @NonNull public android.net.vcn.VcnGatewayConnectionConfig.Builder setSafeModeEnabled(boolean); + method @NonNull public android.net.vcn.VcnGatewayConnectionConfig.Builder setVcnUnderlyingNetworkPriorities(@NonNull java.util.List<android.net.vcn.VcnUnderlyingNetworkTemplate>); + } + + public class VcnManager { + method @RequiresPermission("carrier privileges") public void clearVcnConfig(@NonNull android.os.ParcelUuid) throws java.io.IOException; + method @NonNull public java.util.List<android.os.ParcelUuid> getConfiguredSubscriptionGroups(); + method public void registerVcnStatusCallback(@NonNull android.os.ParcelUuid, @NonNull java.util.concurrent.Executor, @NonNull android.net.vcn.VcnManager.VcnStatusCallback); + method @RequiresPermission("carrier privileges") public void setVcnConfig(@NonNull android.os.ParcelUuid, @NonNull android.net.vcn.VcnConfig) throws java.io.IOException; + method public void unregisterVcnStatusCallback(@NonNull android.net.vcn.VcnManager.VcnStatusCallback); + field public static final int VCN_ERROR_CODE_CONFIG_ERROR = 1; // 0x1 + field public static final int VCN_ERROR_CODE_INTERNAL_ERROR = 0; // 0x0 + field public static final int VCN_ERROR_CODE_NETWORK_ERROR = 2; // 0x2 + field public static final int VCN_STATUS_CODE_ACTIVE = 2; // 0x2 + field public static final int VCN_STATUS_CODE_INACTIVE = 1; // 0x1 + field public static final int VCN_STATUS_CODE_NOT_CONFIGURED = 0; // 0x0 + field public static final int VCN_STATUS_CODE_SAFE_MODE = 3; // 0x3 + } + + public abstract static class VcnManager.VcnStatusCallback { + ctor public VcnManager.VcnStatusCallback(); + method public abstract void onGatewayConnectionError(@NonNull String, int, @Nullable Throwable); + method public abstract void onStatusChanged(int); + } + + public abstract class VcnUnderlyingNetworkTemplate { + method public int getMetered(); + method public int getMinEntryDownstreamBandwidthKbps(); + method public int getMinEntryUpstreamBandwidthKbps(); + method public int getMinExitDownstreamBandwidthKbps(); + method public int getMinExitUpstreamBandwidthKbps(); + field public static final int MATCH_ANY = 0; // 0x0 + field public static final int MATCH_FORBIDDEN = 2; // 0x2 + field public static final int MATCH_REQUIRED = 1; // 0x1 + } + + public final class VcnWifiUnderlyingNetworkTemplate extends android.net.vcn.VcnUnderlyingNetworkTemplate { + method @NonNull public java.util.Set<java.lang.String> getSsids(); + } + + public static final class VcnWifiUnderlyingNetworkTemplate.Builder { + ctor public VcnWifiUnderlyingNetworkTemplate.Builder(); + method @NonNull public android.net.vcn.VcnWifiUnderlyingNetworkTemplate build(); + method @NonNull public android.net.vcn.VcnWifiUnderlyingNetworkTemplate.Builder setMetered(int); + method @NonNull public android.net.vcn.VcnWifiUnderlyingNetworkTemplate.Builder setMinDownstreamBandwidthKbps(int, int); + method @NonNull public android.net.vcn.VcnWifiUnderlyingNetworkTemplate.Builder setMinUpstreamBandwidthKbps(int, int); + method @NonNull public android.net.vcn.VcnWifiUnderlyingNetworkTemplate.Builder setSsids(@NonNull java.util.Set<java.lang.String>); + } + +} + diff --git a/packages/Vcn/framework-b/api/module-lib-current.txt b/packages/Vcn/framework-b/api/module-lib-current.txt index d802177e249b..8961b2830f86 100644 --- a/packages/Vcn/framework-b/api/module-lib-current.txt +++ b/packages/Vcn/framework-b/api/module-lib-current.txt @@ -1 +1,28 @@ // Signature format: 2.0 +package android.net { + + @FlaggedApi("android.net.vcn.mainline_vcn_module_api") public final class ConnectivityFrameworkInitializerBaklava { + method @FlaggedApi("android.net.vcn.mainline_vcn_module_api") public static void registerServiceWrappers(); + } + +} + +package android.net.vcn { + + @FlaggedApi("android.net.vcn.mainline_vcn_module_api") public final class VcnTransportInfo implements android.os.Parcelable android.net.TransportInfo { + method @FlaggedApi("android.net.vcn.mainline_vcn_module_api") public int describeContents(); + method @FlaggedApi("android.net.vcn.mainline_vcn_module_api") public long getApplicableRedactions(); + method @FlaggedApi("android.net.vcn.mainline_vcn_module_api") public int getMinUdpPort4500NatTimeoutSeconds(); + method @FlaggedApi("android.net.vcn.mainline_vcn_module_api") @NonNull public android.net.TransportInfo makeCopy(long); + method @FlaggedApi("android.net.vcn.mainline_vcn_module_api") public void writeToParcel(@NonNull android.os.Parcel, int); + field @FlaggedApi("android.net.vcn.mainline_vcn_module_api") @NonNull public static final android.os.Parcelable.Creator<android.net.vcn.VcnTransportInfo> CREATOR; + } + + @FlaggedApi("android.net.vcn.mainline_vcn_module_api") public static final class VcnTransportInfo.Builder { + ctor @FlaggedApi("android.net.vcn.mainline_vcn_module_api") public VcnTransportInfo.Builder(); + method @FlaggedApi("android.net.vcn.mainline_vcn_module_api") @NonNull public android.net.vcn.VcnTransportInfo build(); + method @FlaggedApi("android.net.vcn.mainline_vcn_module_api") @NonNull public android.net.vcn.VcnTransportInfo.Builder setMinUdpPort4500NatTimeoutSeconds(@IntRange(from=0x78) int); + } + +} + diff --git a/packages/Vcn/framework-b/api/system-current.txt b/packages/Vcn/framework-b/api/system-current.txt index d802177e249b..9c5a67701b74 100644 --- a/packages/Vcn/framework-b/api/system-current.txt +++ b/packages/Vcn/framework-b/api/system-current.txt @@ -1 +1,23 @@ // Signature format: 2.0 +package android.net.vcn { + + public class VcnManager { + method @RequiresPermission(android.Manifest.permission.NETWORK_FACTORY) public void addVcnNetworkPolicyChangeListener(@NonNull java.util.concurrent.Executor, @NonNull android.net.vcn.VcnManager.VcnNetworkPolicyChangeListener); + method @NonNull @RequiresPermission(android.Manifest.permission.NETWORK_FACTORY) public android.net.vcn.VcnNetworkPolicyResult applyVcnNetworkPolicy(@NonNull android.net.NetworkCapabilities, @NonNull android.net.LinkProperties); + method @RequiresPermission(android.Manifest.permission.NETWORK_FACTORY) public void removeVcnNetworkPolicyChangeListener(@NonNull android.net.vcn.VcnManager.VcnNetworkPolicyChangeListener); + } + + public static interface VcnManager.VcnNetworkPolicyChangeListener { + method public void onPolicyChanged(); + } + + public final class VcnNetworkPolicyResult implements android.os.Parcelable { + method public int describeContents(); + method @NonNull public android.net.NetworkCapabilities getNetworkCapabilities(); + method public boolean isTeardownRequested(); + method public void writeToParcel(@NonNull android.os.Parcel, int); + field @NonNull public static final android.os.Parcelable.Creator<android.net.vcn.VcnNetworkPolicyResult> CREATOR; + } + +} + diff --git a/packages/Vcn/framework-b/framework-vcn-jarjar-rules.txt b/packages/Vcn/framework-b/framework-vcn-jarjar-rules.txt new file mode 100644 index 000000000000..757043bdbbc0 --- /dev/null +++ b/packages/Vcn/framework-b/framework-vcn-jarjar-rules.txt @@ -0,0 +1,2 @@ +rule android.net.vcn.persistablebundleutils.** android.net.vcn.module.repackaged.persistablebundleutils.@1 +rule android.net.vcn.util.** android.net.vcn.module.repackaged.util.@1
\ No newline at end of file diff --git a/core/java/android/net/ConnectivityFrameworkInitializerBaklava.java b/packages/Vcn/framework-b/src/android/net/ConnectivityFrameworkInitializerBaklava.java index 1f0fa92d7976..1f0fa92d7976 100644 --- a/core/java/android/net/ConnectivityFrameworkInitializerBaklava.java +++ b/packages/Vcn/framework-b/src/android/net/ConnectivityFrameworkInitializerBaklava.java diff --git a/core/java/android/net/vcn/IVcnManagementService.aidl b/packages/Vcn/framework-b/src/android/net/vcn/IVcnManagementService.aidl index e16f6b167750..e16f6b167750 100644 --- a/core/java/android/net/vcn/IVcnManagementService.aidl +++ b/packages/Vcn/framework-b/src/android/net/vcn/IVcnManagementService.aidl diff --git a/core/java/android/net/vcn/IVcnStatusCallback.aidl b/packages/Vcn/framework-b/src/android/net/vcn/IVcnStatusCallback.aidl index 11bc443c9dd6..11bc443c9dd6 100644 --- a/core/java/android/net/vcn/IVcnStatusCallback.aidl +++ b/packages/Vcn/framework-b/src/android/net/vcn/IVcnStatusCallback.aidl diff --git a/core/java/android/net/vcn/IVcnUnderlyingNetworkPolicyListener.aidl b/packages/Vcn/framework-b/src/android/net/vcn/IVcnUnderlyingNetworkPolicyListener.aidl index 62de8216ce54..62de8216ce54 100644 --- a/core/java/android/net/vcn/IVcnUnderlyingNetworkPolicyListener.aidl +++ b/packages/Vcn/framework-b/src/android/net/vcn/IVcnUnderlyingNetworkPolicyListener.aidl diff --git a/core/java/android/net/vcn/VcnCellUnderlyingNetworkTemplate.java b/packages/Vcn/framework-b/src/android/net/vcn/VcnCellUnderlyingNetworkTemplate.java index ded94159a945..ded94159a945 100644 --- a/core/java/android/net/vcn/VcnCellUnderlyingNetworkTemplate.java +++ b/packages/Vcn/framework-b/src/android/net/vcn/VcnCellUnderlyingNetworkTemplate.java diff --git a/core/java/android/net/vcn/VcnConfig.aidl b/packages/Vcn/framework-b/src/android/net/vcn/VcnConfig.aidl index 67006a42a701..67006a42a701 100644 --- a/core/java/android/net/vcn/VcnConfig.aidl +++ b/packages/Vcn/framework-b/src/android/net/vcn/VcnConfig.aidl diff --git a/core/java/android/net/vcn/VcnConfig.java b/packages/Vcn/framework-b/src/android/net/vcn/VcnConfig.java index 0d0efb2f73f9..0d0efb2f73f9 100644 --- a/core/java/android/net/vcn/VcnConfig.java +++ b/packages/Vcn/framework-b/src/android/net/vcn/VcnConfig.java diff --git a/core/java/android/net/vcn/VcnGatewayConnectionConfig.java b/packages/Vcn/framework-b/src/android/net/vcn/VcnGatewayConnectionConfig.java index 067144e6f474..067144e6f474 100644 --- a/core/java/android/net/vcn/VcnGatewayConnectionConfig.java +++ b/packages/Vcn/framework-b/src/android/net/vcn/VcnGatewayConnectionConfig.java diff --git a/core/java/android/net/vcn/VcnManager.java b/packages/Vcn/framework-b/src/android/net/vcn/VcnManager.java index f275714e2cf5..594bbb8a2015 100644 --- a/core/java/android/net/vcn/VcnManager.java +++ b/packages/Vcn/framework-b/src/android/net/vcn/VcnManager.java @@ -334,7 +334,7 @@ public class VcnManager { * @param executor the Executor that will be used for invoking all calls to the specified * Listener * @param listener the VcnUnderlyingNetworkPolicyListener to be added - * @throws SecurityException if the caller does not have permission NETWORK_FACTORY + * @throws SecurityException if the caller does not have the required permission * @throws IllegalStateException if the specified VcnUnderlyingNetworkPolicyListener is already * registered * @hide @@ -423,7 +423,7 @@ public class VcnManager { * @param executor the Executor that will be used for invoking all calls to the specified * Listener * @param listener the VcnNetworkPolicyChangeListener to be added - * @throws SecurityException if the caller does not have permission NETWORK_FACTORY + * @throws SecurityException if the caller does not have the required permission * @throws IllegalStateException if the specified VcnNetworkPolicyChangeListener is already * registered * @hide @@ -455,7 +455,7 @@ public class VcnManager { * <p>If the specified listener is not currently registered, this is a no-op. * * @param listener the VcnNetworkPolicyChangeListener that will be removed - * @throws SecurityException if the caller does not have permission NETWORK_FACTORY + * @throws SecurityException if the caller does not have the required permission * @hide */ @SystemApi @@ -489,7 +489,7 @@ public class VcnManager { * policy result for this Network. * @param linkProperties the LinkProperties to be used in determining the Network policy result * for this Network. - * @throws SecurityException if the caller does not have permission NETWORK_FACTORY + * @throws SecurityException if the caller does not have the required permission * @return the {@link VcnNetworkPolicyResult} to be used for this Network. * @hide */ diff --git a/core/java/android/net/vcn/VcnNetworkPolicyResult.aidl b/packages/Vcn/framework-b/src/android/net/vcn/VcnNetworkPolicyResult.aidl index 3f13abe869da..3f13abe869da 100644 --- a/core/java/android/net/vcn/VcnNetworkPolicyResult.aidl +++ b/packages/Vcn/framework-b/src/android/net/vcn/VcnNetworkPolicyResult.aidl diff --git a/core/java/android/net/vcn/VcnNetworkPolicyResult.java b/packages/Vcn/framework-b/src/android/net/vcn/VcnNetworkPolicyResult.java index fca084a00a79..fca084a00a79 100644 --- a/core/java/android/net/vcn/VcnNetworkPolicyResult.java +++ b/packages/Vcn/framework-b/src/android/net/vcn/VcnNetworkPolicyResult.java diff --git a/core/java/android/net/vcn/VcnTransportInfo.java b/packages/Vcn/framework-b/src/android/net/vcn/VcnTransportInfo.java index 3638429f33fb..3638429f33fb 100644 --- a/core/java/android/net/vcn/VcnTransportInfo.java +++ b/packages/Vcn/framework-b/src/android/net/vcn/VcnTransportInfo.java diff --git a/core/java/android/net/vcn/VcnUnderlyingNetworkPolicy.aidl b/packages/Vcn/framework-b/src/android/net/vcn/VcnUnderlyingNetworkPolicy.aidl index 6cb6ee685a64..6cb6ee685a64 100644 --- a/core/java/android/net/vcn/VcnUnderlyingNetworkPolicy.aidl +++ b/packages/Vcn/framework-b/src/android/net/vcn/VcnUnderlyingNetworkPolicy.aidl diff --git a/core/java/android/net/vcn/VcnUnderlyingNetworkPolicy.java b/packages/Vcn/framework-b/src/android/net/vcn/VcnUnderlyingNetworkPolicy.java index 2b5305d05dcd..2b5305d05dcd 100644 --- a/core/java/android/net/vcn/VcnUnderlyingNetworkPolicy.java +++ b/packages/Vcn/framework-b/src/android/net/vcn/VcnUnderlyingNetworkPolicy.java diff --git a/core/java/android/net/vcn/VcnUnderlyingNetworkSpecifier.java b/packages/Vcn/framework-b/src/android/net/vcn/VcnUnderlyingNetworkSpecifier.java index e1d1b3c65c99..e1d1b3c65c99 100644 --- a/core/java/android/net/vcn/VcnUnderlyingNetworkSpecifier.java +++ b/packages/Vcn/framework-b/src/android/net/vcn/VcnUnderlyingNetworkSpecifier.java diff --git a/core/java/android/net/vcn/VcnUnderlyingNetworkTemplate.java b/packages/Vcn/framework-b/src/android/net/vcn/VcnUnderlyingNetworkTemplate.java index 16114dd135af..16114dd135af 100644 --- a/core/java/android/net/vcn/VcnUnderlyingNetworkTemplate.java +++ b/packages/Vcn/framework-b/src/android/net/vcn/VcnUnderlyingNetworkTemplate.java diff --git a/core/java/android/net/vcn/VcnWifiUnderlyingNetworkTemplate.java b/packages/Vcn/framework-b/src/android/net/vcn/VcnWifiUnderlyingNetworkTemplate.java index 770a8c118a4d..770a8c118a4d 100644 --- a/core/java/android/net/vcn/VcnWifiUnderlyingNetworkTemplate.java +++ b/packages/Vcn/framework-b/src/android/net/vcn/VcnWifiUnderlyingNetworkTemplate.java diff --git a/core/java/android/net/vcn/persistablebundleutils/CertUtils.java b/packages/Vcn/framework-b/src/android/net/vcn/persistablebundleutils/CertUtils.java index 35b318687773..35b318687773 100644 --- a/core/java/android/net/vcn/persistablebundleutils/CertUtils.java +++ b/packages/Vcn/framework-b/src/android/net/vcn/persistablebundleutils/CertUtils.java diff --git a/core/java/android/net/vcn/persistablebundleutils/ChildSaProposalUtils.java b/packages/Vcn/framework-b/src/android/net/vcn/persistablebundleutils/ChildSaProposalUtils.java index 48c1b25a97ab..48c1b25a97ab 100644 --- a/core/java/android/net/vcn/persistablebundleutils/ChildSaProposalUtils.java +++ b/packages/Vcn/framework-b/src/android/net/vcn/persistablebundleutils/ChildSaProposalUtils.java diff --git a/core/java/android/net/vcn/persistablebundleutils/EapSessionConfigUtils.java b/packages/Vcn/framework-b/src/android/net/vcn/persistablebundleutils/EapSessionConfigUtils.java index dc1ee36b71c1..dc1ee36b71c1 100644 --- a/core/java/android/net/vcn/persistablebundleutils/EapSessionConfigUtils.java +++ b/packages/Vcn/framework-b/src/android/net/vcn/persistablebundleutils/EapSessionConfigUtils.java diff --git a/core/java/android/net/vcn/persistablebundleutils/IkeIdentificationUtils.java b/packages/Vcn/framework-b/src/android/net/vcn/persistablebundleutils/IkeIdentificationUtils.java index 6e8616fc9cb0..6e8616fc9cb0 100644 --- a/core/java/android/net/vcn/persistablebundleutils/IkeIdentificationUtils.java +++ b/packages/Vcn/framework-b/src/android/net/vcn/persistablebundleutils/IkeIdentificationUtils.java diff --git a/core/java/android/net/vcn/persistablebundleutils/IkeSaProposalUtils.java b/packages/Vcn/framework-b/src/android/net/vcn/persistablebundleutils/IkeSaProposalUtils.java index b590148de51f..b590148de51f 100644 --- a/core/java/android/net/vcn/persistablebundleutils/IkeSaProposalUtils.java +++ b/packages/Vcn/framework-b/src/android/net/vcn/persistablebundleutils/IkeSaProposalUtils.java diff --git a/core/java/android/net/vcn/persistablebundleutils/IkeSessionParamsUtils.java b/packages/Vcn/framework-b/src/android/net/vcn/persistablebundleutils/IkeSessionParamsUtils.java index aefac2e89aea..aefac2e89aea 100644 --- a/core/java/android/net/vcn/persistablebundleutils/IkeSessionParamsUtils.java +++ b/packages/Vcn/framework-b/src/android/net/vcn/persistablebundleutils/IkeSessionParamsUtils.java diff --git a/core/java/android/net/vcn/persistablebundleutils/IkeTrafficSelectorUtils.java b/packages/Vcn/framework-b/src/android/net/vcn/persistablebundleutils/IkeTrafficSelectorUtils.java index 6bbc6b1e8218..6bbc6b1e8218 100644 --- a/core/java/android/net/vcn/persistablebundleutils/IkeTrafficSelectorUtils.java +++ b/packages/Vcn/framework-b/src/android/net/vcn/persistablebundleutils/IkeTrafficSelectorUtils.java diff --git a/core/java/android/net/vcn/persistablebundleutils/SaProposalUtilsBase.java b/packages/Vcn/framework-b/src/android/net/vcn/persistablebundleutils/SaProposalUtilsBase.java index 469966a48465..469966a48465 100644 --- a/core/java/android/net/vcn/persistablebundleutils/SaProposalUtilsBase.java +++ b/packages/Vcn/framework-b/src/android/net/vcn/persistablebundleutils/SaProposalUtilsBase.java diff --git a/core/java/android/net/vcn/persistablebundleutils/TunnelConnectionParamsUtils.java b/packages/Vcn/framework-b/src/android/net/vcn/persistablebundleutils/TunnelConnectionParamsUtils.java index 0427742f9c0a..0427742f9c0a 100644 --- a/core/java/android/net/vcn/persistablebundleutils/TunnelConnectionParamsUtils.java +++ b/packages/Vcn/framework-b/src/android/net/vcn/persistablebundleutils/TunnelConnectionParamsUtils.java diff --git a/core/java/android/net/vcn/persistablebundleutils/TunnelModeChildSessionParamsUtils.java b/packages/Vcn/framework-b/src/android/net/vcn/persistablebundleutils/TunnelModeChildSessionParamsUtils.java index 3f4ba345a118..3f4ba345a118 100644 --- a/core/java/android/net/vcn/persistablebundleutils/TunnelModeChildSessionParamsUtils.java +++ b/packages/Vcn/framework-b/src/android/net/vcn/persistablebundleutils/TunnelModeChildSessionParamsUtils.java diff --git a/core/java/android/net/vcn/util/LogUtils.java b/packages/Vcn/framework-b/src/android/net/vcn/util/LogUtils.java index 7f7f85271603..742aa761e602 100644 --- a/core/java/android/net/vcn/util/LogUtils.java +++ b/packages/Vcn/framework-b/src/android/net/vcn/util/LogUtils.java @@ -19,7 +19,7 @@ package android.net.vcn.util; import android.annotation.Nullable; import android.os.ParcelUuid; -import com.android.internal.util.HexDump; +import com.android.net.module.util.HexDump; /** @hide */ public class LogUtils { diff --git a/core/java/android/net/vcn/util/MtuUtils.java b/packages/Vcn/framework-b/src/android/net/vcn/util/MtuUtils.java index c3123bcecf33..c3123bcecf33 100644 --- a/core/java/android/net/vcn/util/MtuUtils.java +++ b/packages/Vcn/framework-b/src/android/net/vcn/util/MtuUtils.java diff --git a/core/java/android/net/vcn/util/OneWayBoolean.java b/packages/Vcn/framework-b/src/android/net/vcn/util/OneWayBoolean.java index a7ef67b187b9..a7ef67b187b9 100644 --- a/core/java/android/net/vcn/util/OneWayBoolean.java +++ b/packages/Vcn/framework-b/src/android/net/vcn/util/OneWayBoolean.java diff --git a/core/java/android/net/vcn/util/PersistableBundleUtils.java b/packages/Vcn/framework-b/src/android/net/vcn/util/PersistableBundleUtils.java index 4dc42c7827f8..8a687d8c5942 100644 --- a/core/java/android/net/vcn/util/PersistableBundleUtils.java +++ b/packages/Vcn/framework-b/src/android/net/vcn/util/PersistableBundleUtils.java @@ -21,7 +21,7 @@ import android.annotation.Nullable; import android.os.ParcelUuid; import android.os.PersistableBundle; -import com.android.internal.util.HexDump; +import com.android.net.module.util.HexDump; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; diff --git a/packages/Vcn/service-b/Android.bp b/packages/Vcn/service-b/Android.bp index 03ef4e67af1c..c1a1ee7875d0 100644 --- a/packages/Vcn/service-b/Android.bp +++ b/packages/Vcn/service-b/Android.bp @@ -32,6 +32,33 @@ filegroup { visibility: ["//frameworks/base/services/core"], } +// Do not static include this lib in VCN because these files exist in +// both service-connectivity.jar and framework.jar +// TODO: b/374174952 After VCN moves to Connectivity/ and the modularization is done +// this lib can be removed and "service-connectivity-b-pre-jarjar" can include +// "service-connectivity-pre-jarjar" +java_library { + name: "connectivity-utils-service-vcn-internal", + sdk_version: "module_current", + min_sdk_version: "30", + srcs: [ + ":framework-connectivity-shared-srcs", + ], + libs: [ + "framework-annotations-lib", + "unsupportedappusage", + ], + visibility: [ + "//visibility:private", + ], + apex_available: [ + // TODO: b/374174952 Remove it when VCN modularization is released + "//apex_available:platform", + + "com.android.tethering", + ], +} + java_library { name: "service-connectivity-b-pre-jarjar", sdk_version: "system_server_current", @@ -42,8 +69,33 @@ java_library { "src/**/*.java", ], - // TODO: b/375213246 Expose this library to Tethering module + libs: [ + "android.net.ipsec.ike.stubs.module_lib", + "connectivity-utils-service-vcn-internal", + "framework-annotations-lib", + "framework-connectivity-pre-jarjar", + "framework-connectivity-t-pre-jarjar", + "framework-connectivity-b-pre-jarjar", + "framework-wifi.stubs.module_lib", + "keepanno-annotations", + "modules-utils-statemachine", + "unsupportedappusage", + ], + + // TODO: b/374174952 Dynamically include these libs when VCN + // modularization is released + static_libs: [ + "net-utils-service-vcn", + "modules-utils-handlerexecutor", + ], + visibility: [ "//frameworks/base/services", ], + apex_available: [ + // TODO: b/374174952 Remove it when VCN modularization is released + "//apex_available:platform", + + "com.android.tethering", + ], } diff --git a/packages/Vcn/service-b/src/com/android/server/ConnectivityServiceInitializerB.java b/packages/Vcn/service-b/src/com/android/server/ConnectivityServiceInitializerB.java new file mode 100644 index 000000000000..02c8ce4f29e9 --- /dev/null +++ b/packages/Vcn/service-b/src/com/android/server/ConnectivityServiceInitializerB.java @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2024 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 android.content.Context; +import android.util.Log; + +import com.android.tools.r8.keepanno.annotations.KeepItemKind; +import com.android.tools.r8.keepanno.annotations.UsedByReflection; + +/** + * Service initializer for VCN. This is called by system server to create a new instance of + * VcnManagementService. + */ +// This class is reflectively invoked from SystemServer and ConnectivityServiceInitializer. +// Without this annotation, this class will be treated as unused class and be removed during build +// time. +@UsedByReflection(kind = KeepItemKind.CLASS_AND_METHODS) +public final class ConnectivityServiceInitializerB extends SystemService { + private static final String TAG = ConnectivityServiceInitializerB.class.getSimpleName(); + private final VcnManagementService mVcnManagementService; + + public ConnectivityServiceInitializerB(Context context) { + super(context); + mVcnManagementService = VcnManagementService.create(context); + } + + @Override + public void onStart() { + if (mVcnManagementService != null) { + Log.i(TAG, "Registering " + Context.VCN_MANAGEMENT_SERVICE); + publishBinderService( + Context.VCN_MANAGEMENT_SERVICE, + mVcnManagementService, + /* allowIsolated= */ false); + } + } + + @Override + public void onBootPhase(int phase) { + if (mVcnManagementService != null && phase == SystemService.PHASE_ACTIVITY_MANAGER_READY) { + Log.i(TAG, "Starting " + Context.VCN_MANAGEMENT_SERVICE); + mVcnManagementService.systemReady(); + } + } +} diff --git a/services/core/java/com/android/server/VcnManagementService.java b/packages/Vcn/service-b/src/com/android/server/VcnManagementService.java index a45b715ccac6..26db6a988e31 100644 --- a/services/core/java/com/android/server/VcnManagementService.java +++ b/packages/Vcn/service-b/src/com/android/server/VcnManagementService.java @@ -86,6 +86,7 @@ import com.android.internal.annotations.GuardedBy; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.annotations.VisibleForTesting.Visibility; import com.android.net.module.util.BinderUtils; +import com.android.net.module.util.HandlerUtils; import com.android.net.module.util.LocationPermissionChecker; import com.android.net.module.util.PermissionUtils; import com.android.server.vcn.TelephonySubscriptionTracker; @@ -1332,41 +1333,46 @@ public class VcnManagementService extends IVcnManagementService.Stub { final IndentingPrintWriter pw = new IndentingPrintWriter(writer, "| "); // Post to handler thread to prevent ConcurrentModificationExceptions, and avoid lock-hell. - mHandler.runWithScissors(() -> { - mNetworkProvider.dump(pw); - pw.println(); + HandlerUtils.runWithScissorsForDump( + mHandler, + () -> { + mNetworkProvider.dump(pw); + pw.println(); - mTrackingNetworkCallback.dump(pw); - pw.println(); + mTrackingNetworkCallback.dump(pw); + pw.println(); - synchronized (mLock) { - mLastSnapshot.dump(pw); - pw.println(); + synchronized (mLock) { + mLastSnapshot.dump(pw); + pw.println(); - pw.println("mConfigs:"); - pw.increaseIndent(); - for (Entry<ParcelUuid, VcnConfig> entry : mConfigs.entrySet()) { - pw.println(entry.getKey() + ": " - + entry.getValue().getProvisioningPackageName()); - } - pw.decreaseIndent(); - pw.println(); + pw.println("mConfigs:"); + pw.increaseIndent(); + for (Entry<ParcelUuid, VcnConfig> entry : mConfigs.entrySet()) { + pw.println( + entry.getKey() + + ": " + + entry.getValue().getProvisioningPackageName()); + } + pw.decreaseIndent(); + pw.println(); - pw.println("mVcns:"); - pw.increaseIndent(); - for (Vcn vcn : mVcns.values()) { - vcn.dump(pw); - } - pw.decreaseIndent(); - pw.println(); - } + pw.println("mVcns:"); + pw.increaseIndent(); + for (Vcn vcn : mVcns.values()) { + vcn.dump(pw); + } + pw.decreaseIndent(); + pw.println(); + } - pw.println("Local log:"); - pw.increaseIndent(); - LOCAL_LOG.dump(pw); - pw.decreaseIndent(); - pw.println(); - }, DUMP_TIMEOUT_MILLIS); + pw.println("Local log:"); + pw.increaseIndent(); + LOCAL_LOG.dump(pw); + pw.decreaseIndent(); + pw.println(); + }, + DUMP_TIMEOUT_MILLIS); } // TODO(b/180452282): Make name more generic and implement directly with VcnManagementService diff --git a/services/core/java/com/android/server/vcn/TelephonySubscriptionTracker.java b/packages/Vcn/service-b/src/com/android/server/vcn/TelephonySubscriptionTracker.java index 154897eecee4..b448f7595b3b 100644 --- a/services/core/java/com/android/server/vcn/TelephonySubscriptionTracker.java +++ b/packages/Vcn/service-b/src/com/android/server/vcn/TelephonySubscriptionTracker.java @@ -29,7 +29,6 @@ import android.content.IntentFilter; import android.net.vcn.VcnManager; import android.net.vcn.util.PersistableBundleUtils.PersistableBundleWrapper; import android.os.Handler; -import android.os.HandlerExecutor; import android.os.ParcelUuid; import android.os.PersistableBundle; import android.telephony.CarrierConfigManager; @@ -46,6 +45,7 @@ import android.util.Slog; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.annotations.VisibleForTesting.Visibility; +import com.android.modules.utils.HandlerExecutor; import java.util.ArrayList; import java.util.Collections; diff --git a/services/core/java/com/android/server/vcn/Vcn.java b/packages/Vcn/service-b/src/com/android/server/vcn/Vcn.java index 95acb107fd05..2524d0eedac3 100644 --- a/services/core/java/com/android/server/vcn/Vcn.java +++ b/packages/Vcn/service-b/src/com/android/server/vcn/Vcn.java @@ -40,7 +40,6 @@ import android.net.vcn.VcnGatewayConnectionConfig; import android.net.vcn.VcnManager.VcnErrorCode; import android.net.vcn.util.LogUtils; import android.os.Handler; -import android.os.HandlerExecutor; import android.os.Message; import android.os.ParcelUuid; import android.provider.Settings; @@ -53,6 +52,7 @@ import android.util.Slog; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.annotations.VisibleForTesting.Visibility; +import com.android.modules.utils.HandlerExecutor; import com.android.server.VcnManagementService.VcnCallback; import com.android.server.vcn.TelephonySubscriptionTracker.TelephonySubscriptionSnapshot; diff --git a/services/core/java/com/android/server/vcn/VcnContext.java b/packages/Vcn/service-b/src/com/android/server/vcn/VcnContext.java index 9213d96ad4ca..9213d96ad4ca 100644 --- a/services/core/java/com/android/server/vcn/VcnContext.java +++ b/packages/Vcn/service-b/src/com/android/server/vcn/VcnContext.java diff --git a/services/core/java/com/android/server/vcn/VcnGatewayConnection.java b/packages/Vcn/service-b/src/com/android/server/vcn/VcnGatewayConnection.java index 77bda9dc6b14..e50fc3a6e8b9 100644 --- a/services/core/java/com/android/server/vcn/VcnGatewayConnection.java +++ b/packages/Vcn/service-b/src/com/android/server/vcn/VcnGatewayConnection.java @@ -45,6 +45,7 @@ import android.net.InetAddresses; import android.net.IpPrefix; import android.net.IpSecManager; import android.net.IpSecManager.IpSecTunnelInterface; +import android.net.IpSecManager.PolicyDirection; import android.net.IpSecManager.ResourceUnavailableException; import android.net.IpSecTransform; import android.net.LinkAddress; @@ -59,7 +60,6 @@ import android.net.NetworkScore; import android.net.RouteInfo; import android.net.TelephonyNetworkSpecifier; import android.net.Uri; -import android.net.annotations.PolicyDirection; import android.net.ipsec.ike.ChildSaProposal; import android.net.ipsec.ike.ChildSessionCallback; import android.net.ipsec.ike.ChildSessionConfiguration; @@ -83,7 +83,6 @@ import android.net.vcn.util.MtuUtils; import android.net.vcn.util.OneWayBoolean; import android.net.wifi.WifiInfo; import android.os.Handler; -import android.os.HandlerExecutor; import android.os.Message; import android.os.ParcelUuid; import android.os.PowerManager; @@ -101,6 +100,7 @@ import com.android.internal.annotations.VisibleForTesting.Visibility; import com.android.internal.util.State; import com.android.internal.util.StateMachine; import com.android.internal.util.WakeupMessage; +import com.android.modules.utils.HandlerExecutor; import com.android.server.vcn.TelephonySubscriptionTracker.TelephonySubscriptionSnapshot; import com.android.server.vcn.Vcn.VcnGatewayStatusCallback; import com.android.server.vcn.routeselection.UnderlyingNetworkController; diff --git a/services/core/java/com/android/server/vcn/VcnNetworkProvider.java b/packages/Vcn/service-b/src/com/android/server/vcn/VcnNetworkProvider.java index 78ff432f5423..4552f509b59a 100644 --- a/services/core/java/com/android/server/vcn/VcnNetworkProvider.java +++ b/packages/Vcn/service-b/src/com/android/server/vcn/VcnNetworkProvider.java @@ -33,7 +33,6 @@ import android.net.NetworkRequest; import android.net.NetworkScore; import android.net.vcn.VcnGatewayConnectionConfig; import android.os.Handler; -import android.os.HandlerExecutor; import android.os.Looper; import android.util.ArraySet; import android.util.IndentingPrintWriter; @@ -41,6 +40,7 @@ import android.util.Slog; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.annotations.VisibleForTesting.Visibility; +import com.android.modules.utils.HandlerExecutor; import java.util.Objects; import java.util.Set; diff --git a/services/core/java/com/android/server/vcn/routeselection/IpSecPacketLossDetector.java b/packages/Vcn/service-b/src/com/android/server/vcn/routeselection/IpSecPacketLossDetector.java index e6a1ff967508..72de61363d26 100644 --- a/services/core/java/com/android/server/vcn/routeselection/IpSecPacketLossDetector.java +++ b/packages/Vcn/service-b/src/com/android/server/vcn/routeselection/IpSecPacketLossDetector.java @@ -32,12 +32,12 @@ import android.net.IpSecTransformState; import android.net.Network; import android.net.vcn.VcnManager; import android.os.Handler; -import android.os.HandlerExecutor; import android.os.OutcomeReceiver; import android.os.PowerManager; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.annotations.VisibleForTesting.Visibility; +import com.android.modules.utils.HandlerExecutor; import com.android.server.vcn.VcnContext; import java.lang.annotation.ElementType; diff --git a/services/core/java/com/android/server/vcn/routeselection/NetworkMetricMonitor.java b/packages/Vcn/service-b/src/com/android/server/vcn/routeselection/NetworkMetricMonitor.java index 86cee554be6f..86cee554be6f 100644 --- a/services/core/java/com/android/server/vcn/routeselection/NetworkMetricMonitor.java +++ b/packages/Vcn/service-b/src/com/android/server/vcn/routeselection/NetworkMetricMonitor.java diff --git a/services/core/java/com/android/server/vcn/routeselection/NetworkPriorityClassifier.java b/packages/Vcn/service-b/src/com/android/server/vcn/routeselection/NetworkPriorityClassifier.java index 79c4116d0cd4..79c4116d0cd4 100644 --- a/services/core/java/com/android/server/vcn/routeselection/NetworkPriorityClassifier.java +++ b/packages/Vcn/service-b/src/com/android/server/vcn/routeselection/NetworkPriorityClassifier.java diff --git a/services/core/java/com/android/server/vcn/routeselection/UnderlyingNetworkController.java b/packages/Vcn/service-b/src/com/android/server/vcn/routeselection/UnderlyingNetworkController.java index f7a564ad5281..29a0762f5fe8 100644 --- a/services/core/java/com/android/server/vcn/routeselection/UnderlyingNetworkController.java +++ b/packages/Vcn/service-b/src/com/android/server/vcn/routeselection/UnderlyingNetworkController.java @@ -41,7 +41,6 @@ import android.net.vcn.VcnGatewayConnectionConfig; import android.net.vcn.VcnUnderlyingNetworkTemplate; import android.net.vcn.util.LogUtils; import android.os.Handler; -import android.os.HandlerExecutor; import android.os.ParcelUuid; import android.telephony.TelephonyCallback; import android.telephony.TelephonyManager; @@ -52,6 +51,7 @@ import android.util.Slog; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.annotations.VisibleForTesting.Visibility; +import com.android.modules.utils.HandlerExecutor; import com.android.server.vcn.TelephonySubscriptionTracker.TelephonySubscriptionSnapshot; import com.android.server.vcn.VcnContext; import com.android.server.vcn.routeselection.UnderlyingNetworkEvaluator.NetworkEvaluatorCallback; diff --git a/services/core/java/com/android/server/vcn/routeselection/UnderlyingNetworkEvaluator.java b/packages/Vcn/service-b/src/com/android/server/vcn/routeselection/UnderlyingNetworkEvaluator.java index 30f4ed1b9f0b..30f4ed1b9f0b 100644 --- a/services/core/java/com/android/server/vcn/routeselection/UnderlyingNetworkEvaluator.java +++ b/packages/Vcn/service-b/src/com/android/server/vcn/routeselection/UnderlyingNetworkEvaluator.java diff --git a/services/core/java/com/android/server/vcn/routeselection/UnderlyingNetworkRecord.java b/packages/Vcn/service-b/src/com/android/server/vcn/routeselection/UnderlyingNetworkRecord.java index 1945052b92df..1945052b92df 100644 --- a/services/core/java/com/android/server/vcn/routeselection/UnderlyingNetworkRecord.java +++ b/packages/Vcn/service-b/src/com/android/server/vcn/routeselection/UnderlyingNetworkRecord.java diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java index 0152f94072f4..3cac3a8e44ed 100644 --- a/services/core/java/com/android/server/am/ActivityManagerService.java +++ b/services/core/java/com/android/server/am/ActivityManagerService.java @@ -2861,9 +2861,7 @@ public class ActivityManagerService extends IActivityManager.Stub mIsolatedAppBindArgs = new ArrayMap<>(1); // See b/79378449 about the following exemption. addServiceToMap(mIsolatedAppBindArgs, "package"); - if (!android.server.Flags.removeJavaServiceManagerCache()) { - addServiceToMap(mIsolatedAppBindArgs, "permissionmgr"); - } + addServiceToMap(mIsolatedAppBindArgs, "permissionmgr"); } return mIsolatedAppBindArgs; } @@ -2874,38 +2872,27 @@ public class ActivityManagerService extends IActivityManager.Stub // Add common services. // IMPORTANT: Before adding services here, make sure ephemeral apps can access them too. // Enable the check in ApplicationThread.bindApplication() to make sure. - - // Removing User Service and App Ops Service from cache breaks boot for auto. - // Removing permissionmgr breaks tests for Android Auto due to SELinux restrictions. - // TODO: fix SELinux restrictions and remove caching for Android Auto. - if (mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_AUTOMOTIVE) - || !android.server.Flags.removeJavaServiceManagerCache()) { - addServiceToMap(mAppBindArgs, Context.ALARM_SERVICE); - addServiceToMap(mAppBindArgs, Context.DISPLAY_SERVICE); - addServiceToMap(mAppBindArgs, Context.NETWORKMANAGEMENT_SERVICE); - addServiceToMap(mAppBindArgs, Context.CONNECTIVITY_SERVICE); - addServiceToMap(mAppBindArgs, Context.ACCESSIBILITY_SERVICE); - addServiceToMap(mAppBindArgs, Context.INPUT_METHOD_SERVICE); - addServiceToMap(mAppBindArgs, Context.INPUT_SERVICE); - addServiceToMap(mAppBindArgs, "graphicsstats"); - addServiceToMap(mAppBindArgs, "content"); - addServiceToMap(mAppBindArgs, Context.JOB_SCHEDULER_SERVICE); - addServiceToMap(mAppBindArgs, Context.NOTIFICATION_SERVICE); - addServiceToMap(mAppBindArgs, Context.VIBRATOR_SERVICE); - addServiceToMap(mAppBindArgs, Context.ACCOUNT_SERVICE); - addServiceToMap(mAppBindArgs, Context.POWER_SERVICE); - addServiceToMap(mAppBindArgs, "mount"); - addServiceToMap(mAppBindArgs, Context.PLATFORM_COMPAT_SERVICE); - } - // See b/79378449 - // Getting the window service and package service binder from servicemanager - // is blocked for Apps. However they are necessary for apps. - // TODO: remove exception addServiceToMap(mAppBindArgs, "package"); - addServiceToMap(mAppBindArgs, Context.WINDOW_SERVICE); - addServiceToMap(mAppBindArgs, Context.USER_SERVICE); addServiceToMap(mAppBindArgs, "permissionmgr"); + addServiceToMap(mAppBindArgs, Context.WINDOW_SERVICE); + addServiceToMap(mAppBindArgs, Context.ALARM_SERVICE); + addServiceToMap(mAppBindArgs, Context.DISPLAY_SERVICE); + addServiceToMap(mAppBindArgs, Context.NETWORKMANAGEMENT_SERVICE); + addServiceToMap(mAppBindArgs, Context.CONNECTIVITY_SERVICE); + addServiceToMap(mAppBindArgs, Context.ACCESSIBILITY_SERVICE); + addServiceToMap(mAppBindArgs, Context.INPUT_METHOD_SERVICE); + addServiceToMap(mAppBindArgs, Context.INPUT_SERVICE); + addServiceToMap(mAppBindArgs, "graphicsstats"); addServiceToMap(mAppBindArgs, Context.APP_OPS_SERVICE); + addServiceToMap(mAppBindArgs, "content"); + addServiceToMap(mAppBindArgs, Context.JOB_SCHEDULER_SERVICE); + addServiceToMap(mAppBindArgs, Context.NOTIFICATION_SERVICE); + addServiceToMap(mAppBindArgs, Context.VIBRATOR_SERVICE); + addServiceToMap(mAppBindArgs, Context.ACCOUNT_SERVICE); + addServiceToMap(mAppBindArgs, Context.POWER_SERVICE); + addServiceToMap(mAppBindArgs, Context.USER_SERVICE); + addServiceToMap(mAppBindArgs, "mount"); + addServiceToMap(mAppBindArgs, Context.PLATFORM_COMPAT_SERVICE); } return mAppBindArgs; } diff --git a/services/core/java/com/android/server/am/SettingsToPropertiesMapper.java b/services/core/java/com/android/server/am/SettingsToPropertiesMapper.java index f79256d6147b..c4a787db6922 100644 --- a/services/core/java/com/android/server/am/SettingsToPropertiesMapper.java +++ b/services/core/java/com/android/server/am/SettingsToPropertiesMapper.java @@ -39,6 +39,7 @@ import android.aconfigd.Aconfigd.StorageRequestMessages; import android.aconfigd.Aconfigd.StorageReturnMessage; import android.aconfigd.Aconfigd.StorageReturnMessages; import static com.android.aconfig_new_storage.Flags.enableAconfigStorageDaemon; +import static com.android.aconfig_new_storage.Flags.enableAconfigdFromMainline; import java.io.DataInputStream; import java.io.DataOutputStream; @@ -388,16 +389,38 @@ public class SettingsToPropertiesMapper { * @param requests: request proto output stream * @return aconfigd socket return as proto input stream */ - static ProtoInputStream sendAconfigdRequests(ProtoOutputStream requests) { + static void sendAconfigdRequests(ProtoOutputStream requests) { + ProtoInputStream returns = sendAconfigdRequests("aconfigd_system", requests); + try { + parseAndLogAconfigdReturn(returns); + } catch (IOException ioe) { + logErr("failed to parse aconfigd return", ioe); + } + if (enableAconfigdFromMainline()) { + returns = sendAconfigdRequests("aconfigd_mainline", requests); + try { + parseAndLogAconfigdReturn(returns); + } catch (IOException ioe) { + logErr("failed to parse aconfigd return", ioe); + } + } + } + + /** + * apply flag local override in aconfig new storage + * @param socketName: the socket to send to + * @param requests: request proto output stream + * @return aconfigd socket return as proto input stream + */ + static ProtoInputStream sendAconfigdRequests(String socketName, ProtoOutputStream requests) { // connect to aconfigd socket LocalSocket client = new LocalSocket(); - String socketName = "aconfigd_system"; try { client.connect(new LocalSocketAddress( socketName, LocalSocketAddress.Namespace.RESERVED)); - Slog.d(TAG, "connected to aconfigd socket"); + Slog.d(TAG, "connected to " + socketName + " socket"); } catch (IOException ioe) { - logErr("failed to connect to aconfigd socket", ioe); + logErr("failed to connect to " + socketName + " socket", ioe); return null; } @@ -416,9 +439,9 @@ public class SettingsToPropertiesMapper { byte[] requests_bytes = requests.getBytes(); outputStream.writeInt(requests_bytes.length); outputStream.write(requests_bytes, 0, requests_bytes.length); - Slog.d(TAG, "flag override requests sent to aconfigd"); + Slog.d(TAG, "flag override requests sent to " + socketName); } catch (IOException ioe) { - logErr("failed to send requests to aconfigd", ioe); + logErr("failed to send requests to " + socketName, ioe); return null; } @@ -426,10 +449,10 @@ public class SettingsToPropertiesMapper { try { int num_bytes = inputStream.readInt(); ProtoInputStream returns = new ProtoInputStream(inputStream); - Slog.d(TAG, "received " + num_bytes + " bytes back from aconfigd"); + Slog.d(TAG, "received " + num_bytes + " bytes back from " + socketName); return returns; } catch (IOException ioe) { - logErr("failed to read requests return from aconfigd", ioe); + logErr("failed to read requests return from " + socketName, ioe); return null; } } @@ -524,15 +547,8 @@ public class SettingsToPropertiesMapper { return; } - // send requests to aconfigd and obtain the return byte buffer - ProtoInputStream returns = sendAconfigdRequests(requests); - - // deserialize back using proto input stream - try { - parseAndLogAconfigdReturn(returns); - } catch (IOException ioe) { - logErr("failed to parse aconfigd return", ioe); - } + // send requests to aconfigd + sendAconfigdRequests(requests); } public static SettingsToPropertiesMapper start(ContentResolver contentResolver) { @@ -642,15 +658,8 @@ public class SettingsToPropertiesMapper { return; } - // send requests to aconfigd and obtain the return - ProtoInputStream returns = sendAconfigdRequests(requests); - - // deserialize back using proto input stream - try { - parseAndLogAconfigdReturn(returns); - } catch (IOException ioe) { - logErr("failed to parse aconfigd return", ioe); - } + // send requests to aconfigd + sendAconfigdRequests(requests); } /** diff --git a/services/core/java/com/android/server/policy/EventLogTags.logtags b/services/core/java/com/android/server/policy/EventLogTags.logtags index 75633820d01f..a4b6472fbe62 100644 --- a/services/core/java/com/android/server/policy/EventLogTags.logtags +++ b/services/core/java/com/android/server/policy/EventLogTags.logtags @@ -1,4 +1,4 @@ -# See system/core/logcat/event.logtags for a description of the format of this file. +# See system/logging/logcat/event.logtags for a description of the format of this file. option java_package com.android.server.policy diff --git a/services/core/java/com/android/server/vcn/TEST_MAPPING b/services/core/java/com/android/server/vcn/TEST_MAPPING deleted file mode 100644 index 5b04d884fc1a..000000000000 --- a/services/core/java/com/android/server/vcn/TEST_MAPPING +++ /dev/null @@ -1,10 +0,0 @@ -{ - "presubmit": [ - { - "name": "FrameworksVcnTests" - }, - { - "name": "CtsVcnTestCases" - } - ] -}
\ No newline at end of file diff --git a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java index cfd5300417b4..66ed0dae53f5 100644 --- a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java +++ b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java @@ -1535,7 +1535,8 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { final ActivityRecord[] outActivity = new ActivityRecord[1]; - getActivityStartController().obtainStarter(intent, "dream") + final int res = getActivityStartController() + .obtainStarter(intent, "dream") .setCallingUid(callingUid) .setCallingPid(callingPid) .setCallingPackage(intent.getPackage()) @@ -1549,9 +1550,11 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { .execute(); final ActivityRecord started = outActivity[0]; - final IAppTask appTask = started == null ? null : - new AppTaskImpl(this, started.getTask().mTaskId, callingUid); - return appTask; + if (started == null || !ActivityManager.isStartResultSuccessful(res)) { + // start the dream activity failed. + return null; + } + return new AppTaskImpl(this, started.getTask().mTaskId, callingUid); } } diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java index 688312e7e004..0718f043ae2a 100644 --- a/services/java/com/android/server/SystemServer.java +++ b/services/java/com/android/server/SystemServer.java @@ -411,6 +411,8 @@ public final class SystemServer implements Dumpable { "/apex/com.android.tethering/javalib/service-connectivity.jar"; private static final String CONNECTIVITY_SERVICE_INITIALIZER_CLASS = "com.android.server.ConnectivityServiceInitializer"; + private static final String CONNECTIVITY_SERVICE_INITIALIZER_B_CLASS = + "com.android.server.ConnectivityServiceInitializerB"; private static final String NETWORK_STATS_SERVICE_INITIALIZER_CLASS = "com.android.server.NetworkStatsServiceInitializer"; private static final String UWB_APEX_SERVICE_JAR_PATH = @@ -1447,7 +1449,6 @@ public final class SystemServer implements Dumpable { IStorageManager storageManager = null; NetworkManagementService networkManagement = null; VpnManagerService vpnManager = null; - VcnManagementService vcnManagement = null; NetworkPolicyManagerService networkPolicy = null; WindowManagerService wm = null; NetworkTimeUpdateService networkTimeUpdater = null; @@ -2145,8 +2146,10 @@ public final class SystemServer implements Dumpable { t.traceBegin("StartVcnManagementService"); try { - vcnManagement = VcnManagementService.create(context); - ServiceManager.addService(Context.VCN_MANAGEMENT_SERVICE, vcnManagement); + // TODO: b/375213246 When VCN is in mainline module, load it from the apex path. + // Whether VCN will be in apex or in the platform will be gated by a build system + // flag. + mSystemServiceManager.startService(CONNECTIVITY_SERVICE_INITIALIZER_B_CLASS); } catch (Throwable e) { reportWtf("starting VCN Management Service", e); } @@ -3038,7 +3041,6 @@ public final class SystemServer implements Dumpable { final MediaRouterService mediaRouterF = mediaRouter; final MmsServiceBroker mmsServiceF = mmsService; final VpnManagerService vpnManagerF = vpnManager; - final VcnManagementService vcnManagementF = vcnManagement; final WindowManagerService windowManagerF = wm; final ConnectivityManager connectivityF = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); @@ -3165,15 +3167,6 @@ public final class SystemServer implements Dumpable { reportWtf("making VpnManagerService ready", e); } t.traceEnd(); - t.traceBegin("MakeVcnManagementServiceReady"); - try { - if (vcnManagementF != null) { - vcnManagementF.systemReady(); - } - } catch (Throwable e) { - reportWtf("making VcnManagementService ready", e); - } - t.traceEnd(); t.traceBegin("MakeNetworkPolicyServiceReady"); try { if (networkPolicyF != null) { diff --git a/services/java/com/android/server/flags.aconfig b/services/java/com/android/server/flags.aconfig index 41a9646cb6d5..38354e849129 100644 --- a/services/java/com/android/server/flags.aconfig +++ b/services/java/com/android/server/flags.aconfig @@ -10,14 +10,6 @@ flag { } flag { - name: "remove_java_service_manager_cache" - namespace: "system_performance" - description: "This flag turns off Java's Service Manager caching mechanism." - bug: "333854840" - is_fixed_read_only: true -} - -flag { name: "remove_text_service" namespace: "wear_frameworks" description: "Remove TextServiceManagerService on Wear" diff --git a/services/tests/ondeviceintelligencetests/OWNERS b/services/tests/ondeviceintelligencetests/OWNERS index 09774f78d712..a4fc7582a785 100644 --- a/services/tests/ondeviceintelligencetests/OWNERS +++ b/services/tests/ondeviceintelligencetests/OWNERS @@ -1 +1,3 @@ -file:/core/java/android/app/ondeviceintelligence/OWNERS +shiqing@google.com +sandeepbandaru@google.com +shivanker@google.com diff --git a/tests/vcn/Android.bp b/tests/vcn/Android.bp index b16ba15a6867..51a300bff7ea 100644 --- a/tests/vcn/Android.bp +++ b/tests/vcn/Android.bp @@ -14,21 +14,24 @@ package { android_test { name: "FrameworksVcnTests", + // For access hidden connectivity methods in tests + defaults: ["framework-connectivity-test-defaults"], srcs: [ "java/**/*.java", "java/**/*.kt", ], platform_apis: true, - defaults: ["framework-connectivity-test-defaults"], test_suites: ["device-tests"], certificate: "platform", static_libs: [ + "android.net.vcn.flags-aconfig-java-export", "androidx.test.rules", "frameworks-base-testutils", "framework-protos", "mockito-target-minus-junit4", "net-tests-utils", "platform-test-annotations", + "service-connectivity-b-pre-jarjar", "services.core", "service-connectivity-tiramisu-pre-jarjar", "flag-junit", diff --git a/tests/vcn/java/com/android/server/vcn/TelephonySubscriptionTrackerTest.java b/tests/vcn/java/com/android/server/vcn/TelephonySubscriptionTrackerTest.java index b999475cba38..77f82f0d8cf4 100644 --- a/tests/vcn/java/com/android/server/vcn/TelephonySubscriptionTrackerTest.java +++ b/tests/vcn/java/com/android/server/vcn/TelephonySubscriptionTrackerTest.java @@ -55,7 +55,6 @@ import android.content.Intent; import android.content.IntentFilter; import android.net.vcn.VcnManager; import android.os.Handler; -import android.os.HandlerExecutor; import android.os.ParcelUuid; import android.os.PersistableBundle; import android.os.test.TestLooper; @@ -72,6 +71,8 @@ import android.util.ArraySet; import androidx.test.filters.SmallTest; import androidx.test.runner.AndroidJUnit4; +import com.android.modules.utils.HandlerExecutor; + import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; |