diff options
44 files changed, 724 insertions, 214 deletions
diff --git a/Android.bp b/Android.bp index 00b419897f34..fc713ff25e54 100644 --- a/Android.bp +++ b/Android.bp @@ -433,11 +433,8 @@ filegroup { "core/java/android/util/LocalLog.java", "core/java/com/android/internal/util/HexDump.java", "core/java/com/android/internal/util/IndentingPrintWriter.java", - "core/java/com/android/internal/util/IState.java", "core/java/com/android/internal/util/MessageUtils.java", "core/java/com/android/internal/util/RingBufferIndices.java", - "core/java/com/android/internal/util/State.java", - "core/java/com/android/internal/util/StateMachine.java", "core/java/com/android/internal/util/WakeupMessage.java", "core/java/com/android/internal/util/TokenBucket.java", ], diff --git a/config/README.md b/config/README.md new file mode 100644 index 000000000000..450a5c695c82 --- /dev/null +++ b/config/README.md @@ -0,0 +1,13 @@ +# Configuration files for ART compiling the framework + +* boot-image-profile.txt: A list of methods from the boot classpath to be compiled by dex2oat. + The order in the file is not relevant. +* boot-profile.txt: An ordered list of methods from the boot classpath to be compiled by + the JIT in the order provided in the file. Used by JIT zygote, when on-device + signing failed. +* dirty-image-objects: List of objects in the boot image which are known to + become dirty. This helps binning objects in the image file. +* preloaded-classes: classes that will be allocated in the boot image, and + initialized by the zygote. +* preloaded-classes-denylist: Classes that should not be initialized in the + zygote, as they have app-specific behavior. diff --git a/core/api/current.txt b/core/api/current.txt index 641f71be8e40..f21518c7f83d 100644 --- a/core/api/current.txt +++ b/core/api/current.txt @@ -31467,6 +31467,7 @@ package android.os { method public float readFloat(); method public void readFloatArray(@NonNull float[]); method @Nullable public java.util.HashMap readHashMap(@Nullable ClassLoader); + method @Nullable public <K, V> java.util.HashMap<K,V> readHashMap(@Nullable ClassLoader, @NonNull Class<? extends K>, @NonNull Class<? extends V>); method public int readInt(); method public void readIntArray(@NonNull int[]); method public <T extends android.os.IInterface> void readInterfaceArray(@NonNull T[], @NonNull java.util.function.Function<android.os.IBinder,T>); @@ -31476,6 +31477,7 @@ package android.os { method public long readLong(); method public void readLongArray(@NonNull long[]); method public void readMap(@NonNull java.util.Map, @Nullable ClassLoader); + method public <K, V> void readMap(@NonNull java.util.Map<? super K,? super V>, @Nullable ClassLoader, @NonNull Class<K>, @NonNull Class<V>); method @Nullable public <T extends android.os.Parcelable> T readParcelable(@Nullable ClassLoader); method @Nullable public <T extends android.os.Parcelable> T readParcelable(@Nullable ClassLoader, @NonNull Class<T>); method @Nullable public android.os.Parcelable[] readParcelableArray(@Nullable ClassLoader); @@ -40702,6 +40704,7 @@ package android.telephony { method @NonNull public java.util.List<java.lang.Integer> getBands(); method @NonNull public java.util.List<java.lang.String> getMccMncs(); method public int getPriority(); + method @NonNull public java.util.List<android.telephony.RadioAccessSpecifier> getRadioAccessSpecifiers(); method public int getSubId(); method public void writeToParcel(android.os.Parcel, int); field @NonNull public static final android.os.Parcelable.Creator<android.telephony.AvailableNetworkInfo> CREATOR; @@ -40710,6 +40713,14 @@ package android.telephony { field public static final int PRIORITY_MED = 2; // 0x2 } + public static final class AvailableNetworkInfo.Builder { + ctor public AvailableNetworkInfo.Builder(int); + method @NonNull public android.telephony.AvailableNetworkInfo build(); + method @NonNull public android.telephony.AvailableNetworkInfo.Builder setMccMncs(@NonNull java.util.List<java.lang.String>); + method @NonNull public android.telephony.AvailableNetworkInfo.Builder setPriority(int); + method @NonNull public android.telephony.AvailableNetworkInfo.Builder setRadioAccessSpecifiers(@NonNull java.util.List<android.telephony.RadioAccessSpecifier>); + } + public final class BarringInfo implements android.os.Parcelable { method public int describeContents(); method @NonNull public android.telephony.BarringInfo.BarringServiceInfo getBarringServiceInfo(int); @@ -40818,6 +40829,7 @@ package android.telephony { field public static final String KEY_CARRIER_RCS_PROVISIONING_REQUIRED_BOOL = "carrier_rcs_provisioning_required_bool"; field public static final String KEY_CARRIER_SETTINGS_ACTIVITY_COMPONENT_NAME_STRING = "carrier_settings_activity_component_name_string"; field public static final String KEY_CARRIER_SETTINGS_ENABLE_BOOL = "carrier_settings_enable_bool"; + field public static final String KEY_CARRIER_SUPPORTS_OPP_DATA_AUTO_PROVISIONING_BOOL = "carrier_supports_opp_data_auto_provisioning_bool"; field public static final String KEY_CARRIER_SUPPORTS_SS_OVER_UT_BOOL = "carrier_supports_ss_over_ut_bool"; field public static final String KEY_CARRIER_USE_IMS_FIRST_FOR_EMERGENCY_BOOL = "carrier_use_ims_first_for_emergency_bool"; field public static final String KEY_CARRIER_USSD_METHOD_INT = "carrier_ussd_method_int"; @@ -40879,6 +40891,8 @@ package android.telephony { field public static final String KEY_ENABLE_DIALER_KEY_VIBRATION_BOOL = "enable_dialer_key_vibration_bool"; field public static final String KEY_ENHANCED_4G_LTE_ON_BY_DEFAULT_BOOL = "enhanced_4g_lte_on_by_default_bool"; field public static final String KEY_ENHANCED_4G_LTE_TITLE_VARIANT_INT = "enhanced_4g_lte_title_variant_int"; + field public static final String KEY_ESIM_DOWNLOAD_RETRY_BACKOFF_TIMER_SEC_INT = "esim_download_retry_backoff_timer_sec_int"; + field public static final String KEY_ESIM_MAX_DOWNLOAD_RETRY_ATTEMPTS_INT = "esim_max_download_retry_attempts_int"; field public static final String KEY_FORCE_HOME_NETWORK_BOOL = "force_home_network_bool"; field public static final String KEY_GSM_DTMF_TONE_DELAY_INT = "gsm_dtmf_tone_delay_int"; field public static final String KEY_GSM_NONROAMING_NETWORKS_STRING_ARRAY = "gsm_nonroaming_networks_string_array"; @@ -40981,6 +40995,7 @@ package android.telephony { field public static final String KEY_SHOW_WFC_LOCATION_PRIVACY_POLICY_BOOL = "show_wfc_location_privacy_policy_bool"; field public static final String KEY_SIMPLIFIED_NETWORK_SETTINGS_BOOL = "simplified_network_settings_bool"; field public static final String KEY_SIM_NETWORK_UNLOCK_ALLOW_DISMISS_BOOL = "sim_network_unlock_allow_dismiss_bool"; + field public static final String KEY_SMDP_SERVER_ADDRESS_STRING = "smdp_server_address_string"; field public static final String KEY_SMS_REQUIRES_DESTINATION_NUMBER_CONVERSION_BOOL = "sms_requires_destination_number_conversion_bool"; field public static final String KEY_SUPPORTS_CALL_COMPOSER_BOOL = "supports_call_composer_bool"; field public static final String KEY_SUPPORTS_DEVICE_TO_DEVICE_COMMUNICATION_USING_DTMF_BOOL = "supports_device_to_device_communication_using_dtmf_bool"; @@ -42753,7 +42768,7 @@ package android.telephony { method public boolean isEmergencyNumber(@NonNull String); method public boolean isHearingAidCompatibilitySupported(); method @RequiresPermission(anyOf={android.Manifest.permission.READ_PRECISE_PHONE_STATE, "android.permission.READ_PRIVILEGED_PHONE_STATE"}) public boolean isManualNetworkSelectionAllowed(); - method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public boolean isModemEnabledForSlot(int); + method @RequiresPermission(anyOf={android.Manifest.permission.READ_PHONE_STATE, "android.permission.READ_PRIVILEGED_PHONE_STATE"}) public boolean isModemEnabledForSlot(int); method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public int isMultiSimSupported(); method public boolean isNetworkRoaming(); method public boolean isRadioInterfaceCapabilitySupported(@NonNull String); @@ -47529,6 +47544,10 @@ package android.view { field public static final int KEYCODE_CUT = 277; // 0x115 field public static final int KEYCODE_D = 32; // 0x20 field public static final int KEYCODE_DEL = 67; // 0x43 + field public static final int KEYCODE_DEMO_APP_1 = 301; // 0x12d + field public static final int KEYCODE_DEMO_APP_2 = 302; // 0x12e + field public static final int KEYCODE_DEMO_APP_3 = 303; // 0x12f + field public static final int KEYCODE_DEMO_APP_4 = 304; // 0x130 field public static final int KEYCODE_DPAD_CENTER = 23; // 0x17 field public static final int KEYCODE_DPAD_DOWN = 20; // 0x14 field public static final int KEYCODE_DPAD_DOWN_LEFT = 269; // 0x10d @@ -47560,6 +47579,10 @@ package android.view { field public static final int KEYCODE_F7 = 137; // 0x89 field public static final int KEYCODE_F8 = 138; // 0x8a field public static final int KEYCODE_F9 = 139; // 0x8b + field public static final int KEYCODE_FEATURED_APP_1 = 297; // 0x129 + field public static final int KEYCODE_FEATURED_APP_2 = 298; // 0x12a + field public static final int KEYCODE_FEATURED_APP_3 = 299; // 0x12b + field public static final int KEYCODE_FEATURED_APP_4 = 300; // 0x12c field public static final int KEYCODE_FOCUS = 80; // 0x50 field public static final int KEYCODE_FORWARD = 125; // 0x7d field public static final int KEYCODE_FORWARD_DEL = 112; // 0x70 @@ -47725,6 +47748,14 @@ package android.view { field public static final int KEYCODE_U = 49; // 0x31 field public static final int KEYCODE_UNKNOWN = 0; // 0x0 field public static final int KEYCODE_V = 50; // 0x32 + field public static final int KEYCODE_VIDEO_APP_1 = 289; // 0x121 + field public static final int KEYCODE_VIDEO_APP_2 = 290; // 0x122 + field public static final int KEYCODE_VIDEO_APP_3 = 291; // 0x123 + field public static final int KEYCODE_VIDEO_APP_4 = 292; // 0x124 + field public static final int KEYCODE_VIDEO_APP_5 = 293; // 0x125 + field public static final int KEYCODE_VIDEO_APP_6 = 294; // 0x126 + field public static final int KEYCODE_VIDEO_APP_7 = 295; // 0x127 + field public static final int KEYCODE_VIDEO_APP_8 = 296; // 0x128 field public static final int KEYCODE_VOICE_ASSIST = 231; // 0xe7 field public static final int KEYCODE_VOLUME_DOWN = 25; // 0x19 field public static final int KEYCODE_VOLUME_MUTE = 164; // 0xa4 diff --git a/core/api/test-current.txt b/core/api/test-current.txt index 6ccdf9185517..d0e659bf36e9 100644 --- a/core/api/test-current.txt +++ b/core/api/test-current.txt @@ -2748,7 +2748,7 @@ package android.view { method public static String actionToString(int); method public final void setDisplayId(int); field public static final int FLAG_IS_ACCESSIBILITY_EVENT = 2048; // 0x800 - field public static final int LAST_KEYCODE = 288; // 0x120 + field public static final int LAST_KEYCODE = 304; // 0x130 } public final class KeyboardShortcutGroup implements android.os.Parcelable { diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java index d811040b6bb2..e781c2fce2b2 100644 --- a/core/java/android/content/Intent.java +++ b/core/java/android/content/Intent.java @@ -1147,6 +1147,10 @@ public class Intent implements Parcelable, Cloneable { * numbers. Applications can <strong>dial</strong> emergency numbers using * {@link #ACTION_DIAL}, however. * + * <p>Note: An app filling the {@link android.app.role.RoleManager#ROLE_DIALER} role should use + * {@link android.telecom.TelecomManager#placeCall(Uri, Bundle)} to place calls rather than + * relying on this intent. + * * <p>Note: if you app targets {@link android.os.Build.VERSION_CODES#M M} * and above and declares as using the {@link android.Manifest.permission#CALL_PHONE} * permission which is not granted, then attempting to use this action will diff --git a/core/java/android/net/IpSecAlgorithm.java b/core/java/android/net/IpSecAlgorithm.java index 7ef5bac092f6..86052484eaf6 100644 --- a/core/java/android/net/IpSecAlgorithm.java +++ b/core/java/android/net/IpSecAlgorithm.java @@ -232,11 +232,10 @@ public final class IpSecAlgorithm implements Parcelable { ALGO_TO_REQUIRED_FIRST_SDK.put(AUTH_HMAC_SHA512, SDK_VERSION_ZERO); ALGO_TO_REQUIRED_FIRST_SDK.put(AUTH_CRYPT_AES_GCM, SDK_VERSION_ZERO); - // STOPSHIP: b/170424293 Use Build.VERSION_CODES.S when it is defined - ALGO_TO_REQUIRED_FIRST_SDK.put(CRYPT_AES_CTR, Build.VERSION_CODES.R + 1); - ALGO_TO_REQUIRED_FIRST_SDK.put(AUTH_AES_XCBC, Build.VERSION_CODES.R + 1); - ALGO_TO_REQUIRED_FIRST_SDK.put(AUTH_AES_CMAC, Build.VERSION_CODES.R + 1); - ALGO_TO_REQUIRED_FIRST_SDK.put(AUTH_CRYPT_CHACHA20_POLY1305, Build.VERSION_CODES.R + 1); + ALGO_TO_REQUIRED_FIRST_SDK.put(CRYPT_AES_CTR, Build.VERSION_CODES.S); + ALGO_TO_REQUIRED_FIRST_SDK.put(AUTH_AES_XCBC, Build.VERSION_CODES.S); + ALGO_TO_REQUIRED_FIRST_SDK.put(AUTH_AES_CMAC, Build.VERSION_CODES.S); + ALGO_TO_REQUIRED_FIRST_SDK.put(AUTH_CRYPT_CHACHA20_POLY1305, Build.VERSION_CODES.S); } private static final Set<String> ENABLED_ALGOS = diff --git a/core/java/android/os/Parcel.java b/core/java/android/os/Parcel.java index 5a2f27d83893..09e5a8f7382c 100644 --- a/core/java/android/os/Parcel.java +++ b/core/java/android/os/Parcel.java @@ -2992,8 +2992,24 @@ public final class Parcel { * from the parcel at the current dataPosition(). */ public final void readMap(@NonNull Map outVal, @Nullable ClassLoader loader) { - int N = readInt(); - readMapInternal(outVal, N, loader); + int n = readInt(); + readMapInternal(outVal, n, loader, /* clazzKey */ null, /* clazzValue */ null); + } + + /** + * Same as {@link #readMap(Map, ClassLoader)} but accepts {@code clazzKey} and + * {@code clazzValue} parameter as the types required for each key and value pair. + * + * @throws BadParcelableException If the item to be deserialized is not an instance of that + * class or any of its children class + */ + public <K, V> void readMap(@NonNull Map<? super K, ? super V> outVal, + @Nullable ClassLoader loader, @NonNull Class<K> clazzKey, + @NonNull Class<V> clazzValue) { + Objects.requireNonNull(clazzKey); + Objects.requireNonNull(clazzValue); + int n = readInt(); + readMapInternal(outVal, n, loader, clazzKey, clazzValue); } /** @@ -3031,16 +3047,38 @@ public final class Parcel { @Nullable public final HashMap readHashMap(@Nullable ClassLoader loader) { - int N = readInt(); - if (N < 0) { + int n = readInt(); + if (n < 0) { return null; } - HashMap m = new HashMap(N); - readMapInternal(m, N, loader); + HashMap m = new HashMap(n); + readMapInternal(m, n, loader, /* clazzKey */ null, /* clazzValue */ null); return m; } /** + * Same as {@link #readHashMap(ClassLoader)} but accepts {@code clazzKey} and + * {@code clazzValue} parameter as the types required for each key and value pair. + * + * @throws BadParcelableException if the item to be deserialized is not an instance of that + * class or any of its children class + */ + @SuppressLint({"ConcreteCollection", "NullableCollection"}) + @Nullable + public <K, V> HashMap<K, V> readHashMap(@Nullable ClassLoader loader, + @NonNull Class<? extends K> clazzKey, @NonNull Class<? extends V> clazzValue) { + Objects.requireNonNull(clazzKey); + Objects.requireNonNull(clazzValue); + int n = readInt(); + if (n < 0) { + return null; + } + HashMap<K, V> map = new HashMap<>(n); + readMapInternal(map, n, loader, clazzKey, clazzValue); + return map; + } + + /** * Read and return a new Bundle object from the parcel at the current * dataPosition(). Returns null if the previously written Bundle object was * null. @@ -4472,13 +4510,23 @@ public final class Parcel { destroy(); } - /* package */ void readMapInternal(@NonNull Map outVal, int N, + /** + * To be replaced by {@link #readMapInternal(Map, int, ClassLoader, Class, Class)}, but keep + * the old API for compatibility usages. + */ + /* package */ void readMapInternal(@NonNull Map outVal, int n, @Nullable ClassLoader loader) { - while (N > 0) { - Object key = readValue(loader); - Object value = readValue(loader); + readMapInternal(outVal, n, loader, /* clazzKey */null, /* clazzValue */null); + } + + /* package */ <K, V> void readMapInternal(@NonNull Map<? super K, ? super V> outVal, int n, + @Nullable ClassLoader loader, @Nullable Class<K> clazzKey, + @Nullable Class<V> clazzValue) { + while (n > 0) { + K key = readValue(loader, clazzKey); + V value = readValue(loader, clazzValue); outVal.put(key, value); - N--; + n--; } } diff --git a/core/java/android/os/health/HealthStats.java b/core/java/android/os/health/HealthStats.java index 74ce5157a548..6c648f136183 100644 --- a/core/java/android/os/health/HealthStats.java +++ b/core/java/android/os/health/HealthStats.java @@ -32,7 +32,7 @@ import java.util.Map; * Each of the keys references data in one of five data types: * * <p> - * A <b>measurement</b> metric contains a sinlge {@code long} value. That value may + * A <b>measurement</b> metric contains a single {@code long} value. That value may * be a count, a time, or some other type of value. The unit for a measurement * (COUNT, MS, etc) will always be in the name of the constant for the key to * retrieve it. For example, the diff --git a/core/java/android/os/health/UidHealthStats.java b/core/java/android/os/health/UidHealthStats.java index afc9d78dcbd1..488a5422becc 100644 --- a/core/java/android/os/health/UidHealthStats.java +++ b/core/java/android/os/health/UidHealthStats.java @@ -43,14 +43,14 @@ public final class UidHealthStats { /** * How many milliseconds this statistics report covers in wall-clock time while the - * device was on battery including both screen-on and screen-off time. + * device was on battery including only screen-off time. */ @HealthKeys.Constant(type=HealthKeys.TYPE_MEASUREMENT) public static final int MEASUREMENT_REALTIME_SCREEN_OFF_BATTERY_MS = HealthKeys.BASE_UID + 3; /** * How many milliseconds this statistics report covers that the CPU was running while the - * device was on battery including both screen-on and screen-off time. + * device was on battery including only screen-off time. */ @HealthKeys.Constant(type=HealthKeys.TYPE_MEASUREMENT) public static final int MEASUREMENT_UPTIME_SCREEN_OFF_BATTERY_MS = HealthKeys.BASE_UID + 4; @@ -65,7 +65,7 @@ public final class UidHealthStats { /** * Key for a TimerStat for the times a - * {@link android.os.PowerManager#PARTIAL_WAKE_LOCK full wake lock} + * {@link android.os.PowerManager#PARTIAL_WAKE_LOCK partial wake lock} * was acquired for this uid. */ @HealthKeys.Constant(type=HealthKeys.TYPE_TIMERS) diff --git a/core/java/android/provider/DeviceConfig.java b/core/java/android/provider/DeviceConfig.java index 8ac5c0397734..6644f1e91f1d 100644 --- a/core/java/android/provider/DeviceConfig.java +++ b/core/java/android/provider/DeviceConfig.java @@ -622,6 +622,14 @@ public final class DeviceConfig { public static final String NAMESPACE_GAME_OVERLAY = "game_overlay"; /** + * Namespace for Android Virtualization Framework related features accessible by native code. + * + * @hide + */ + public static final String NAMESPACE_VIRTUALIZATION_FRAMEWORK_NATIVE = + "virtualization_framework_native"; + + /** * Namespace for Constrain Display APIs related features. * * @hide diff --git a/core/java/android/view/KeyEvent.java b/core/java/android/view/KeyEvent.java index cda9b233576c..ba6f4eb7e598 100644 --- a/core/java/android/view/KeyEvent.java +++ b/core/java/android/view/KeyEvent.java @@ -830,13 +830,45 @@ public class KeyEvent extends InputEvent implements Parcelable { * consuming content. May be consumed by system to set account globally. */ public static final int KEYCODE_PROFILE_SWITCH = 288; - - /** + /** Key code constant: Video Application key #1. */ + public static final int KEYCODE_VIDEO_APP_1 = 289; + /** Key code constant: Video Application key #2. */ + public static final int KEYCODE_VIDEO_APP_2 = 290; + /** Key code constant: Video Application key #3. */ + public static final int KEYCODE_VIDEO_APP_3 = 291; + /** Key code constant: Video Application key #4. */ + public static final int KEYCODE_VIDEO_APP_4 = 292; + /** Key code constant: Video Application key #5. */ + public static final int KEYCODE_VIDEO_APP_5 = 293; + /** Key code constant: Video Application key #6. */ + public static final int KEYCODE_VIDEO_APP_6 = 294; + /** Key code constant: Video Application key #7. */ + public static final int KEYCODE_VIDEO_APP_7 = 295; + /** Key code constant: Video Application key #8. */ + public static final int KEYCODE_VIDEO_APP_8 = 296; + /** Key code constant: Featured Application key #1. */ + public static final int KEYCODE_FEATURED_APP_1 = 297; + /** Key code constant: Featured Application key #2. */ + public static final int KEYCODE_FEATURED_APP_2 = 298; + /** Key code constant: Featured Application key #3. */ + public static final int KEYCODE_FEATURED_APP_3 = 299; + /** Key code constant: Featured Application key #4. */ + public static final int KEYCODE_FEATURED_APP_4 = 300; + /** Key code constant: Demo Application key #1. */ + public static final int KEYCODE_DEMO_APP_1 = 301; + /** Key code constant: Demo Application key #2. */ + public static final int KEYCODE_DEMO_APP_2 = 302; + /** Key code constant: Demo Application key #3. */ + public static final int KEYCODE_DEMO_APP_3 = 303; + /** Key code constant: Demo Application key #4. */ + public static final int KEYCODE_DEMO_APP_4 = 304; + + /** * Integer value of the last KEYCODE. Increases as new keycodes are added to KeyEvent. * @hide */ @TestApi - public static final int LAST_KEYCODE = KEYCODE_PROFILE_SWITCH; + public static final int LAST_KEYCODE = KEYCODE_DEMO_APP_4; // NOTE: If you add a new keycode here you must also add it to: // isSystem() diff --git a/core/java/android/view/SurfaceControl.java b/core/java/android/view/SurfaceControl.java index 8143cf953f19..ffce4617eec6 100644 --- a/core/java/android/view/SurfaceControl.java +++ b/core/java/android/view/SurfaceControl.java @@ -157,6 +157,7 @@ public final class SurfaceControl implements Parcelable { private static native boolean nativeGetAnimationFrameStats(WindowAnimationFrameStats outStats); private static native long[] nativeGetPhysicalDisplayIds(); + private static native long nativeGetPrimaryPhysicalDisplayId(); private static native IBinder nativeGetPhysicalDisplayToken(long physicalDisplayId); private static native IBinder nativeCreateDisplay(String name, boolean secure); private static native void nativeDestroyDisplay(IBinder displayToken); @@ -2266,6 +2267,15 @@ public final class SurfaceControl implements Parcelable { } /** + * Exposed to identify the correct display to apply the primary display orientation. Avoid using + * for any other purpose. + * @hide + */ + public static long getPrimaryPhysicalDisplayId() { + return nativeGetPrimaryPhysicalDisplayId(); + } + + /** * @hide */ public static IBinder getPhysicalDisplayToken(long physicalDisplayId) { diff --git a/core/java/com/android/internal/compat/OWNERS b/core/java/com/android/internal/compat/OWNERS index cfd0a4b079ad..ee3086ab2fdb 100644 --- a/core/java/com/android/internal/compat/OWNERS +++ b/core/java/com/android/internal/compat/OWNERS @@ -1,6 +1 @@ -# Use this reviewer by default. -platform-compat-eng+reviews@google.com - -andreionea@google.com -mathewi@google.com -satayev@google.com +include tools/platform-compat:/OWNERS diff --git a/core/jni/android_view_SurfaceControl.cpp b/core/jni/android_view_SurfaceControl.cpp index 8d12df226ffe..e47718305b7c 100644 --- a/core/jni/android_view_SurfaceControl.cpp +++ b/core/jni/android_view_SurfaceControl.cpp @@ -889,6 +889,12 @@ static jlongArray nativeGetPhysicalDisplayIds(JNIEnv* env, jclass clazz) { return array; } +static jlong nativeGetPrimaryPhysicalDisplayId(JNIEnv* env, jclass clazz) { + PhysicalDisplayId displayId; + SurfaceComposerClient::getPrimaryPhysicalDisplayId(&displayId); + return static_cast<jlong>(displayId.value); +} + static jobject nativeGetPhysicalDisplayToken(JNIEnv* env, jclass clazz, jlong physicalDisplayId) { sp<IBinder> token = SurfaceComposerClient::getPhysicalDisplayToken(PhysicalDisplayId(physicalDisplayId)); @@ -1879,6 +1885,8 @@ static const JNINativeMethod sSurfaceControlMethods[] = { (void*)nativeReleaseFrameRateFlexibilityToken }, {"nativeGetPhysicalDisplayIds", "()[J", (void*)nativeGetPhysicalDisplayIds }, + {"nativeGetPrimaryPhysicalDisplayId", "()J", + (void*)nativeGetPrimaryPhysicalDisplayId }, {"nativeGetPhysicalDisplayToken", "(J)Landroid/os/IBinder;", (void*)nativeGetPhysicalDisplayToken }, {"nativeCreateDisplay", "(Ljava/lang/String;Z)Landroid/os/IBinder;", diff --git a/core/jni/com_android_internal_content_NativeLibraryHelper.cpp b/core/jni/com_android_internal_content_NativeLibraryHelper.cpp index be82879c8411..ef6fd7dd6829 100644 --- a/core/jni/com_android_internal_content_NativeLibraryHelper.cpp +++ b/core/jni/com_android_internal_content_NativeLibraryHelper.cpp @@ -36,6 +36,7 @@ #include <inttypes.h> #include <sys/stat.h> #include <sys/types.h> +#include <linux/fs.h> #include <memory> @@ -253,6 +254,16 @@ copyFileIfChanged(JNIEnv *env, void* arg, ZipFileRO* zipFile, ZipEntryRO zipEntr return INSTALL_FAILED_CONTAINER_ERROR; } + // If a filesystem like f2fs supports per-file compression, set the compression bit before data + // writes + unsigned int flags; + if (ioctl(fd, FS_IOC_GETFLAGS, &flags) == -1) { + ALOGE("Failed to call FS_IOC_GETFLAGS on %s: %s\n", localTmpFileName, strerror(errno)); + } else if ((flags & FS_COMPR_FL) == 0) { + flags |= FS_COMPR_FL; + ioctl(fd, FS_IOC_SETFLAGS, &flags); + } + if (!zipFile->uncompressEntry(zipEntry, fd)) { ALOGE("Failed uncompressing %s to %s\n", fileName, localTmpFileName); close(fd); diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml index a5f505176d5d..dc92e10abf0d 100644 --- a/core/res/res/values/attrs.xml +++ b/core/res/res/values/attrs.xml @@ -1984,6 +1984,22 @@ <enum name="KEYCODE_THUMBS_UP" value="286" /> <enum name="KEYCODE_THUMBS_DOWN" value="287" /> <enum name="KEYCODE_PROFILE_SWITCH" value="288" /> + <enum name="KEYCODE_VIDEO_APP_1" value="289" /> + <enum name="KEYCODE_VIDEO_APP_2" value="290" /> + <enum name="KEYCODE_VIDEO_APP_3" value="291" /> + <enum name="KEYCODE_VIDEO_APP_4" value="292" /> + <enum name="KEYCODE_VIDEO_APP_5" value="293" /> + <enum name="KEYCODE_VIDEO_APP_6" value="294" /> + <enum name="KEYCODE_VIDEO_APP_7" value="295" /> + <enum name="KEYCODE_VIDEO_APP_8" value="296" /> + <enum name="KEYCODE_FEATURED_APP_1" value="297" /> + <enum name="KEYCODE_FEATURED_APP_2" value="298" /> + <enum name="KEYCODE_FEATURED_APP_3" value="299" /> + <enum name="KEYCODE_FEATURED_APP_4" value="300" /> + <enum name="KEYCODE_DEMO_APP_1" value="301" /> + <enum name="KEYCODE_DEMO_APP_2" value="302" /> + <enum name="KEYCODE_DEMO_APP_3" value="303" /> + <enum name="KEYCODE_DEMO_APP_4" value="304" /> </attr> <!-- ***************************************************************** --> diff --git a/core/tests/PlatformCompatFramework/OWNERS b/core/tests/PlatformCompatFramework/OWNERS index cfd0a4b079ad..ee3086ab2fdb 100644 --- a/core/tests/PlatformCompatFramework/OWNERS +++ b/core/tests/PlatformCompatFramework/OWNERS @@ -1,6 +1 @@ -# Use this reviewer by default. -platform-compat-eng+reviews@google.com - -andreionea@google.com -mathewi@google.com -satayev@google.com +include tools/platform-compat:/OWNERS diff --git a/data/etc/services.core.protolog.json b/data/etc/services.core.protolog.json index b67988ee9646..c94b3d5ce6b2 100644 --- a/data/etc/services.core.protolog.json +++ b/data/etc/services.core.protolog.json @@ -499,6 +499,12 @@ "group": "WM_DEBUG_STATES", "at": "com\/android\/server\/wm\/ActivityRecord.java" }, + "-1556507536": { + "message": "Passing transform hint %d for window %s%s", + "level": "VERBOSE", + "group": "WM_DEBUG_ORIENTATION", + "at": "com\/android\/server\/wm\/WindowManagerService.java" + }, "-1554521902": { "message": "showInsets(ime) was requested by different window: %s ", "level": "WARN", diff --git a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/deviceinfo/SimStatusImeiInfoPreferenceControllerTest.java b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/deviceinfo/SimStatusImeiInfoPreferenceControllerTest.java index 5252c6c82754..52d243a14e2f 100644 --- a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/deviceinfo/SimStatusImeiInfoPreferenceControllerTest.java +++ b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/deviceinfo/SimStatusImeiInfoPreferenceControllerTest.java @@ -20,9 +20,8 @@ import static com.google.common.truth.Truth.assertThat; import static org.robolectric.shadow.api.Shadow.extract; -import android.net.ConnectivityManager; import android.os.UserManager; -import android.util.SparseBooleanArray; +import android.telephony.TelephonyManager; import org.junit.Before; import org.junit.Test; @@ -35,7 +34,7 @@ import org.robolectric.annotation.Implements; @RunWith(RobolectricTestRunner.class) @Config(shadows = {SimStatusImeiInfoPreferenceControllerTest.ShadowUserManager.class, - SimStatusImeiInfoPreferenceControllerTest.ShadowConnectivityManager.class}) + SimStatusImeiInfoPreferenceControllerTest.ShadowTelephonyManager.class}) public class SimStatusImeiInfoPreferenceControllerTest { private AbstractSimStatusImeiInfoPreferenceController mController; @@ -56,9 +55,9 @@ public class SimStatusImeiInfoPreferenceControllerTest { ShadowUserManager userManager = extract(RuntimeEnvironment.application.getSystemService(UserManager.class)); userManager.setIsAdminUser(true); - ShadowConnectivityManager connectivityManager = - extract(RuntimeEnvironment.application.getSystemService(ConnectivityManager.class)); - connectivityManager.setNetworkSupported(ConnectivityManager.TYPE_MOBILE, true); + ShadowTelephonyManager telephonyManager = + extract(RuntimeEnvironment.application.getSystemService(TelephonyManager.class)); + telephonyManager.setDataCapable(true); assertThat(mController.isAvailable()).isTrue(); } @@ -68,9 +67,9 @@ public class SimStatusImeiInfoPreferenceControllerTest { ShadowUserManager userManager = extract(RuntimeEnvironment.application.getSystemService(UserManager.class)); userManager.setIsAdminUser(true); - ShadowConnectivityManager connectivityManager = - extract(RuntimeEnvironment.application.getSystemService(ConnectivityManager.class)); - connectivityManager.setNetworkSupported(ConnectivityManager.TYPE_MOBILE, false); + ShadowTelephonyManager telephonyManager = + extract(RuntimeEnvironment.application.getSystemService(TelephonyManager.class)); + telephonyManager.setDataCapable(false); assertThat(mController.isAvailable()).isFalse(); } @@ -99,19 +98,17 @@ public class SimStatusImeiInfoPreferenceControllerTest { } } - @Implements(ConnectivityManager.class) - public static class ShadowConnectivityManager - extends org.robolectric.shadows.ShadowConnectivityManager { - - private final SparseBooleanArray mSupportedNetworkTypes = new SparseBooleanArray(); - - private void setNetworkSupported(int networkType, boolean supported) { - mSupportedNetworkTypes.put(networkType, supported); + @Implements(TelephonyManager.class) + public static class ShadowTelephonyManager + extends org.robolectric.shadows.ShadowTelephonyManager { + private boolean mDataCapable = false; + private void setDataCapable(boolean capable) { + mDataCapable = capable; } @Implementation - public boolean isNetworkSupported(int networkType) { - return mSupportedNetworkTypes.get(networkType); + public boolean isDataCapable() { + return mDataCapable; } } } diff --git a/packages/SystemUI/OWNERS b/packages/SystemUI/OWNERS index ce23a8bc09ca..e1da74466b55 100644 --- a/packages/SystemUI/OWNERS +++ b/packages/SystemUI/OWNERS @@ -11,6 +11,7 @@ asc@google.com awickham@google.com beverlyt@google.com brockman@google.com +brycelee@google.com ccassidy@google.com cinek@google.com cwren@google.com @@ -71,4 +72,4 @@ zakcohen@google.com hseog@google.com #Android TV -rgl@google.com
\ No newline at end of file +rgl@google.com diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/AuthBiometricUdfpsView.java b/packages/SystemUI/src/com/android/systemui/biometrics/AuthBiometricUdfpsView.java index 376368fbf9d4..d80d9cc9d62d 100644 --- a/packages/SystemUI/src/com/android/systemui/biometrics/AuthBiometricUdfpsView.java +++ b/packages/SystemUI/src/com/android/systemui/biometrics/AuthBiometricUdfpsView.java @@ -21,12 +21,19 @@ import android.annotation.Nullable; import android.content.Context; import android.hardware.fingerprint.FingerprintSensorPropertiesInternal; import android.util.AttributeSet; +import android.util.Log; +import android.widget.FrameLayout; +import android.widget.TextView; + +import com.android.systemui.R; /** * Manages the layout for under-display fingerprint sensors (UDFPS). Ensures that UI elements * do not overlap with */ public class AuthBiometricUdfpsView extends AuthBiometricFingerprintView { + private static final String TAG = "AuthBiometricUdfpsView"; + @Nullable private UdfpsDialogMeasureAdapter mMeasureAdapter; public AuthBiometricUdfpsView(Context context) { @@ -51,4 +58,23 @@ public class AuthBiometricUdfpsView extends AuthBiometricFingerprintView { ? mMeasureAdapter.onMeasureInternal(width, height, layoutParams) : layoutParams; } + + @Override + void onLayoutInternal() { + super.onLayoutInternal(); + + // Move the UDFPS icon and indicator text if necessary. This probably only needs to happen + // for devices where the UDFPS sensor is too low. + // TODO(b/201510778): Update this logic to support cases where the sensor or text overlap + // the button bar area. + final int bottomSpacerHeight = mMeasureAdapter.getBottomSpacerHeight(); + Log.w(TAG, "bottomSpacerHeight: " + bottomSpacerHeight); + if (bottomSpacerHeight < 0) { + FrameLayout iconFrame = findViewById(R.id.biometric_icon_frame); + iconFrame.setTranslationY(-bottomSpacerHeight); + + TextView indicator = findViewById(R.id.indicator); + indicator.setTranslationY(-bottomSpacerHeight); + } + } } diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsDialogMeasureAdapter.java b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsDialogMeasureAdapter.java index 7ccfb865cd5a..6185e59b17d8 100644 --- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsDialogMeasureAdapter.java +++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsDialogMeasureAdapter.java @@ -45,6 +45,7 @@ public class UdfpsDialogMeasureAdapter { @NonNull private final FingerprintSensorPropertiesInternal mSensorProps; @Nullable private WindowManager mWindowManager; + private int mBottomSpacerHeight; public UdfpsDialogMeasureAdapter( @NonNull ViewGroup view, @NonNull FingerprintSensorPropertiesInternal sensorProps) { @@ -74,6 +75,16 @@ public class UdfpsDialogMeasureAdapter { } } + /** + * @return the actual (and possibly negative) bottom spacer height. If negative, this indicates + * that the UDFPS sensor is too low. Our current xml and custom measurement logic is very hard + * too cleanly support this case. So, let's have the onLayout code translate the sensor location + * instead. + */ + int getBottomSpacerHeight() { + return mBottomSpacerHeight; + } + @NonNull private AuthDialog.LayoutParams onMeasureInternalPortrait(int width, int height) { // Get the height of the everything below the icon. Currently, that's the indicator and @@ -86,7 +97,7 @@ public class UdfpsDialogMeasureAdapter { final int dialogMargin = getDialogMarginPx(); final int displayHeight = getWindowBounds().height(); final Insets navbarInsets = getNavbarInsets(); - final int bottomSpacerHeight = calculateBottomSpacerHeightForPortrait( + mBottomSpacerHeight = calculateBottomSpacerHeightForPortrait( mSensorProps, displayHeight, textIndicatorHeight, buttonBarHeight, dialogMargin, navbarInsets.bottom); @@ -122,9 +133,10 @@ public class UdfpsDialogMeasureAdapter { MeasureSpec.EXACTLY)); } else if (child.getId() == R.id.space_below_icon) { // Set the spacer height so the fingerprint icon is on the physical sensor area + final int clampedSpacerHeight = Math.max(mBottomSpacerHeight, 0); child.measure( MeasureSpec.makeMeasureSpec(width, MeasureSpec.EXACTLY), - MeasureSpec.makeMeasureSpec(bottomSpacerHeight, MeasureSpec.EXACTLY)); + MeasureSpec.makeMeasureSpec(clampedSpacerHeight, MeasureSpec.EXACTLY)); } else { child.measure( MeasureSpec.makeMeasureSpec(width, MeasureSpec.EXACTLY), diff --git a/services/core/Android.bp b/services/core/Android.bp index 55b982b40611..2103bcc01b6a 100644 --- a/services/core/Android.bp +++ b/services/core/Android.bp @@ -138,9 +138,11 @@ java_library_static { "android.hardware.boot-V1.1-java", "android.hardware.boot-V1.2-java", "android.hardware.broadcastradio-V2.0-java", - "android.hardware.health-V1.0-java", - "android.hardware.health-V2.0-java", - "android.hardware.health-V2.1-java", + "android.hardware.health-V1.0-java", // HIDL + "android.hardware.health-V2.0-java", // HIDL + "android.hardware.health-V2.1-java", // HIDL + "android.hardware.health-V1-java", // AIDL + "android.hardware.health-translate-java", "android.hardware.light-V1-java", "android.hardware.tv.cec-V1.1-java", "android.hardware.weaver-V1.0-java", @@ -149,7 +151,7 @@ java_library_static { "android.hardware.biometrics.fingerprint-V2.3-java", "android.hardware.biometrics.fingerprint-V1-java", "android.hardware.oemlock-V1.0-java", - "android.hardware.configstore-V1.0-java", + "android.hardware.configstore-V1.1-java", "android.hardware.contexthub-V1.0-java", "android.hardware.rebootescrow-V1-java", "android.hardware.soundtrigger-V2.3-java", diff --git a/services/core/java/com/android/server/BatteryService.java b/services/core/java/com/android/server/BatteryService.java index 728efa505d99..844ac86e8eb5 100644 --- a/services/core/java/com/android/server/BatteryService.java +++ b/services/core/java/com/android/server/BatteryService.java @@ -17,7 +17,7 @@ package com.android.server; import static com.android.internal.logging.nano.MetricsProto.MetricsEvent; -import static com.android.server.health.Utils.copy; +import static com.android.server.health.Utils.copyV1Battery; import android.annotation.Nullable; import android.app.ActivityManager; @@ -26,7 +26,7 @@ import android.content.ContentResolver; import android.content.Context; import android.content.Intent; import android.database.ContentObserver; -import android.hardware.health.V1_0.HealthInfo; +import android.hardware.health.HealthInfo; import android.hardware.health.V2_1.BatteryCapacityLevel; import android.metrics.LogMaker; import android.os.BatteryManager; @@ -138,7 +138,6 @@ public final class BatteryService extends SystemService { private HealthInfo mHealthInfo; private final HealthInfo mLastHealthInfo = new HealthInfo(); - private android.hardware.health.V2_1.HealthInfo mHealthInfo2p1; private boolean mBatteryLevelCritical; private int mLastBatteryStatus; private int mLastBatteryHealth; @@ -354,8 +353,8 @@ public final class BatteryService extends SystemService { } private boolean shouldShutdownLocked() { - if (mHealthInfo2p1.batteryCapacityLevel != BatteryCapacityLevel.UNSUPPORTED) { - return (mHealthInfo2p1.batteryCapacityLevel == BatteryCapacityLevel.CRITICAL); + if (mHealthInfo.batteryCapacityLevel != BatteryCapacityLevel.UNSUPPORTED) { + return (mHealthInfo.batteryCapacityLevel == BatteryCapacityLevel.CRITICAL); } if (mHealthInfo.batteryLevel > 0) { return false; @@ -397,7 +396,7 @@ public final class BatteryService extends SystemService { // shut down gracefully if temperature is too high (> 68.0C by default) // wait until the system has booted before attempting to display the // shutdown dialog. - if (mHealthInfo.batteryTemperature > mShutdownBatteryTemperature) { + if (mHealthInfo.batteryTemperatureTenthsCelsius > mShutdownBatteryTemperature) { mHandler.post(new Runnable() { @Override public void run() { @@ -414,27 +413,23 @@ public final class BatteryService extends SystemService { } } - private void update(android.hardware.health.V2_1.HealthInfo info) { + private void update(android.hardware.health.HealthInfo info) { traceBegin("HealthInfoUpdate"); - Trace.traceCounter(Trace.TRACE_TAG_POWER, "BatteryChargeCounter", - info.legacy.legacy.batteryChargeCounter); - Trace.traceCounter(Trace.TRACE_TAG_POWER, "BatteryCurrent", - info.legacy.legacy.batteryCurrent); - Trace.traceCounter(Trace.TRACE_TAG_POWER, "PlugType", - plugType(info.legacy.legacy)); - Trace.traceCounter(Trace.TRACE_TAG_POWER, "BatteryStatus", - info.legacy.legacy.batteryStatus); + Trace.traceCounter( + Trace.TRACE_TAG_POWER, "BatteryChargeCounter", info.batteryChargeCounterUah); + Trace.traceCounter(Trace.TRACE_TAG_POWER, "BatteryCurrent", info.batteryCurrentMicroamps); + Trace.traceCounter(Trace.TRACE_TAG_POWER, "PlugType", plugType(info)); + Trace.traceCounter(Trace.TRACE_TAG_POWER, "BatteryStatus", info.batteryStatus); synchronized (mLock) { if (!mUpdatesStopped) { - mHealthInfo = info.legacy.legacy; - mHealthInfo2p1 = info; + mHealthInfo = info; // Process the new values. processValuesLocked(false); mLock.notifyAll(); // for any waiters on new info } else { - copy(mLastHealthInfo, info.legacy.legacy); + copyV1Battery(mLastHealthInfo, info); } } traceEnd(); @@ -470,11 +465,16 @@ public final class BatteryService extends SystemService { // Let the battery stats keep track of the current level. try { - mBatteryStats.setBatteryState(mHealthInfo.batteryStatus, mHealthInfo.batteryHealth, - mPlugType, mHealthInfo.batteryLevel, mHealthInfo.batteryTemperature, - mHealthInfo.batteryVoltage, mHealthInfo.batteryChargeCounter, - mHealthInfo.batteryFullCharge, - mHealthInfo2p1.batteryChargeTimeToFullNowSeconds); + mBatteryStats.setBatteryState( + mHealthInfo.batteryStatus, + mHealthInfo.batteryHealth, + mPlugType, + mHealthInfo.batteryLevel, + mHealthInfo.batteryTemperatureTenthsCelsius, + mHealthInfo.batteryVoltageMillivolts, + mHealthInfo.batteryChargeCounterUah, + mHealthInfo.batteryFullChargeUah, + mHealthInfo.batteryChargeTimeToFullNowSeconds); } catch (RemoteException e) { // Should never happen. } @@ -482,17 +482,18 @@ public final class BatteryService extends SystemService { shutdownIfNoPowerLocked(); shutdownIfOverTempLocked(); - if (force || (mHealthInfo.batteryStatus != mLastBatteryStatus || - mHealthInfo.batteryHealth != mLastBatteryHealth || - mHealthInfo.batteryPresent != mLastBatteryPresent || - mHealthInfo.batteryLevel != mLastBatteryLevel || - mPlugType != mLastPlugType || - mHealthInfo.batteryVoltage != mLastBatteryVoltage || - mHealthInfo.batteryTemperature != mLastBatteryTemperature || - mHealthInfo.maxChargingCurrent != mLastMaxChargingCurrent || - mHealthInfo.maxChargingVoltage != mLastMaxChargingVoltage || - mHealthInfo.batteryChargeCounter != mLastChargeCounter || - mInvalidCharger != mLastInvalidCharger)) { + if (force + || (mHealthInfo.batteryStatus != mLastBatteryStatus + || mHealthInfo.batteryHealth != mLastBatteryHealth + || mHealthInfo.batteryPresent != mLastBatteryPresent + || mHealthInfo.batteryLevel != mLastBatteryLevel + || mPlugType != mLastPlugType + || mHealthInfo.batteryVoltageMillivolts != mLastBatteryVoltage + || mHealthInfo.batteryTemperatureTenthsCelsius != mLastBatteryTemperature + || mHealthInfo.maxChargingCurrentMicroamps != mLastMaxChargingCurrent + || mHealthInfo.maxChargingVoltageMicrovolts != mLastMaxChargingVoltage + || mHealthInfo.batteryChargeCounterUah != mLastChargeCounter + || mInvalidCharger != mLastInvalidCharger)) { if (mPlugType != mLastPlugType) { if (mLastPlugType == BATTERY_PLUGGED_NONE) { @@ -549,8 +550,11 @@ public final class BatteryService extends SystemService { if (mHealthInfo.batteryLevel != mLastBatteryLevel) { // Don't do this just from voltage or temperature changes, that is // too noisy. - EventLog.writeEvent(EventLogTags.BATTERY_LEVEL, - mHealthInfo.batteryLevel, mHealthInfo.batteryVoltage, mHealthInfo.batteryTemperature); + EventLog.writeEvent( + EventLogTags.BATTERY_LEVEL, + mHealthInfo.batteryLevel, + mHealthInfo.batteryVoltageMillivolts, + mHealthInfo.batteryTemperatureTenthsCelsius); } if (mBatteryLevelCritical && !mLastBatteryLevelCritical && mPlugType == BATTERY_PLUGGED_NONE) { @@ -656,11 +660,11 @@ public final class BatteryService extends SystemService { mLastBatteryPresent = mHealthInfo.batteryPresent; mLastBatteryLevel = mHealthInfo.batteryLevel; mLastPlugType = mPlugType; - mLastBatteryVoltage = mHealthInfo.batteryVoltage; - mLastBatteryTemperature = mHealthInfo.batteryTemperature; - mLastMaxChargingCurrent = mHealthInfo.maxChargingCurrent; - mLastMaxChargingVoltage = mHealthInfo.maxChargingVoltage; - mLastChargeCounter = mHealthInfo.batteryChargeCounter; + mLastBatteryVoltage = mHealthInfo.batteryVoltageMillivolts; + mLastBatteryTemperature = mHealthInfo.batteryTemperatureTenthsCelsius; + mLastMaxChargingCurrent = mHealthInfo.maxChargingCurrentMicroamps; + mLastMaxChargingVoltage = mHealthInfo.maxChargingVoltageMicrovolts; + mLastChargeCounter = mHealthInfo.batteryChargeCounterUah; mLastBatteryLevelCritical = mBatteryLevelCritical; mLastInvalidCharger = mInvalidCharger; } @@ -683,13 +687,17 @@ public final class BatteryService extends SystemService { intent.putExtra(BatteryManager.EXTRA_SCALE, BATTERY_SCALE); intent.putExtra(BatteryManager.EXTRA_ICON_SMALL, icon); intent.putExtra(BatteryManager.EXTRA_PLUGGED, mPlugType); - intent.putExtra(BatteryManager.EXTRA_VOLTAGE, mHealthInfo.batteryVoltage); - intent.putExtra(BatteryManager.EXTRA_TEMPERATURE, mHealthInfo.batteryTemperature); + intent.putExtra(BatteryManager.EXTRA_VOLTAGE, mHealthInfo.batteryVoltageMillivolts); + intent.putExtra( + BatteryManager.EXTRA_TEMPERATURE, mHealthInfo.batteryTemperatureTenthsCelsius); intent.putExtra(BatteryManager.EXTRA_TECHNOLOGY, mHealthInfo.batteryTechnology); intent.putExtra(BatteryManager.EXTRA_INVALID_CHARGER, mInvalidCharger); - intent.putExtra(BatteryManager.EXTRA_MAX_CHARGING_CURRENT, mHealthInfo.maxChargingCurrent); - intent.putExtra(BatteryManager.EXTRA_MAX_CHARGING_VOLTAGE, mHealthInfo.maxChargingVoltage); - intent.putExtra(BatteryManager.EXTRA_CHARGE_COUNTER, mHealthInfo.batteryChargeCounter); + intent.putExtra( + BatteryManager.EXTRA_MAX_CHARGING_CURRENT, mHealthInfo.maxChargingCurrentMicroamps); + intent.putExtra( + BatteryManager.EXTRA_MAX_CHARGING_VOLTAGE, + mHealthInfo.maxChargingVoltageMicrovolts); + intent.putExtra(BatteryManager.EXTRA_CHARGE_COUNTER, mHealthInfo.batteryChargeCounterUah); if (DEBUG) { Slog.d(TAG, "Sending ACTION_BATTERY_CHANGED. scale:" + BATTERY_SCALE + ", info:" + mHealthInfo.toString()); @@ -709,9 +717,9 @@ public final class BatteryService extends SystemService { event.putBoolean(BatteryManager.EXTRA_BATTERY_LOW, mSentLowBatteryBroadcast); event.putInt(BatteryManager.EXTRA_SCALE, BATTERY_SCALE); event.putInt(BatteryManager.EXTRA_PLUGGED, mPlugType); - event.putInt(BatteryManager.EXTRA_VOLTAGE, mHealthInfo.batteryVoltage); - event.putInt(BatteryManager.EXTRA_TEMPERATURE, mHealthInfo.batteryTemperature); - event.putInt(BatteryManager.EXTRA_CHARGE_COUNTER, mHealthInfo.batteryChargeCounter); + event.putInt(BatteryManager.EXTRA_VOLTAGE, mHealthInfo.batteryVoltageMillivolts); + event.putInt(BatteryManager.EXTRA_TEMPERATURE, mHealthInfo.batteryTemperatureTenthsCelsius); + event.putInt(BatteryManager.EXTRA_CHARGE_COUNTER, mHealthInfo.batteryChargeCounterUah); event.putLong(BatteryManager.EXTRA_EVENT_TIMESTAMP, now); boolean queueWasEmpty = mBatteryLevelsEventQueue.isEmpty(); @@ -903,7 +911,7 @@ public final class BatteryService extends SystemService { } try { if (!mUpdatesStopped) { - copy(mLastHealthInfo, mHealthInfo); + copyV1Battery(mLastHealthInfo, mHealthInfo); } boolean update = true; switch (key) { @@ -926,10 +934,10 @@ public final class BatteryService extends SystemService { mHealthInfo.batteryLevel = Integer.parseInt(value); break; case "counter": - mHealthInfo.batteryChargeCounter = Integer.parseInt(value); + mHealthInfo.batteryChargeCounterUah = Integer.parseInt(value); break; case "temp": - mHealthInfo.batteryTemperature = Integer.parseInt(value); + mHealthInfo.batteryTemperatureTenthsCelsius = Integer.parseInt(value); break; case "invalid": mInvalidCharger = Integer.parseInt(value); @@ -973,7 +981,7 @@ public final class BatteryService extends SystemService { private void setChargerAcOnline(boolean online, boolean forceUpdate) { if (!mUpdatesStopped) { - copy(mLastHealthInfo, mHealthInfo); + copyV1Battery(mLastHealthInfo, mHealthInfo); } mHealthInfo.chargerAcOnline = online; mUpdatesStopped = true; @@ -982,7 +990,7 @@ public final class BatteryService extends SystemService { private void setBatteryLevel(int level, boolean forceUpdate) { if (!mUpdatesStopped) { - copy(mLastHealthInfo, mHealthInfo); + copyV1Battery(mLastHealthInfo, mHealthInfo); } mHealthInfo.batteryLevel = level; mUpdatesStopped = true; @@ -991,7 +999,7 @@ public final class BatteryService extends SystemService { private void unplugBattery(boolean forceUpdate, PrintWriter pw) { if (!mUpdatesStopped) { - copy(mLastHealthInfo, mHealthInfo); + copyV1Battery(mLastHealthInfo, mHealthInfo); } mHealthInfo.chargerAcOnline = false; mHealthInfo.chargerUsbOnline = false; @@ -1003,7 +1011,7 @@ public final class BatteryService extends SystemService { private void resetBattery(boolean forceUpdate, @Nullable PrintWriter pw) { if (mUpdatesStopped) { mUpdatesStopped = false; - copy(mHealthInfo, mLastHealthInfo); + copyV1Battery(mHealthInfo, mLastHealthInfo); Binder.withCleanCallingIdentity(() -> processValuesLocked(forceUpdate, pw)); } if (mBatteryInputSuspended) { @@ -1038,16 +1046,16 @@ public final class BatteryService extends SystemService { pw.println(" AC powered: " + mHealthInfo.chargerAcOnline); pw.println(" USB powered: " + mHealthInfo.chargerUsbOnline); pw.println(" Wireless powered: " + mHealthInfo.chargerWirelessOnline); - pw.println(" Max charging current: " + mHealthInfo.maxChargingCurrent); - pw.println(" Max charging voltage: " + mHealthInfo.maxChargingVoltage); - pw.println(" Charge counter: " + mHealthInfo.batteryChargeCounter); + pw.println(" Max charging current: " + mHealthInfo.maxChargingCurrentMicroamps); + pw.println(" Max charging voltage: " + mHealthInfo.maxChargingVoltageMicrovolts); + pw.println(" Charge counter: " + mHealthInfo.batteryChargeCounterUah); pw.println(" status: " + mHealthInfo.batteryStatus); pw.println(" health: " + mHealthInfo.batteryHealth); pw.println(" present: " + mHealthInfo.batteryPresent); pw.println(" level: " + mHealthInfo.batteryLevel); pw.println(" scale: " + BATTERY_SCALE); - pw.println(" voltage: " + mHealthInfo.batteryVoltage); - pw.println(" temperature: " + mHealthInfo.batteryTemperature); + pw.println(" voltage: " + mHealthInfo.batteryVoltageMillivolts); + pw.println(" temperature: " + mHealthInfo.batteryTemperatureTenthsCelsius); pw.println(" technology: " + mHealthInfo.batteryTechnology); } else { Shell shell = new Shell(); @@ -1070,16 +1078,23 @@ public final class BatteryService extends SystemService { batteryPluggedValue = OsProtoEnums.BATTERY_PLUGGED_WIRELESS; } proto.write(BatteryServiceDumpProto.PLUGGED, batteryPluggedValue); - proto.write(BatteryServiceDumpProto.MAX_CHARGING_CURRENT, mHealthInfo.maxChargingCurrent); - proto.write(BatteryServiceDumpProto.MAX_CHARGING_VOLTAGE, mHealthInfo.maxChargingVoltage); - proto.write(BatteryServiceDumpProto.CHARGE_COUNTER, mHealthInfo.batteryChargeCounter); + proto.write( + BatteryServiceDumpProto.MAX_CHARGING_CURRENT, + mHealthInfo.maxChargingCurrentMicroamps); + proto.write( + BatteryServiceDumpProto.MAX_CHARGING_VOLTAGE, + mHealthInfo.maxChargingVoltageMicrovolts); + proto.write( + BatteryServiceDumpProto.CHARGE_COUNTER, mHealthInfo.batteryChargeCounterUah); proto.write(BatteryServiceDumpProto.STATUS, mHealthInfo.batteryStatus); proto.write(BatteryServiceDumpProto.HEALTH, mHealthInfo.batteryHealth); proto.write(BatteryServiceDumpProto.IS_PRESENT, mHealthInfo.batteryPresent); proto.write(BatteryServiceDumpProto.LEVEL, mHealthInfo.batteryLevel); proto.write(BatteryServiceDumpProto.SCALE, BATTERY_SCALE); - proto.write(BatteryServiceDumpProto.VOLTAGE, mHealthInfo.batteryVoltage); - proto.write(BatteryServiceDumpProto.TEMPERATURE, mHealthInfo.batteryTemperature); + proto.write(BatteryServiceDumpProto.VOLTAGE, mHealthInfo.batteryVoltageMillivolts); + proto.write( + BatteryServiceDumpProto.TEMPERATURE, + mHealthInfo.batteryTemperatureTenthsCelsius); proto.write(BatteryServiceDumpProto.TECHNOLOGY, mHealthInfo.batteryTechnology); } proto.flush(); @@ -1207,14 +1222,14 @@ public final class BatteryService extends SystemService { @Override public int getBatteryChargeCounter() { synchronized (mLock) { - return mHealthInfo.batteryChargeCounter; + return mHealthInfo.batteryChargeCounterUah; } } @Override public int getBatteryFullCharge() { synchronized (mLock) { - return mHealthInfo.batteryFullCharge; + return mHealthInfo.batteryFullChargeUah; } } diff --git a/services/core/java/com/android/server/am/SettingsToPropertiesMapper.java b/services/core/java/com/android/server/am/SettingsToPropertiesMapper.java index 3ccacd84a9f3..c5ac3907ecfe 100644 --- a/services/core/java/com/android/server/am/SettingsToPropertiesMapper.java +++ b/services/core/java/com/android/server/am/SettingsToPropertiesMapper.java @@ -94,6 +94,8 @@ public class SettingsToPropertiesMapper { DeviceConfig.NAMESPACE_STATSD_NATIVE, DeviceConfig.NAMESPACE_STATSD_NATIVE_BOOT, DeviceConfig.NAMESPACE_STORAGE_NATIVE_BOOT, + DeviceConfig.NAMESPACE_TETHERING, + DeviceConfig.NAMESPACE_VIRTUALIZATION_FRAMEWORK_NATIVE, DeviceConfig.NAMESPACE_WINDOW_MANAGER_NATIVE_BOOT, }; diff --git a/services/core/java/com/android/server/biometrics/AuthService.java b/services/core/java/com/android/server/biometrics/AuthService.java index 0cd2e3d0ff59..c97ad55ceeec 100644 --- a/services/core/java/com/android/server/biometrics/AuthService.java +++ b/services/core/java/com/android/server/biometrics/AuthService.java @@ -60,6 +60,7 @@ import android.os.Build; import android.os.IBinder; import android.os.RemoteException; import android.os.ServiceManager; +import android.os.SystemProperties; import android.os.UserHandle; import android.provider.Settings; import android.util.Slog; @@ -70,6 +71,7 @@ import com.android.internal.util.ArrayUtils; import com.android.server.SystemService; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; /** @@ -81,6 +83,8 @@ public class AuthService extends SystemService { private static final String SETTING_HIDL_DISABLED = "com.android.server.biometrics.AuthService.hidlDisabled"; private static final int DEFAULT_HIDL_DISABLED = 0; + private static final String SYSPROP_FIRST_API_LEVEL = "ro.board.first_api_level"; + private static final String SYSPROP_API_LEVEL = "ro.board.api_level"; private final Injector mInjector; @@ -623,7 +627,16 @@ public class AuthService extends SystemService { final SensorConfig[] hidlConfigs; if (!mInjector.isHidlDisabled(getContext())) { - final String[] configStrings = mInjector.getConfiguration(getContext()); + final int firstApiLevel = SystemProperties.getInt(SYSPROP_FIRST_API_LEVEL, 0); + final int apiLevel = SystemProperties.getInt(SYSPROP_API_LEVEL, firstApiLevel); + String[] configStrings = mInjector.getConfiguration(getContext()); + if (configStrings.length == 0 && apiLevel == Build.VERSION_CODES.R) { + // For backwards compatibility with R where biometrics could work without being + // configured in config_biometric_sensors. In the absence of a vendor provided + // configuration, we assume the weakest biometric strength (i.e. convenience). + Slog.w(TAG, "Found R vendor partition without config_biometric_sensors"); + configStrings = generateRSdkCompatibleConfiguration(); + } hidlConfigs = new SensorConfig[configStrings.length]; for (int i = 0; i < configStrings.length; ++i) { hidlConfigs[i] = new SensorConfig(configStrings[i]); @@ -639,6 +652,31 @@ public class AuthService extends SystemService { } /** + * Generates an array of string configs with entries that correspond to the biometric features + * declared on the device. Returns an empty array if no biometric features are declared. + * Biometrics are assumed to be of the weakest strength class, i.e. convenience. + */ + private @NonNull String[] generateRSdkCompatibleConfiguration() { + final PackageManager pm = getContext().getPackageManager(); + final ArrayList<String> modalities = new ArrayList<>(); + if (pm.hasSystemFeature(PackageManager.FEATURE_FINGERPRINT)) { + modalities.add(String.valueOf(BiometricAuthenticator.TYPE_FINGERPRINT)); + } + if (pm.hasSystemFeature(PackageManager.FEATURE_FACE)) { + modalities.add(String.valueOf(BiometricAuthenticator.TYPE_FACE)); + } + final String strength = String.valueOf(Authenticators.BIOMETRIC_CONVENIENCE); + final String[] configStrings = new String[modalities.size()]; + for (int i = 0; i < modalities.size(); ++i) { + final String id = String.valueOf(i); + final String modality = modalities.get(i); + configStrings[i] = String.join(":" /* delimiter */, id, modality, strength); + } + Slog.d(TAG, "Generated config_biometric_sensors: " + Arrays.toString(configStrings)); + return configStrings; + } + + /** * Registers HIDL and AIDL authenticators for all of the available modalities. * * @param hidlSensors Array of {@link SensorConfig} configuration for all of the HIDL sensors diff --git a/services/core/java/com/android/server/compat/OWNERS b/services/core/java/com/android/server/compat/OWNERS index cfd0a4b079ad..ee3086ab2fdb 100644 --- a/services/core/java/com/android/server/compat/OWNERS +++ b/services/core/java/com/android/server/compat/OWNERS @@ -1,6 +1 @@ -# Use this reviewer by default. -platform-compat-eng+reviews@google.com - -andreionea@google.com -mathewi@google.com -satayev@google.com +include tools/platform-compat:/OWNERS diff --git a/services/core/java/com/android/server/health/HealthHalCallbackHidl.java b/services/core/java/com/android/server/health/HealthHalCallbackHidl.java index 6b4d7b7c17c1..7a6698085c0d 100644 --- a/services/core/java/com/android/server/health/HealthHalCallbackHidl.java +++ b/services/core/java/com/android/server/health/HealthHalCallbackHidl.java @@ -16,6 +16,8 @@ package com.android.server.health; +import static android.hardware.health.Translate.h2aTranslate; + import android.annotation.NonNull; import android.hardware.health.V2_0.IHealth; import android.hardware.health.V2_0.Result; @@ -64,12 +66,12 @@ class HealthHalCallbackHidl extends IHealthInfoCallback.Stub propsLatest.batteryChargeTimeToFullNowSeconds = Constants.BATTERY_CHARGE_TIME_TO_FULL_NOW_SECONDS_UNSUPPORTED; - mCallback.update(propsLatest); + mCallback.update(h2aTranslate(propsLatest)); } @Override public void healthInfoChanged_2_1(android.hardware.health.V2_1.HealthInfo props) { - mCallback.update(props); + mCallback.update(h2aTranslate(props)); } // on new service registered diff --git a/services/core/java/com/android/server/health/HealthInfoCallback.java b/services/core/java/com/android/server/health/HealthInfoCallback.java index 8136ca0c6068..c2a77fc862fa 100644 --- a/services/core/java/com/android/server/health/HealthInfoCallback.java +++ b/services/core/java/com/android/server/health/HealthInfoCallback.java @@ -27,6 +27,5 @@ public interface HealthInfoCallback { * * @param props the new health info. */ - // TODO(b/177269435): AIDL - void update(android.hardware.health.V2_1.HealthInfo props); + void update(android.hardware.health.HealthInfo props); } diff --git a/services/core/java/com/android/server/health/HealthServiceWrapper.java b/services/core/java/com/android/server/health/HealthServiceWrapper.java index 0b43f26e294d..9b97554ee259 100644 --- a/services/core/java/com/android/server/health/HealthServiceWrapper.java +++ b/services/core/java/com/android/server/health/HealthServiceWrapper.java @@ -68,8 +68,7 @@ public abstract class HealthServiceWrapper { * service-specific error when calling {@code getHealthInfo}, e.g. it is unsupported. * @throws RemoteException for any transaction-level errors */ - // TODO(b/177269435): AIDL - public abstract android.hardware.health.V1_0.HealthInfo getHealthInfo() throws RemoteException; + public abstract android.hardware.health.HealthInfo getHealthInfo() throws RemoteException; /** * Create a new HealthServiceWrapper instance. diff --git a/services/core/java/com/android/server/health/HealthServiceWrapperHidl.java b/services/core/java/com/android/server/health/HealthServiceWrapperHidl.java index 3bff2f83d3d2..0301174a45c6 100644 --- a/services/core/java/com/android/server/health/HealthServiceWrapperHidl.java +++ b/services/core/java/com/android/server/health/HealthServiceWrapperHidl.java @@ -16,9 +16,11 @@ package com.android.server.health; +import static android.hardware.health.Translate.h2aTranslate; + import android.annotation.NonNull; import android.annotation.Nullable; -import android.hardware.health.V1_0.HealthInfo; +import android.hardware.health.HealthInfo; import android.hardware.health.V2_0.IHealth; import android.hardware.health.V2_0.Result; import android.hidl.manager.V1_0.IServiceManager; @@ -155,7 +157,7 @@ final class HealthServiceWrapperHidl extends HealthServiceWrapper { service.getHealthInfo( (result, value) -> { if (result == Result.SUCCESS) { - ret.value = value.legacy; + ret.value = h2aTranslate(value.legacy); } }); return ret.value; diff --git a/services/core/java/com/android/server/health/Utils.java b/services/core/java/com/android/server/health/Utils.java index fc039eb54950..a8c978c50e42 100644 --- a/services/core/java/com/android/server/health/Utils.java +++ b/services/core/java/com/android/server/health/Utils.java @@ -50,4 +50,36 @@ public class Utils { dst.batteryChargeCounter = src.batteryChargeCounter; dst.batteryTechnology = src.batteryTechnology; } + + /** + * Copy battery fields of {@link android.hardware.health.HealthInfo} V1. This excludes + * non-battery fields like {@link android.hardware.health.HealthInfo#diskStats diskStats} and + * {@link android.hardware.health.HealthInfo#storageInfos storageInfos} + * + * @param dst destination + * @param src source + */ + public static void copyV1Battery( + android.hardware.health.HealthInfo dst, android.hardware.health.HealthInfo src) { + dst.chargerAcOnline = src.chargerAcOnline; + dst.chargerUsbOnline = src.chargerUsbOnline; + dst.chargerWirelessOnline = src.chargerWirelessOnline; + dst.maxChargingCurrentMicroamps = src.maxChargingCurrentMicroamps; + dst.maxChargingVoltageMicrovolts = src.maxChargingVoltageMicrovolts; + dst.batteryStatus = src.batteryStatus; + dst.batteryHealth = src.batteryHealth; + dst.batteryPresent = src.batteryPresent; + dst.batteryLevel = src.batteryLevel; + dst.batteryVoltageMillivolts = src.batteryVoltageMillivolts; + dst.batteryTemperatureTenthsCelsius = src.batteryTemperatureTenthsCelsius; + dst.batteryCurrentMicroamps = src.batteryCurrentMicroamps; + dst.batteryCycleCount = src.batteryCycleCount; + dst.batteryFullChargeUah = src.batteryFullChargeUah; + dst.batteryChargeCounterUah = src.batteryChargeCounterUah; + dst.batteryTechnology = src.batteryTechnology; + dst.batteryCurrentAverageMicroamps = src.batteryCurrentAverageMicroamps; + dst.batteryCapacityLevel = src.batteryCapacityLevel; + dst.batteryChargeTimeToFullNowSeconds = src.batteryChargeTimeToFullNowSeconds; + dst.batteryFullChargeDesignCapacityUah = src.batteryFullChargeDesignCapacityUah; + } } diff --git a/services/core/java/com/android/server/net/OWNERS b/services/core/java/com/android/server/net/OWNERS index 28ae6a417bd3..a15fc3eef539 100644 --- a/services/core/java/com/android/server/net/OWNERS +++ b/services/core/java/com/android/server/net/OWNERS @@ -1,11 +1,7 @@ set noparent -codewiz@google.com -jchalard@google.com +include platform/packages/modules/Connectivity:/OWNERS + jsharkey@android.com -junyulai@google.com -lorenzo@google.com -reminv@google.com -satk@google.com sudheersai@google.com yamasani@google.com diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java index 827dfc0caa16..1a0a885d88b4 100644 --- a/services/core/java/com/android/server/pm/PackageManagerService.java +++ b/services/core/java/com/android/server/pm/PackageManagerService.java @@ -21918,7 +21918,7 @@ public class PackageManagerService extends IPackageManager.Stub for (int i = 0, size = SYSTEM_PARTITIONS.size(); i < size; i++) { ScanPartition sp = SYSTEM_PARTITIONS.get(i); if (apexInfo.preInstalledApexPath.getAbsolutePath().startsWith( - sp.getFolder().getAbsolutePath())) { + sp.getFolder().getAbsolutePath() + File.separator)) { return new ScanPartition(apexInfo.apexDirectory, sp, SCAN_AS_APK_IN_APEX); } } diff --git a/services/core/java/com/android/server/policy/PhoneWindowManager.java b/services/core/java/com/android/server/policy/PhoneWindowManager.java index e40882268e67..4a9772093bb7 100644 --- a/services/core/java/com/android/server/policy/PhoneWindowManager.java +++ b/services/core/java/com/android/server/policy/PhoneWindowManager.java @@ -2666,6 +2666,24 @@ public class PhoneWindowManager implements WindowManagerPolicy { Slog.wtf(TAG, "KEYCODE_VOICE_ASSIST should be handled in" + " interceptKeyBeforeQueueing"); return key_consumed; + case KeyEvent.KEYCODE_VIDEO_APP_1: + case KeyEvent.KEYCODE_VIDEO_APP_2: + case KeyEvent.KEYCODE_VIDEO_APP_3: + case KeyEvent.KEYCODE_VIDEO_APP_4: + case KeyEvent.KEYCODE_VIDEO_APP_5: + case KeyEvent.KEYCODE_VIDEO_APP_6: + case KeyEvent.KEYCODE_VIDEO_APP_7: + case KeyEvent.KEYCODE_VIDEO_APP_8: + case KeyEvent.KEYCODE_FEATURED_APP_1: + case KeyEvent.KEYCODE_FEATURED_APP_2: + case KeyEvent.KEYCODE_FEATURED_APP_3: + case KeyEvent.KEYCODE_FEATURED_APP_4: + case KeyEvent.KEYCODE_DEMO_APP_1: + case KeyEvent.KEYCODE_DEMO_APP_2: + case KeyEvent.KEYCODE_DEMO_APP_3: + case KeyEvent.KEYCODE_DEMO_APP_4: + Slog.wtf(TAG, "KEYCODE_APP_X should be handled in interceptKeyBeforeQueueing"); + return key_consumed; case KeyEvent.KEYCODE_SYSRQ: if (down && repeatCount == 0) { mScreenshotRunnable.setScreenshotType(TAKE_SCREENSHOT_FULLSCREEN); @@ -3773,6 +3791,26 @@ public class PhoneWindowManager implements WindowManagerPolicy { } break; } + case KeyEvent.KEYCODE_VIDEO_APP_1: + case KeyEvent.KEYCODE_VIDEO_APP_2: + case KeyEvent.KEYCODE_VIDEO_APP_3: + case KeyEvent.KEYCODE_VIDEO_APP_4: + case KeyEvent.KEYCODE_VIDEO_APP_5: + case KeyEvent.KEYCODE_VIDEO_APP_6: + case KeyEvent.KEYCODE_VIDEO_APP_7: + case KeyEvent.KEYCODE_VIDEO_APP_8: + case KeyEvent.KEYCODE_FEATURED_APP_1: + case KeyEvent.KEYCODE_FEATURED_APP_2: + case KeyEvent.KEYCODE_FEATURED_APP_3: + case KeyEvent.KEYCODE_FEATURED_APP_4: + case KeyEvent.KEYCODE_DEMO_APP_1: + case KeyEvent.KEYCODE_DEMO_APP_2: + case KeyEvent.KEYCODE_DEMO_APP_3: + case KeyEvent.KEYCODE_DEMO_APP_4: { + // Just drop if keys are not intercepted for direct key. + result &= ~ACTION_PASS_TO_USER; + break; + } } // Intercept the Accessibility keychord (CTRL + ALT + Z) for keyboard users. diff --git a/services/core/java/com/android/server/stats/pull/StatsPullAtomService.java b/services/core/java/com/android/server/stats/pull/StatsPullAtomService.java index e6fed88a8a4a..1ef202511452 100644 --- a/services/core/java/com/android/server/stats/pull/StatsPullAtomService.java +++ b/services/core/java/com/android/server/stats/pull/StatsPullAtomService.java @@ -3977,7 +3977,7 @@ public class StatsPullAtomService extends SystemService { if (mHealthService == null) { return StatsManager.PULL_SKIP; } - android.hardware.health.V1_0.HealthInfo healthInfo; + android.hardware.health.HealthInfo healthInfo; try { healthInfo = mHealthService.getHealthInfo(); } catch (RemoteException | IllegalStateException e) { @@ -3993,13 +3993,13 @@ public class StatsPullAtomService extends SystemService { pulledValue = healthInfo.batteryLevel; break; case FrameworkStatsLog.REMAINING_BATTERY_CAPACITY: - pulledValue = healthInfo.batteryChargeCounter; + pulledValue = healthInfo.batteryChargeCounterUah; break; case FrameworkStatsLog.FULL_BATTERY_CAPACITY: - pulledValue = healthInfo.batteryFullCharge; + pulledValue = healthInfo.batteryFullChargeUah; break; case FrameworkStatsLog.BATTERY_VOLTAGE: - pulledValue = healthInfo.batteryVoltage; + pulledValue = healthInfo.batteryVoltageMillivolts; break; case FrameworkStatsLog.BATTERY_CYCLE_COUNT: pulledValue = healthInfo.batteryCycleCount; diff --git a/services/core/java/com/android/server/tv/TvInputManagerService.java b/services/core/java/com/android/server/tv/TvInputManagerService.java index 28947083854b..b9ceec15c9ab 100755 --- a/services/core/java/com/android/server/tv/TvInputManagerService.java +++ b/services/core/java/com/android/server/tv/TvInputManagerService.java @@ -315,6 +315,7 @@ public final class TvInputManagerService extends SystemService { PackageManager.GET_SERVICES | PackageManager.GET_META_DATA, userId); List<TvInputInfo> inputList = new ArrayList<>(); + List<ComponentName> hardwareComponents = new ArrayList<>(); for (ResolveInfo ri : services) { ServiceInfo si = ri.serviceInfo; if (!android.Manifest.permission.BIND_TV_INPUT.equals(si.permission)) { @@ -325,6 +326,7 @@ public final class TvInputManagerService extends SystemService { ComponentName component = new ComponentName(si.packageName, si.name); if (hasHardwarePermission(pm, component)) { + hardwareComponents.add(component); ServiceState serviceState = userState.serviceStateMap.get(component); if (serviceState == null) { // New hardware input found. Create a new ServiceState and connect to the @@ -397,6 +399,15 @@ public final class TvInputManagerService extends SystemService { } } + // Clean up ServiceState corresponding to the removed hardware inputs + Iterator<ServiceState> it = userState.serviceStateMap.values().iterator(); + while (it.hasNext()) { + ServiceState serviceState = it.next(); + if (serviceState.isHardware && !hardwareComponents.contains(serviceState.component)) { + it.remove(); + } + } + userState.inputMap.clear(); userState.inputMap = inputMap; } diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java index 9caef70f6b51..3421b28454f0 100644 --- a/services/core/java/com/android/server/wm/WindowManagerService.java +++ b/services/core/java/com/android/server/wm/WindowManagerService.java @@ -167,8 +167,10 @@ import android.graphics.Point; import android.graphics.Rect; import android.graphics.RectF; import android.graphics.Region; -import android.hardware.configstore.V1_0.ISurfaceFlingerConfigs; import android.hardware.configstore.V1_0.OptionalBool; +import android.hardware.configstore.V1_1.DisplayOrientation; +import android.hardware.configstore.V1_1.ISurfaceFlingerConfigs; +import android.hardware.configstore.V1_1.OptionalDisplayOrientation; import android.hardware.display.DisplayManager; import android.hardware.display.DisplayManagerInternal; import android.hardware.input.InputManager; @@ -220,6 +222,7 @@ import android.util.TypedValue; import android.util.proto.ProtoOutputStream; import android.view.Choreographer; import android.view.Display; +import android.view.DisplayAddress; import android.view.DisplayInfo; import android.view.Gravity; import android.view.IAppTransitionAnimationSpecsFuture; @@ -465,6 +468,8 @@ public class WindowManagerService extends IWindowManager.Stub */ static final boolean ENABLE_FIXED_ROTATION_TRANSFORM = SystemProperties.getBoolean("persist.wm.fixed_rotation_transform", true); + private @Surface.Rotation int mPrimaryDisplayOrientation = Surface.ROTATION_0; + private DisplayAddress mPrimaryDisplayPhysicalAddress; // Enums for animation scale update types. @Retention(RetentionPolicy.SOURCE) @@ -2461,16 +2466,21 @@ public class WindowManagerService extends IWindowManager.Stub configChanged = displayContent.updateOrientation(); Trace.traceEnd(TRACE_TAG_WINDOW_MANAGER); - final DisplayInfo rotatedDisplayInfo = - win.mToken.getFixedRotationTransformDisplayInfo(); - if (rotatedDisplayInfo != null) { - outSurfaceControl.setTransformHint(rotatedDisplayInfo.rotation); - } else { - // We have to update the transform hint of display here, but we need to get if from - // SurfaceFlinger, so set it as rotation of display for most cases, then - // SurfaceFlinger would still update the transform hint of display in next frame. - outSurfaceControl.setTransformHint(displayContent.getDisplayInfo().rotation); - } + final DisplayInfo displayInfo = win.getDisplayInfo(); + int transformHint = displayInfo.rotation; + // If the window is on the primary display, use the panel orientation to adjust the + // transform hint + final boolean isPrimaryDisplay = displayInfo.address != null && + displayInfo.address.equals(mPrimaryDisplayPhysicalAddress); + if (isPrimaryDisplay) { + transformHint = (transformHint + mPrimaryDisplayOrientation) % 4; + } + outSurfaceControl.setTransformHint(transformHint); + ProtoLog.v(WM_DEBUG_ORIENTATION, + "Passing transform hint %d for window %s%s", + transformHint, win, + isPrimaryDisplay ? " on primary display with orientation " + + mPrimaryDisplayOrientation : ""); if (toBeDisplayed && win.mIsWallpaper) { displayContent.mWallpaperController.updateWallpaperOffset(win, false /* sync */); @@ -4868,6 +4878,9 @@ public class WindowManagerService extends IWindowManager.Stub mTaskSnapshotController.systemReady(); mHasWideColorGamutSupport = queryWideColorGamutSupport(); mHasHdrSupport = queryHdrSupport(); + mPrimaryDisplayOrientation = queryPrimaryDisplayOrientation(); + mPrimaryDisplayPhysicalAddress = + DisplayAddress.fromPhysicalDisplayId(SurfaceControl.getPrimaryPhysicalDisplayId()); UiThread.getHandler().post(mSettingsObserver::loadSettings); IVrManager vrManager = IVrManager.Stub.asInterface( ServiceManager.getService(Context.VR_SERVICE)); @@ -4887,6 +4900,9 @@ public class WindowManagerService extends IWindowManager.Stub } } + + // Keep logic in sync with SurfaceFlingerProperties.cpp + // Consider exposing properties via ISurfaceComposer instead. private static boolean queryWideColorGamutSupport() { boolean defaultValue = false; Optional<Boolean> hasWideColorProp = SurfaceFlingerProperties.has_wide_color_display(); @@ -4927,6 +4943,39 @@ public class WindowManagerService extends IWindowManager.Stub return false; } + private static @Surface.Rotation int queryPrimaryDisplayOrientation() { + Optional<SurfaceFlingerProperties.primary_display_orientation_values> prop = + SurfaceFlingerProperties.primary_display_orientation(); + if (prop.isPresent()) { + switch (prop.get()) { + case ORIENTATION_90: return Surface.ROTATION_90; + case ORIENTATION_180: return Surface.ROTATION_180; + case ORIENTATION_270: return Surface.ROTATION_270; + case ORIENTATION_0: + default: + return Surface.ROTATION_0; + } + } + try { + ISurfaceFlingerConfigs surfaceFlinger = ISurfaceFlingerConfigs.getService(); + OptionalDisplayOrientation primaryDisplayOrientation = + surfaceFlinger.primaryDisplayOrientation(); + if (primaryDisplayOrientation != null && primaryDisplayOrientation.specified) { + switch (primaryDisplayOrientation.value) { + case DisplayOrientation.ORIENTATION_90: return Surface.ROTATION_90; + case DisplayOrientation.ORIENTATION_180: return Surface.ROTATION_180; + case DisplayOrientation.ORIENTATION_270: return Surface.ROTATION_270; + case DisplayOrientation.ORIENTATION_0: + default: + return Surface.ROTATION_0; + } + } + } catch (Exception e) { + // Use default value if we can't talk to config store. + } + return Surface.ROTATION_0; + } + void reportFocusChanged(IBinder oldToken, IBinder newToken) { WindowState lastFocus; WindowState newFocus; diff --git a/telecomm/java/android/telecom/InCallService.java b/telecomm/java/android/telecom/InCallService.java index cac716efe78f..0ddd52dfc76d 100644 --- a/telecomm/java/android/telecom/InCallService.java +++ b/telecomm/java/android/telecom/InCallService.java @@ -69,7 +69,14 @@ import java.util.List; * them know that the app has crashed and that their call was continued using the pre-loaded dialer * app. * <p> - * Further, the pre-loaded dialer will ALWAYS be used when the user places an emergency call. + * The pre-loaded dialer will ALWAYS be used when the user places an emergency call, even if your + * app fills the {@link android.app.role.RoleManager#ROLE_DIALER} role. To ensure an optimal + * experience when placing an emergency call, the default dialer should ALWAYS use + * {@link android.telecom.TelecomManager#placeCall(Uri, Bundle)} to place calls (including + * emergency calls). This ensures that the platform is able to verify that the request came from + * the default dialer. If a non-preloaded dialer app uses {@link Intent#ACTION_CALL} to place an + * emergency call, it will be raised to the preloaded dialer app using {@link Intent#ACTION_DIAL} + * for confirmation; this is a suboptimal user experience. * <p> * Below is an example manifest registration for an {@code InCallService}. The meta-data * {@link TelecomManager#METADATA_IN_CALL_SERVICE_UI} indicates that this particular diff --git a/telephony/java/android/telephony/AvailableNetworkInfo.java b/telephony/java/android/telephony/AvailableNetworkInfo.java index ae597e02f33c..2b355ae216e3 100644 --- a/telephony/java/android/telephony/AvailableNetworkInfo.java +++ b/telephony/java/android/telephony/AvailableNetworkInfo.java @@ -16,11 +16,14 @@ package android.telephony; +import android.annotation.IntDef; import android.annotation.NonNull; import android.os.Parcel; import android.os.Parcelable; import android.telephony.RadioAccessSpecifier; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -32,7 +35,6 @@ import java.util.Objects; * Network Service when passed through {@link TelephonyManager#updateAvailableNetworks} */ public final class AvailableNetworkInfo implements Parcelable { - /* * Defines number of priority level high. */ @@ -48,6 +50,14 @@ public final class AvailableNetworkInfo implements Parcelable { */ public static final int PRIORITY_LOW = 3; + /** @hide */ + @IntDef({ + PRIORITY_HIGH, + PRIORITY_MED, + PRIORITY_LOW, + }) + @Retention(RetentionPolicy.SOURCE) + public @interface AvailableNetworkInfoPriority {} /** * subscription Id of the available network. This value must be one of the entry retrieved from * {@link SubscriptionManager#getOpportunisticSubscriptions} @@ -62,7 +72,7 @@ public final class AvailableNetworkInfo implements Parcelable { * for network selection. If there are more than one subId with highest priority then the * network with highest RSRP is chosen. */ - private int mPriority; + private @AvailableNetworkInfoPriority int mPriority; /** * Describes the List of PLMN ids (MCC-MNC) associated with mSubId. @@ -77,8 +87,7 @@ public final class AvailableNetworkInfo implements Parcelable { * Opportunistic network service will use these bands to scan. * * When no specific bands are specified (empty array or null) CBRS band - * {@link AccessNetworkConstants.EutranBand.BAND_48 - * } will be used for network scan. + * {@link AccessNetworkConstants.EutranBand.BAND_48} will be used for network scan. * * See {@link AccessNetworkConstants} for details. * @@ -94,7 +103,7 @@ public final class AvailableNetworkInfo implements Parcelable { * If this entry is left empty, {@link RadioAcccessSpecifier}s with {@link AccessNetworkType}s * of {@link AccessNetworkConstants.AccessNetworkType.EUTRAN} and {@link * AccessNetworkConstants.AccessNetworkType.NGRAN} with bands 48 and 71 on each will be assumed - * by Opportunistic network service. + * by Opportunistic network service for a network scan. */ private ArrayList<RadioAccessSpecifier> mRadioAccessSpecifiers; @@ -117,6 +126,7 @@ public final class AvailableNetworkInfo implements Parcelable { * network with highest RSRP is chosen. * @return priority level */ + @AvailableNetworkInfoPriority public int getPriority() { return mPriority; } @@ -149,15 +159,9 @@ public final class AvailableNetworkInfo implements Parcelable { * Returns a list of {@link RadioAccessSpecifier} associated with the available network. * Opportunistic network service will use this to determine which bands to scan for. * - * the returned value is one of {@link AccessNetworkConstants.AccessNetworkType}. When no - * specific access network type is specified, {@link RadioAccessSpecifier}s with {@link - * AccessNetworkType}s of {@link AccessNetworkConstants.AccessNetworkType.EUTRAN} and {@link - * AccessNetworkConstants.AccessNetworkType.NGRAN} with bands 48 and 71 on each will be assumed - * by Opportunistic network service. * @return the access network type associated with the available network. - * @hide */ - public List<RadioAccessSpecifier> getRadioAccessSpecifiers() { + public @NonNull List<RadioAccessSpecifier> getRadioAccessSpecifiers() { return (List<RadioAccessSpecifier>) mRadioAccessSpecifiers.clone(); } @@ -193,9 +197,9 @@ public final class AvailableNetworkInfo implements Parcelable { } /** @hide */ - private AvailableNetworkInfo(int subId, int priority, @NonNull List<String> mccMncs, - @NonNull List<Integer> bands, @NonNull List<RadioAccessSpecifier> - radioAccessSpecifiers) { + private AvailableNetworkInfo(int subId, @AvailableNetworkInfoPriority int priority, + @NonNull List<String> mccMncs, @NonNull List<Integer> bands, + @NonNull List<RadioAccessSpecifier> radioAccessSpecifiers) { mSubId = subId; mPriority = priority; mMccMncs = new ArrayList<String>(mccMncs); @@ -261,27 +265,39 @@ public final class AvailableNetworkInfo implements Parcelable { * * <pre><code> * - * AvailableNetworkInfo aNI = new AvailableNetworkInfo.Builder() - * .setSubId(1) + * AvailableNetworkInfo aNI = new AvailableNetworkInfo.Builder(subId) * .setPriority(AvailableNetworkInfo.PRIORITY_MED) + * .setRadioAccessSpecifiers(radioAccessSpecifiers) + * .setMccMncs(mccMncs) * .build(); * </code></pre> - * - * @hide */ public static final class Builder { private int mSubId = Integer.MIN_VALUE; - private int mPriority = AvailableNetworkInfo.PRIORITY_LOW; + private @AvailableNetworkInfoPriority int mPriority = AvailableNetworkInfo.PRIORITY_LOW; private ArrayList<String> mMccMncs = new ArrayList<>(); - private ArrayList<Integer> mBands = new ArrayList<>(); private ArrayList<RadioAccessSpecifier> mRadioAccessSpecifiers = new ArrayList<>(); - public @NonNull Builder setSubId(int subId) { + /** + * + */ + /** + * Creates an AvailableNetworkInfo Builder with specified subscription id. + * + * @param subId of the availableNetwork. + */ + public Builder(int subId) { mSubId = subId; - return this; } - public @NonNull Builder setPriority(int priority) { + /** + * Sets the priority for the subscription id. + * + * @param priority of the subscription id. See {@link AvailableNetworkInfo#getPriority} for + * more details + * @return the original Builder object. + */ + public @NonNull Builder setPriority(@AvailableNetworkInfoPriority int priority) { if (priority > AvailableNetworkInfo.PRIORITY_LOW || priority < AvailableNetworkInfo.PRIORITY_HIGH) { throw new IllegalArgumentException("A valid priority must be set"); @@ -290,30 +306,48 @@ public final class AvailableNetworkInfo implements Parcelable { return this; } - public @NonNull Builder setMccMncs(@NonNull ArrayList<String> mccMncs) { - Objects.requireNonNull(mccMncs, "A non-null ArrayList of mccmncs must be set. An empty " - + "list is still accepted. Please read documentation in " - + "AvailableNetworkService to see consequences of an empty Arraylist."); - mMccMncs = mccMncs; + /** + * Sets the list of mccmncs associated with the subscription id. + * + * @param mccMncs nonull list of mccmncs. An empty List is still accepted. Please read + * documentation in {@link AvailableNetworkInfo} to see consequences of an empty List. + * @return the original Builder object. + */ + public @NonNull Builder setMccMncs(@NonNull List<String> mccMncs) { + Objects.requireNonNull(mccMncs, "A non-null List of mccmncs must be set. An empty " + + "List is still accepted. Please read documentation in " + + "AvailableNetworkInfo to see consequences of an empty List."); + mMccMncs = new ArrayList<>(mccMncs); return this; } + /** + * Sets the list of mccmncs associated with the subscription id. + * + * @param radioAccessSpecifiers nonull list of radioAccessSpecifiers. An empty List is still + * accepted. Please read documentation in {@link AvailableNetworkInfo} to see + * consequences of an empty List. + * @return the original Builder object. + */ public @NonNull Builder setRadioAccessSpecifiers( - @NonNull ArrayList<RadioAccessSpecifier> radioAccessSpecifiers) { - Objects.requireNonNull(radioAccessSpecifiers, "A non-null ArrayList of " - + "RadioAccessSpecifiers must be set. An empty list is still accepted. Please " - + "read documentation in AvailableNetworkService to see consequences of an " - + "empty Arraylist."); - mRadioAccessSpecifiers = radioAccessSpecifiers; + @NonNull List<RadioAccessSpecifier> radioAccessSpecifiers) { + Objects.requireNonNull(radioAccessSpecifiers, "A non-null List of " + + "RadioAccessSpecifiers must be set. An empty List is still accepted. Please " + + "read documentation in AvailableNetworkInfo to see consequences of an " + + "empty List."); + mRadioAccessSpecifiers = new ArrayList<>(radioAccessSpecifiers); return this; } + /** + * @return an AvailableNetworkInfo object with all the fields previously set by the Builder. + */ public @NonNull AvailableNetworkInfo build() { if (mSubId == Integer.MIN_VALUE) { throw new IllegalArgumentException("A valid subId must be set"); } - return new AvailableNetworkInfo(mSubId, mPriority, mMccMncs, mBands, + return new AvailableNetworkInfo(mSubId, mPriority, mMccMncs, new ArrayList<>(), mRadioAccessSpecifiers); } } diff --git a/telephony/java/android/telephony/CarrierConfigManager.java b/telephony/java/android/telephony/CarrierConfigManager.java index 0b427edfb699..894bb8e15333 100644 --- a/telephony/java/android/telephony/CarrierConfigManager.java +++ b/telephony/java/android/telephony/CarrierConfigManager.java @@ -3675,6 +3675,49 @@ public class CarrierConfigManager { "show_wifi_calling_icon_in_status_bar_bool"; /** + * Configuration to indicate that the carrier supports opportunistic data + * auto provisioning. Based on this flag, the device downloads and activates + * corresponding opportunistic profile. + */ + public static final String KEY_CARRIER_SUPPORTS_OPP_DATA_AUTO_PROVISIONING_BOOL = + "carrier_supports_opp_data_auto_provisioning_bool"; + + /** + * SMDP+ server address for downloading opportunistic eSIM profile. + * FQDN (Fully Qualified Domain Name) of the SM-DP+ (e.g., smdp.gsma.com) restricted to the + * Alphanumeric mode character set defined in table 5 of ISO/IEC 18004 [15] excluding '$'. + */ + public static final String KEY_SMDP_SERVER_ADDRESS_STRING = + "smdp_server_address_string"; + + /** + * This timer value is used in the eSIM Exponential Backoff download retry algorithm. + * Value should be in seconds. + * <OL> + * <LI>When the first download failure occurs, retry download after BACKOFF_TIMER_VALUE + * seconds.</LI> + * + * <LI>If download fails again then, retry after either BACKOFF_TIMER_VALUE, + * 2xBACKOFF_TIMER_VALUE, or 3xBACKOFF_TIMER_VALUE seconds.</LI> + * + * <LI>In general after the cth failed attempt, retry after k * BACKOFF_TIMER_VALUE + * seconds, where k is a random integer between 1 and 2^c − 1. Max c value is + * {@link #KEY_ESIM_MAX_DOWNLOAD_RETRY_ATTEMPTS_INT}</LI> + * </OL> + */ + public static final String KEY_ESIM_DOWNLOAD_RETRY_BACKOFF_TIMER_SEC_INT = + "esim_download_retry_backoff_timer_sec_int"; + + /** + * If eSIM profile download fails then, the number of retry attempts by UE + * will be based on this configuration. If download still fails even after the + * MAX attempts configured by this item then the retry is postponed until next + * device bootup. + */ + public static final String KEY_ESIM_MAX_DOWNLOAD_RETRY_ATTEMPTS_INT = + "esim_max_download_retry_attempts_int"; + + /** * Controls RSRP threshold at which OpportunisticNetworkService will decide whether * the opportunistic network is good enough for internet data. */ @@ -3884,6 +3927,30 @@ public class CarrierConfigManager { public static final String KEY_ENABLE_4G_OPPORTUNISTIC_NETWORK_SCAN_BOOL = "enabled_4g_opportunistic_network_scan_bool"; + /** + * Only relevant when the device supports opportunistic networks but does not support + * simultaneuous 5G+5G. Controls how long, in milliseconds, to wait before opportunistic network + * goes out of service before switching the 5G capability back to primary stack. The idea of + * waiting a few seconds is to minimize the calling of the expensive capability switching + * operation in the case where CBRS goes back into service shortly after going out of it. + * + * @hide + */ + public static final String KEY_TIME_TO_SWITCH_BACK_TO_PRIMARY_IF_OPPORTUNISTIC_OOS_LONG = + "time_to_switch_back_to_primary_if_opportunistic_oos_long"; + + /** + * Only relevant when the device supports opportunistic networks but does not support + * simultaneuous 5G+5G. Controls how long, in milliseconds, after 5G capability has switched back + * to primary stack due to opportunistic network being OOS. The idea is to minimizing the + * 'ping-ponging' effect where device is constantly witching capability back and forth between + * primary and opportunistic stack. + * + * @hide + */ + public static final String KEY_OPPORTUNISTIC_TIME_TO_SCAN_AFTER_CAPABILITY_SWITCH_TO_PRIMARY_LONG + = "opportunistic_time_to_scan_after_capability_switch_to_primary_long"; + /** * Indicates zero or more emergency number prefix(es), because some carrier requires * if users dial an emergency number address with a specific prefix, the combination of the @@ -5713,6 +5780,10 @@ public class CarrierConfigManager { sDefaults.putBoolean(KEY_UNMETERED_NR_SA_SUB6_BOOL, false); sDefaults.putBoolean(KEY_ASCII_7_BIT_SUPPORT_FOR_LONG_MESSAGE_BOOL, false); sDefaults.putBoolean(KEY_SHOW_WIFI_CALLING_ICON_IN_STATUS_BAR_BOOL, false); + sDefaults.putBoolean(KEY_CARRIER_SUPPORTS_OPP_DATA_AUTO_PROVISIONING_BOOL, false); + sDefaults.putString(KEY_SMDP_SERVER_ADDRESS_STRING, ""); + sDefaults.putInt(KEY_ESIM_MAX_DOWNLOAD_RETRY_ATTEMPTS_INT, 5); + sDefaults.putInt(KEY_ESIM_DOWNLOAD_RETRY_BACKOFF_TIMER_SEC_INT, 60); /* Default value is minimum RSRP level needed for SIGNAL_STRENGTH_GOOD */ sDefaults.putInt(KEY_OPPORTUNISTIC_NETWORK_ENTRY_THRESHOLD_RSRP_INT, -108); /* Default value is minimum RSRP level needed for SIGNAL_STRENGTH_MODERATE */ @@ -5756,6 +5827,10 @@ public class CarrierConfigManager { /* Default value is 2 seconds. */ sDefaults.putLong(KEY_OPPORTUNISTIC_NETWORK_5G_DATA_SWITCH_EXIT_HYSTERESIS_TIME_LONG, 2000); sDefaults.putBoolean(KEY_ENABLE_4G_OPPORTUNISTIC_NETWORK_SCAN_BOOL, true); + sDefaults.putInt(KEY_TIME_TO_SWITCH_BACK_TO_PRIMARY_IF_OPPORTUNISTIC_OOS_LONG, 60000); + sDefaults.putInt( + KEY_OPPORTUNISTIC_TIME_TO_SCAN_AFTER_CAPABILITY_SWITCH_TO_PRIMARY_LONG, + 120000); sDefaults.putAll(Gps.getDefaults()); sDefaults.putIntArray(KEY_CDMA_ENHANCED_ROAMING_INDICATOR_FOR_HOME_NETWORK_INT_ARRAY, new int[] { diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 2d8c201a3e71..6ffdc6b1696d 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -13621,15 +13621,18 @@ public class TelephonyManager { } /** - * It indicates whether modem is enabled or not per slot. - * It's the corresponding status of TelephonyManager.enableModemForSlot. + * Indicates whether or not there is a modem stack enabled for the given SIM slot. * * <p>Requires Permission: - * READ_PRIVILEGED_PHONE_STATE or - * {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} + * {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}, + * READ_PRIVILEGED_PHONE_STATE or that the calling app has carrier privileges (see + * {@link #hasCarrierPrivileges()}). + * * @param slotIndex which slot it's checking. */ - @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) + @SuppressAutoDoc // Blocked by b/72967236 - no support for carrier privileges + @RequiresPermission(anyOf = {android.Manifest.permission.READ_PHONE_STATE, + android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE}) public boolean isModemEnabledForSlot(int slotIndex) { try { ITelephony telephony = getITelephony(); diff --git a/tools/aapt2/util/Files.cpp b/tools/aapt2/util/Files.cpp index 5d57de6a9fb1..be09545abb45 100644 --- a/tools/aapt2/util/Files.cpp +++ b/tools/aapt2/util/Files.cpp @@ -154,7 +154,7 @@ StringPiece GetFilename(const StringPiece& path) { const char* end = path.end(); const char* last_dir_sep = path.begin(); for (const char* c = path.begin(); c != end; ++c) { - if (*c == sDirSep) { + if (*c == sDirSep || *c == sInvariantDirSep) { last_dir_sep = c + 1; } } diff --git a/tools/aapt2/util/Files.h b/tools/aapt2/util/Files.h index 481a4cdb6ad0..e50cb505bf66 100644 --- a/tools/aapt2/util/Files.h +++ b/tools/aapt2/util/Files.h @@ -41,6 +41,8 @@ constexpr const char sDirSep = '/'; constexpr const char sPathSep = ':'; #endif +constexpr const char sInvariantDirSep = '/'; + enum class FileType { kUnknown = 0, kNonexistant, |