Loading core/api/current.txt +1 −0 Original line number Original line Diff line number Diff line Loading @@ -12114,6 +12114,7 @@ package android.content.om { method @NonNull public void setResourceValue(@NonNull String, int, @NonNull String, @Nullable String); method @NonNull public void setResourceValue(@NonNull String, int, @NonNull String, @Nullable String); method @NonNull public void setResourceValue(@NonNull String, @NonNull android.os.ParcelFileDescriptor, @Nullable String); method @NonNull public void setResourceValue(@NonNull String, @NonNull android.os.ParcelFileDescriptor, @Nullable String); method @FlaggedApi("android.content.res.asset_file_descriptor_frro") @NonNull public void setResourceValue(@NonNull String, @NonNull android.content.res.AssetFileDescriptor, @Nullable String); method @FlaggedApi("android.content.res.asset_file_descriptor_frro") @NonNull public void setResourceValue(@NonNull String, @NonNull android.content.res.AssetFileDescriptor, @Nullable String); method @FlaggedApi("android.content.res.dimension_frro") public void setResourceValue(@NonNull String, float, int, @Nullable String); method public void setTargetOverlayable(@Nullable String); method public void setTargetOverlayable(@Nullable String); } } core/java/android/content/om/FabricatedOverlay.java +35 −0 Original line number Original line Diff line number Diff line Loading @@ -476,6 +476,20 @@ public class FabricatedOverlay { return entry; return entry; } } @NonNull private static FabricatedOverlayInternalEntry generateFabricatedOverlayInternalEntry( @NonNull String resourceName, float dimensionValue, @TypedValue.ComplexDimensionUnit int dimensionUnit, @Nullable String configuration) { final FabricatedOverlayInternalEntry entry = new FabricatedOverlayInternalEntry(); entry.resourceName = resourceName; entry.dataType = TypedValue.TYPE_DIMENSION; Preconditions.checkArgumentInRange(dimensionUnit, TypedValue.COMPLEX_UNIT_PX, TypedValue.COMPLEX_UNIT_MM, "dimensionUnit"); entry.data = TypedValue.createComplexDimension(dimensionValue, dimensionUnit); entry.configuration = configuration; return entry; } /** /** * Sets the resource value in the fabricated overlay for the integer-like types with the * Sets the resource value in the fabricated overlay for the integer-like types with the * configuration. * configuration. Loading Loading @@ -586,4 +600,25 @@ public class FabricatedOverlay { mOverlay.entries.add( mOverlay.entries.add( generateFabricatedOverlayInternalEntry(resourceName, value, configuration)); generateFabricatedOverlayInternalEntry(resourceName, value, configuration)); } } /** * Sets the resource value in the fabricated overlay for the dimension type with the * configuration. * * @param resourceName name of the target resource to overlay (in the form * [package]:type/entry) * @param dimensionValue the float representing the dimension value * @param dimensionUnit the integer representing the dimension unit * @param configuration The string representation of the config this overlay is enabled for */ @FlaggedApi(android.content.res.Flags.FLAG_DIMENSION_FRRO) public void setResourceValue( @NonNull String resourceName, float dimensionValue, @TypedValue.ComplexDimensionUnit int dimensionUnit, @Nullable String configuration) { ensureValidResourceName(resourceName); mOverlay.entries.add(generateFabricatedOverlayInternalEntry(resourceName, dimensionValue, dimensionUnit, configuration)); } } } core/java/android/content/res/flags.aconfig +8 −0 Original line number Original line Diff line number Diff line Loading @@ -66,3 +66,11 @@ flag { # This flag is read at boot time. # This flag is read at boot time. is_fixed_read_only: true is_fixed_read_only: true } } flag { name: "dimension_frro" is_exported: true namespace: "resource_manager" description: "Feature flag for passing a dimension to create an frro" bug: "369672322" } Loading
core/api/current.txt +1 −0 Original line number Original line Diff line number Diff line Loading @@ -12114,6 +12114,7 @@ package android.content.om { method @NonNull public void setResourceValue(@NonNull String, int, @NonNull String, @Nullable String); method @NonNull public void setResourceValue(@NonNull String, int, @NonNull String, @Nullable String); method @NonNull public void setResourceValue(@NonNull String, @NonNull android.os.ParcelFileDescriptor, @Nullable String); method @NonNull public void setResourceValue(@NonNull String, @NonNull android.os.ParcelFileDescriptor, @Nullable String); method @FlaggedApi("android.content.res.asset_file_descriptor_frro") @NonNull public void setResourceValue(@NonNull String, @NonNull android.content.res.AssetFileDescriptor, @Nullable String); method @FlaggedApi("android.content.res.asset_file_descriptor_frro") @NonNull public void setResourceValue(@NonNull String, @NonNull android.content.res.AssetFileDescriptor, @Nullable String); method @FlaggedApi("android.content.res.dimension_frro") public void setResourceValue(@NonNull String, float, int, @Nullable String); method public void setTargetOverlayable(@Nullable String); method public void setTargetOverlayable(@Nullable String); } }
core/java/android/content/om/FabricatedOverlay.java +35 −0 Original line number Original line Diff line number Diff line Loading @@ -476,6 +476,20 @@ public class FabricatedOverlay { return entry; return entry; } } @NonNull private static FabricatedOverlayInternalEntry generateFabricatedOverlayInternalEntry( @NonNull String resourceName, float dimensionValue, @TypedValue.ComplexDimensionUnit int dimensionUnit, @Nullable String configuration) { final FabricatedOverlayInternalEntry entry = new FabricatedOverlayInternalEntry(); entry.resourceName = resourceName; entry.dataType = TypedValue.TYPE_DIMENSION; Preconditions.checkArgumentInRange(dimensionUnit, TypedValue.COMPLEX_UNIT_PX, TypedValue.COMPLEX_UNIT_MM, "dimensionUnit"); entry.data = TypedValue.createComplexDimension(dimensionValue, dimensionUnit); entry.configuration = configuration; return entry; } /** /** * Sets the resource value in the fabricated overlay for the integer-like types with the * Sets the resource value in the fabricated overlay for the integer-like types with the * configuration. * configuration. Loading Loading @@ -586,4 +600,25 @@ public class FabricatedOverlay { mOverlay.entries.add( mOverlay.entries.add( generateFabricatedOverlayInternalEntry(resourceName, value, configuration)); generateFabricatedOverlayInternalEntry(resourceName, value, configuration)); } } /** * Sets the resource value in the fabricated overlay for the dimension type with the * configuration. * * @param resourceName name of the target resource to overlay (in the form * [package]:type/entry) * @param dimensionValue the float representing the dimension value * @param dimensionUnit the integer representing the dimension unit * @param configuration The string representation of the config this overlay is enabled for */ @FlaggedApi(android.content.res.Flags.FLAG_DIMENSION_FRRO) public void setResourceValue( @NonNull String resourceName, float dimensionValue, @TypedValue.ComplexDimensionUnit int dimensionUnit, @Nullable String configuration) { ensureValidResourceName(resourceName); mOverlay.entries.add(generateFabricatedOverlayInternalEntry(resourceName, dimensionValue, dimensionUnit, configuration)); } } }
core/java/android/content/res/flags.aconfig +8 −0 Original line number Original line Diff line number Diff line Loading @@ -66,3 +66,11 @@ flag { # This flag is read at boot time. # This flag is read at boot time. is_fixed_read_only: true is_fixed_read_only: true } } flag { name: "dimension_frro" is_exported: true namespace: "resource_manager" description: "Feature flag for passing a dimension to create an frro" bug: "369672322" }