Merge "Add more uses on vendor hidden API list" into pi-dev
diff --git a/Android.mk b/Android.mk
index b630c3f..e219661 100644
--- a/Android.mk
+++ b/Android.mk
@@ -861,14 +861,11 @@
# ==== hiddenapi lists =======================================
-# Copy blacklist and light greylist over into the build folder.
+# Copy light and dark greylist over into the build folder.
# This is for ART buildbots which need to mock these lists and have alternative
# rules for building them. Other rules in the build system should depend on the
# files in the build folder.
-$(eval $(call copy-one-file,frameworks/base/config/hiddenapi-blacklist.txt,\
- $(INTERNAL_PLATFORM_HIDDENAPI_BLACKLIST)))
-
# Automatically add all methods which match the following signatures.
# These need to be greylisted in order to allow applications to write their
# own serializers.
@@ -891,25 +888,31 @@
<(grep -E "\->("$(subst $(space),"|",$(REGEX_SERIALIZATION))")$$" $(PRIVATE_API)) \
> $@
+$(eval $(call copy-one-file,frameworks/base/config/hiddenapi-dark-greylist.txt,\
+ $(INTERNAL_PLATFORM_HIDDENAPI_DARK_GREYLIST)))
+
# Generate dark greylist as private API minus (blacklist plus light greylist).
-$(INTERNAL_PLATFORM_HIDDENAPI_DARK_GREYLIST): PRIVATE_API := $(INTERNAL_PLATFORM_PRIVATE_DEX_API_FILE)
-$(INTERNAL_PLATFORM_HIDDENAPI_DARK_GREYLIST): BLACKLIST := $(INTERNAL_PLATFORM_HIDDENAPI_BLACKLIST)
-$(INTERNAL_PLATFORM_HIDDENAPI_DARK_GREYLIST): LIGHT_GREYLIST := $(INTERNAL_PLATFORM_HIDDENAPI_LIGHT_GREYLIST)
-$(INTERNAL_PLATFORM_HIDDENAPI_DARK_GREYLIST): $(INTERNAL_PLATFORM_PRIVATE_DEX_API_FILE) \
- $(INTERNAL_PLATFORM_HIDDENAPI_BLACKLIST) \
- $(INTERNAL_PLATFORM_HIDDENAPI_LIGHT_GREYLIST)
- if [ ! -z "`comm -12 <(sort $(BLACKLIST)) <(sort $(LIGHT_GREYLIST))`" ]; then \
- echo "There should be no overlap between $(BLACKLIST) and $(LIGHT_GREYLIST)" 1>&2; \
+$(INTERNAL_PLATFORM_HIDDENAPI_BLACKLIST): PRIVATE_API := $(INTERNAL_PLATFORM_PRIVATE_DEX_API_FILE)
+$(INTERNAL_PLATFORM_HIDDENAPI_BLACKLIST): LIGHT_GREYLIST := $(INTERNAL_PLATFORM_HIDDENAPI_LIGHT_GREYLIST)
+$(INTERNAL_PLATFORM_HIDDENAPI_BLACKLIST): DARK_GREYLIST := $(INTERNAL_PLATFORM_HIDDENAPI_DARK_GREYLIST)
+$(INTERNAL_PLATFORM_HIDDENAPI_BLACKLIST): $(INTERNAL_PLATFORM_PRIVATE_DEX_API_FILE) \
+ $(INTERNAL_PLATFORM_HIDDENAPI_LIGHT_GREYLIST) \
+ $(INTERNAL_PLATFORM_HIDDENAPI_DARK_GREYLIST)
+ if [ ! -z "`comm -12 <(sort $(LIGHT_GREYLIST)) <(sort $(DARK_GREYLIST))`" ]; then \
+ echo "There should be no overlap between $(LIGHT_GREYLIST) and $(DARK_GREYLIST)" 1>&2; \
+ comm -12 <(sort $(LIGHT_GREYLIST)) <(sort $(DARK_GREYLIST)) 1>&2; \
exit 1; \
- elif [ ! -z "`comm -13 <(sort $(PRIVATE_API)) <(sort $(BLACKLIST))`" ]; then \
- echo "$(BLACKLIST) must be a subset of $(PRIVATE_API)" 1>&2; \
- exit 2; \
elif [ ! -z "`comm -13 <(sort $(PRIVATE_API)) <(sort $(LIGHT_GREYLIST))`" ]; then \
echo "$(LIGHT_GREYLIST) must be a subset of $(PRIVATE_API)" 1>&2; \
+ comm -13 <(sort $(PRIVATE_API)) <(sort $(LIGHT_GREYLIST)) 1>&2; \
+ exit 2; \
+ elif [ ! -z "`comm -13 <(sort $(PRIVATE_API)) <(sort $(DARK_GREYLIST))`" ]; then \
+ echo "$(DARK_GREYLIST) must be a subset of $(PRIVATE_API)" 1>&2; \
+ comm -13 <(sort $(PRIVATE_API)) <(sort $(DARK_GREYLIST)) 1>&2; \
exit 3; \
fi
- comm -23 <(sort $(PRIVATE_API)) <(sort $(BLACKLIST) $(LIGHT_GREYLIST)) > $@
+ comm -23 <(sort $(PRIVATE_API)) <(sort $(LIGHT_GREYLIST) $(DARK_GREYLIST)) > $@
# Include subdirectory makefiles
# ============================================================
diff --git a/config/hiddenapi-light-greylist.txt b/config/hiddenapi-light-greylist.txt
index 8e2e43c..4a4e36a 100644
--- a/config/hiddenapi-light-greylist.txt
+++ b/config/hiddenapi-light-greylist.txt
@@ -369,6 +369,7 @@
Landroid/bluetooth/BluetoothGatt;->mAuthRetryState:I
Landroid/bluetooth/BluetoothGatt;->refresh()Z
Landroid/bluetooth/BluetoothHeadset;->close()V
+Landroid/bluetooth/BluetoothMapClient;->sendMessage(Landroid/bluetooth/BluetoothDevice;[Landroid/net/Uri;Ljava/lang/String;Landroid/app/PendingIntent;Landroid/app/PendingIntent;)Z
Landroid/bluetooth/BluetoothPan;->isTetheringOn()Z
Landroid/bluetooth/BluetoothPan;->setBluetoothTethering(Z)V
Landroid/bluetooth/BluetoothUuid;->RESERVED_UUIDS:[Landroid/os/ParcelUuid;
diff --git a/core/java/android/app/ActivityManager.java b/core/java/android/app/ActivityManager.java
index 3047cdb..289a4dd 100644
--- a/core/java/android/app/ActivityManager.java
+++ b/core/java/android/app/ActivityManager.java
@@ -959,8 +959,10 @@
* @hide
*/
static public boolean isHighEndGfx() {
- return !isLowRamDeviceStatic() &&
- !Resources.getSystem().getBoolean(com.android.internal.R.bool.config_avoidGfxAccel);
+ return !isLowRamDeviceStatic()
+ && !RoSystemProperties.CONFIG_AVOID_GFX_ACCEL
+ && !Resources.getSystem()
+ .getBoolean(com.android.internal.R.bool.config_avoidGfxAccel);
}
/**
diff --git a/core/java/android/view/WindowManager.java b/core/java/android/view/WindowManager.java
index abc19d0..abd33f3 100644
--- a/core/java/android/view/WindowManager.java
+++ b/core/java/android/view/WindowManager.java
@@ -2220,7 +2220,7 @@
@IntDef(
flag = true,
value = {LAYOUT_IN_DISPLAY_CUTOUT_MODE_DEFAULT,
- LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS,
+ LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES,
LAYOUT_IN_DISPLAY_CUTOUT_MODE_NEVER})
@interface LayoutInDisplayCutoutMode {}
@@ -2231,10 +2231,11 @@
* Defaults to {@link #LAYOUT_IN_DISPLAY_CUTOUT_MODE_DEFAULT}.
*
* @see #LAYOUT_IN_DISPLAY_CUTOUT_MODE_DEFAULT
- * @see #LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS
+ * @see #LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES
* @see #LAYOUT_IN_DISPLAY_CUTOUT_MODE_NEVER
* @see DisplayCutout
- * @see android.R.attr#layoutInDisplayCutoutMode
+ * @see android.R.attr#windowLayoutInDisplayCutoutMode
+ * android:windowLayoutInDisplayCutoutMode
*/
@LayoutInDisplayCutoutMode
public int layoutInDisplayCutoutMode = LAYOUT_IN_DISPLAY_CUTOUT_MODE_DEFAULT;
@@ -2245,10 +2246,10 @@
* laid out such that it does not overlap with the {@link DisplayCutout} area.
*
* <p>
- * In practice, this means that if the window did not set FLAG_FULLSCREEN or
- * SYSTEM_UI_FLAG_FULLSCREEN, it can extend into the cutout area in portrait if the cutout
- * is at the top edge. Similarly for SYSTEM_UI_FLAG_HIDE_NAVIGATION and a cutout at the
- * bottom of the screen.
+ * In practice, this means that if the window did not set {@link #FLAG_FULLSCREEN} or
+ * {@link View#SYSTEM_UI_FLAG_FULLSCREEN}, it can extend into the cutout area in portrait
+ * if the cutout is at the top edge. Similarly for
+ * {@link View#SYSTEM_UI_FLAG_HIDE_NAVIGATION} and a cutout at the bottom of the screen.
* Otherwise (i.e. fullscreen or landscape) it is laid out such that it does not overlap the
* cutout area.
*
@@ -2258,6 +2259,9 @@
*
* @see DisplayCutout
* @see WindowInsets
+ * @see #layoutInDisplayCutoutMode
+ * @see android.R.attr#windowLayoutInDisplayCutoutMode
+ * android:windowLayoutInDisplayCutoutMode
*/
public static final int LAYOUT_IN_DISPLAY_CUTOUT_MODE_DEFAULT = 0;
@@ -2279,8 +2283,40 @@
* The window must make sure that no important content overlaps with the
* {@link DisplayCutout}.
*
+ * <p>
+ * In this mode, the window extends under cutouts on the short edge of the display in both
+ * portrait and landscape, regardless of whether the window is hiding the system bars:<br/>
+ * <img src="{@docRoot}reference/android/images/display_cutout/short_edge/fullscreen_top_no_letterbox.png"
+ * height="720"
+ * alt="Screenshot of a fullscreen activity on a display with a cutout at the top edge in
+ * portrait, no letterbox is applied."/>
+ *
+ * <img src="{@docRoot}reference/android/images/display_cutout/short_edge/landscape_top_no_letterbox.png"
+ * width="720"
+ * alt="Screenshot of an activity on a display with a cutout at the top edge in landscape,
+ * no letterbox is applied."/>
+ *
+ * <p>
+ * A cutout in the corner is considered to be on the short edge: <br/>
+ * <img src="{@docRoot}reference/android/images/display_cutout/short_edge/fullscreen_corner_no_letterbox.png"
+ * height="720"
+ * alt="Screenshot of a fullscreen activity on a display with a cutout in the corner in
+ * portrait, no letterbox is applied."/>
+ *
+ * <p>
+ * On the other hand, should the cutout be on the long edge of the display, a letterbox will
+ * be applied such that the window does not extend into the cutout on either long edge:
+ * <br/>
+ * <img src="{@docRoot}reference/android/images/display_cutout/short_edge/portrait_side_letterbox.png"
+ * height="720"
+ * alt="Screenshot of an activity on a display with a cutout on the long edge in portrait,
+ * letterbox is applied."/>
+ *
* @see DisplayCutout
* @see WindowInsets#getDisplayCutout()
+ * @see #layoutInDisplayCutoutMode
+ * @see android.R.attr#windowLayoutInDisplayCutoutMode
+ * android:windowLayoutInDisplayCutoutMode
*/
public static final int LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES = 1;
@@ -2288,12 +2324,14 @@
* The window is never allowed to overlap with the DisplayCutout area.
*
* <p>
- * This should be used with windows that transiently set SYSTEM_UI_FLAG_FULLSCREEN to
- * avoid a relayout of the window when the flag is set or cleared.
+ * This should be used with windows that transiently set
+ * {@link View#SYSTEM_UI_FLAG_FULLSCREEN} or {@link View#SYSTEM_UI_FLAG_HIDE_NAVIGATION}
+ * to avoid a relayout of the window when the respective flag is set or cleared.
*
* @see DisplayCutout
- * @see View#SYSTEM_UI_FLAG_FULLSCREEN SYSTEM_UI_FLAG_FULLSCREEN
- * @see View#SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
+ * @see #layoutInDisplayCutoutMode
+ * @see android.R.attr#windowLayoutInDisplayCutoutMode
+ * android:windowLayoutInDisplayCutoutMode
*/
public static final int LAYOUT_IN_DISPLAY_CUTOUT_MODE_NEVER = 2;
diff --git a/core/java/com/android/internal/os/RoSystemProperties.java b/core/java/com/android/internal/os/RoSystemProperties.java
index 89a4e17..dc660a4 100644
--- a/core/java/com/android/internal/os/RoSystemProperties.java
+++ b/core/java/com/android/internal/os/RoSystemProperties.java
@@ -31,6 +31,8 @@
SystemProperties.get("ro.control_privapp_permissions");
// ------ ro.config.* -------- //
+ public static final boolean CONFIG_AVOID_GFX_ACCEL =
+ SystemProperties.getBoolean("ro.config.avoid_gfx_accel", false);
public static final boolean CONFIG_LOW_RAM =
SystemProperties.getBoolean("ro.config.low_ram", false);
public static final boolean CONFIG_SMALL_BATTERY =
diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml
index 3135455..aceba08 100644
--- a/core/res/res/values/attrs.xml
+++ b/core/res/res/values/attrs.xml
@@ -2123,44 +2123,48 @@
<!-- Controls how the window is laid out if there is a {@code DisplayCutout}.
<p>
Defaults to {@code default}.
-
- @see android.view.WindowManager.LayoutParams#LAYOUT_IN_DISPLAY_CUTOUT_MODE_DEFAULT
- @see android.view.WindowManager.LayoutParams#LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES
- @see android.view.WindowManager.LayoutParams#LAYOUT_IN_DISPLAY_CUTOUT_MODE_NEVER
- @see android.view.DisplayCutout
- @see android.R.attr#layoutInDisplayCutoutMode -->
+ <p>
+ See also
+ {@link android.view.WindowManager.LayoutParams#layoutInDisplayCutoutMode
+ WindowManager.LayoutParams.layoutInDisplayCutoutMode},
+ {@link android.view.WindowManager.LayoutParams#LAYOUT_IN_DISPLAY_CUTOUT_MODE_DEFAULT},
+ {@link android.view.WindowManager.LayoutParams#LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES},
+ {@link android.view.WindowManager.LayoutParams#LAYOUT_IN_DISPLAY_CUTOUT_MODE_NEVER},
+ and {@link android.view.DisplayCutout DisplayCutout}
+ -->
<attr name="windowLayoutInDisplayCutoutMode">
- <!-- The window is allowed to extend into the {@code DisplayCutout} area, only if the
- {@code DisplayCutout} is fully contained within a system bar. Otherwise, the window is
- laid out such that it does not overlap with the {@code DisplayCutout} area.
-
- @see android.view.DisplayCutout
- @see android.view.WindowManager.LayoutParams#LAYOUT_IN_DISPLAY_CUTOUT_MODE_DEFAULT
+ <!-- <p>
+ The window is allowed to extend into the <code>DisplayCutout</code> area, only if
+ the <code>DisplayCutout</code> is fully contained within a system bar. Otherwise, the
+ window is laid out such that it does not overlap with the <code>DisplayCutout</code>
+ area.
+ <p>
+ Corresponds to <code>LAYOUT_IN_DISPLAY_CUTOUT_MODE_DEFAULT</code>.
-->
<enum name="default" value="0" />
- <!--
- The window is always allowed to extend into the {@code DisplayCutout} areas on the short
- edges of the screen even if fullscreen or in landscape.
- The window will never extend into a {@link DisplayCutout} area on the long edges of the
- screen.
+ <!-- <p>
+ The window is always allowed to extend into the <code>DisplayCutout</code> areas on the
+ short edges of the screen even if fullscreen or in landscape.
+ The window will never extend into a <code>DisplayCutout</code> area on the long edges of
+ the screen.
<p>
The window must make sure that no important content overlaps with the
- {@link DisplayCutout}.
-
- @see android.view.DisplayCutout
- @see android.view.WindowManager.LayoutParams#LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES
+ <code>DisplayCutout</code>.
+ <p>
+ Corresponds to <code>LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES</code>.
-->
<enum name="shortEdges" value="1" />
- <!-- Use {@code shortEdges} instead. This is temporarily here to unblock pushing the SDK
- until all usages have been migrated to {@code shortEdges} -->
+ <!-- Use <code>shortEdges</code> instead. This is temporarily here to unblock pushing
+ the SDK until all usages have been migrated to <code>shortEdges</code> -->
<enum name="always" value="1" />
- <!-- The window is never allowed to overlap with the DisplayCutout area.
+ <!-- <p>
+ The window is never allowed to overlap with the <code>DisplayCutout</code> area.
<p>
- This should be used with windows that transiently set {@code SYSTEM_UI_FLAG_FULLSCREEN}
- to avoid a relayout of the window when the flag is set or cleared.
-
- @see android.view.DisplayCutout
- @see android.view.WindowManager.LayoutParams#LAYOUT_IN_DISPLAY_CUTOUT_MODE_NEVER
+ This should be used with windows that transiently set
+ <code>SYSTEM_UI_FLAG_FULLSCREEN</code> to avoid a relayout of the window when the
+ flag is set or cleared.
+ <p>
+ Corresponds to <code>LAYOUT_IN_DISPLAY_CUTOUT_MODE_NEVER</code>.
-->
<enum name="never" value="2" />
</attr>
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index a52a089..66d25df 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -1343,30 +1343,6 @@
<integer-array name="config_autoBrightnessKeyboardBacklightValues">
</integer-array>
- <!-- Array of light sensor lux values to define the minimum brightness curve, which guarantees
- that any curve that dips below it is rejected by the system.
- This prevents auto-brightness from setting the screen so dark as to prevent the user from
- disabling auto-brightness or reseting the brightness curve via ADB.
-
- The control points must be strictly increasing. Each control point corresponds to an entry
- in the minimum brightness nits array. -->
- <integer-array name="config_autoBrightnessMinimumBrightnessCurveLux">
- <item>2000</item>
- <item>4000</item>
- </integer-array>
-
- <!-- Array of desired screen brightness in nits corresponding to the lux values
- in the config_autoBrightnessMinimumBrightnessCurveLux array.
-
- This array should have size one greater than the size of the
- config_autoBrightnessMinimumBrightnessCurveLux array. The values must be non-negative and
- non-decreasing. -->
- <array name="config_autoBrightnessMinimumBrightnessCurveNits">
- <item>1.0</item>
- <item>50.0</item>
- <item>90.0</item>
- </array>
-
<!-- Array of hysteresis constraint values for brightening, represented as tenths of a
percent. The length of this array is assumed to be one greater than
config_dynamicHysteresisLuxLevels. The brightening threshold is calculated as
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index 03acd5c..2f7ae27 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -1794,8 +1794,6 @@
<java-symbol type="array" name="config_autoBrightnessKeyboardBacklightValues" />
<java-symbol type="array" name="config_autoBrightnessLcdBacklightValues" />
<java-symbol type="array" name="config_autoBrightnessLevels" />
- <java-symbol type="array" name="config_autoBrightnessMinimumBrightnessCurveLux" />
- <java-symbol type="array" name="config_autoBrightnessMinimumBrightnessCurveNits" />
<java-symbol type="array" name="config_dynamicHysteresisBrightLevels" />
<java-symbol type="array" name="config_dynamicHysteresisDarkLevels" />
<java-symbol type="array" name="config_dynamicHysteresisLuxLevels" />
diff --git a/docs/html/reference/images/display_cutout/default_mode/fullscreen_letterbox.png b/docs/html/reference/images/display_cutout/default_mode/fullscreen_letterbox.png
new file mode 100644
index 0000000..8602290
--- /dev/null
+++ b/docs/html/reference/images/display_cutout/default_mode/fullscreen_letterbox.png
Binary files differ
diff --git a/docs/html/reference/images/display_cutout/default_mode/landscape.png b/docs/html/reference/images/display_cutout/default_mode/landscape.png
new file mode 100644
index 0000000..be112f4
--- /dev/null
+++ b/docs/html/reference/images/display_cutout/default_mode/landscape.png
Binary files differ
diff --git a/docs/html/reference/images/display_cutout/default_mode/landscape_corner.png b/docs/html/reference/images/display_cutout/default_mode/landscape_corner.png
new file mode 100644
index 0000000..7aa92b4
--- /dev/null
+++ b/docs/html/reference/images/display_cutout/default_mode/landscape_corner.png
Binary files differ
diff --git a/docs/html/reference/images/display_cutout/default_mode/portrait.png b/docs/html/reference/images/display_cutout/default_mode/portrait.png
new file mode 100644
index 0000000..6392ad5
--- /dev/null
+++ b/docs/html/reference/images/display_cutout/default_mode/portrait.png
Binary files differ
diff --git a/docs/html/reference/images/display_cutout/default_mode/portrait_corner.png b/docs/html/reference/images/display_cutout/default_mode/portrait_corner.png
new file mode 100644
index 0000000..dc8e6d0
--- /dev/null
+++ b/docs/html/reference/images/display_cutout/default_mode/portrait_corner.png
Binary files differ
diff --git a/docs/html/reference/images/display_cutout/never_mode/landscape.png b/docs/html/reference/images/display_cutout/never_mode/landscape.png
new file mode 100644
index 0000000..be112f4
--- /dev/null
+++ b/docs/html/reference/images/display_cutout/never_mode/landscape.png
Binary files differ
diff --git a/docs/html/reference/images/display_cutout/never_mode/portrait_top_letterbox.png b/docs/html/reference/images/display_cutout/never_mode/portrait_top_letterbox.png
new file mode 100644
index 0000000..fc7dfcf
--- /dev/null
+++ b/docs/html/reference/images/display_cutout/never_mode/portrait_top_letterbox.png
Binary files differ
diff --git a/docs/html/reference/images/display_cutout/short_edge/fullscreen_corner_no_letterbox.png b/docs/html/reference/images/display_cutout/short_edge/fullscreen_corner_no_letterbox.png
new file mode 100644
index 0000000..09f942d
--- /dev/null
+++ b/docs/html/reference/images/display_cutout/short_edge/fullscreen_corner_no_letterbox.png
Binary files differ
diff --git a/docs/html/reference/images/display_cutout/short_edge/fullscreen_side_letterbox.png b/docs/html/reference/images/display_cutout/short_edge/fullscreen_side_letterbox.png
new file mode 100644
index 0000000..9aafc58
--- /dev/null
+++ b/docs/html/reference/images/display_cutout/short_edge/fullscreen_side_letterbox.png
Binary files differ
diff --git a/docs/html/reference/images/display_cutout/short_edge/fullscreen_top_no_letterbox.png b/docs/html/reference/images/display_cutout/short_edge/fullscreen_top_no_letterbox.png
new file mode 100644
index 0000000..75e913b
--- /dev/null
+++ b/docs/html/reference/images/display_cutout/short_edge/fullscreen_top_no_letterbox.png
Binary files differ
diff --git a/docs/html/reference/images/display_cutout/short_edge/landscape_corner.png b/docs/html/reference/images/display_cutout/short_edge/landscape_corner.png
new file mode 100644
index 0000000..d9e0f99
--- /dev/null
+++ b/docs/html/reference/images/display_cutout/short_edge/landscape_corner.png
Binary files differ
diff --git a/docs/html/reference/images/display_cutout/short_edge/landscape_sideboxed.png b/docs/html/reference/images/display_cutout/short_edge/landscape_sideboxed.png
new file mode 100644
index 0000000..9d44493
--- /dev/null
+++ b/docs/html/reference/images/display_cutout/short_edge/landscape_sideboxed.png
Binary files differ
diff --git a/docs/html/reference/images/display_cutout/short_edge/landscape_top_no_letterbox.png b/docs/html/reference/images/display_cutout/short_edge/landscape_top_no_letterbox.png
new file mode 100644
index 0000000..ac023c5
--- /dev/null
+++ b/docs/html/reference/images/display_cutout/short_edge/landscape_top_no_letterbox.png
Binary files differ
diff --git a/docs/html/reference/images/display_cutout/short_edge/portrait_side_letterbox.png b/docs/html/reference/images/display_cutout/short_edge/portrait_side_letterbox.png
new file mode 100644
index 0000000..50228db
--- /dev/null
+++ b/docs/html/reference/images/display_cutout/short_edge/portrait_side_letterbox.png
Binary files differ
diff --git a/packages/ExtServices/src/android/ext/services/notification/ChannelImpressions.java b/packages/ExtServices/src/android/ext/services/notification/ChannelImpressions.java
index 4ad4b24..de2659f 100644
--- a/packages/ExtServices/src/android/ext/services/notification/ChannelImpressions.java
+++ b/packages/ExtServices/src/android/ext/services/notification/ChannelImpressions.java
@@ -30,7 +30,7 @@
private static final String TAG = "ExtAssistant.CI";
private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
- static final double DISMISS_TO_VIEW_RATIO_LIMIT = .8;
+ static final double DISMISS_TO_VIEW_RATIO_LIMIT = .4;
static final int STREAK_LIMIT = 2;
static final String ATT_DISMISSALS = "dismisses";
static final String ATT_VIEWS = "views";
diff --git a/services/core/java/com/android/server/display/BrightnessMappingStrategy.java b/services/core/java/com/android/server/display/BrightnessMappingStrategy.java
index 711d40b..4313d17 100644
--- a/services/core/java/com/android/server/display/BrightnessMappingStrategy.java
+++ b/services/core/java/com/android/server/display/BrightnessMappingStrategy.java
@@ -60,14 +60,8 @@
int[] backlightRange = resources.getIntArray(
com.android.internal.R.array.config_screenBrightnessBacklight);
- float[] minimumBrightnessCurveLux = getLuxLevels(resources.getIntArray(
- com.android.internal.R.array.config_autoBrightnessMinimumBrightnessCurveLux));
- float[] minimumBrightnessCurveNits = getFloatArray(resources.obtainTypedArray(
- com.android.internal.R.array.config_autoBrightnessMinimumBrightnessCurveNits));
-
if (isValidMapping(nitsRange, backlightRange)
- && isValidMapping(luxLevels, brightnessLevelsNits)
- && isValidMapping(minimumBrightnessCurveLux, minimumBrightnessCurveNits)) {
+ && isValidMapping(luxLevels, brightnessLevelsNits)) {
int minimumBacklight = resources.getInteger(
com.android.internal.R.integer.config_screenBrightnessSettingMinimum);
int maximumBacklight = resources.getInteger(
@@ -79,8 +73,7 @@
}
BrightnessConfiguration.Builder builder = new BrightnessConfiguration.Builder();
builder.setCurve(luxLevels, brightnessLevelsNits);
- return new PhysicalMappingStrategy(builder.build(), nitsRange, backlightRange,
- minimumBrightnessCurveLux, minimumBrightnessCurveNits);
+ return new PhysicalMappingStrategy(builder.build(), nitsRange, backlightRange);
} else if (isValidMapping(luxLevels, brightnessLevelsBacklight)) {
return new SimpleMappingStrategy(luxLevels, brightnessLevelsBacklight);
} else {
@@ -455,11 +448,8 @@
private float mUserLux;
private float mUserBrightness;
- private final Spline mMinimumBrightnessCurve;
-
public PhysicalMappingStrategy(BrightnessConfiguration config,
- float[] nits, int[] backlight, float[] minimumBrightnessCurveLux,
- float[] minimumBrightnessCurveNits) {
+ float[] nits, int[] backlight) {
Preconditions.checkArgument(nits.length != 0 && backlight.length != 0,
"Nits and backlight arrays must not be empty!");
Preconditions.checkArgument(nits.length == backlight.length,
@@ -479,9 +469,6 @@
normalizedBacklight[i] = normalizeAbsoluteBrightness(backlight[i]);
}
- mMinimumBrightnessCurve = Spline.createSpline(
- minimumBrightnessCurveLux, minimumBrightnessCurveNits);
-
mNitsToBacklightSpline = createSpline(nits, normalizedBacklight);
mBacklightToNitsSpline = createSpline(normalizedBacklight, nits);
@@ -497,7 +484,7 @@
if (config.equals(mConfig)) {
return false;
}
- validateBrightnessConfiguration(config);
+
Pair<float[], float[]> curve = config.getCurve();
mBrightnessSpline = createSpline(curve.first /*lux*/, curve.second /*nits*/);
mConfig = config;
@@ -562,24 +549,5 @@
pw.println(" mUserLux=" + mUserLux);
pw.println(" mUserBrightness=" + mUserBrightness);
}
-
- private void validateBrightnessConfiguration(BrightnessConfiguration config) {
- Pair<float[], float[]> curve = config.getCurve();
- Spline brightnessSpline = Spline.createSpline(curve.first, curve.second);
- if (isBrightnessSplineTooDark(brightnessSpline)) {
- throw new IllegalArgumentException("brightness curve is too dark");
- }
- }
-
- private boolean isBrightnessSplineTooDark(Spline brightnessSpline) {
- float[] lux = mDefaultConfig.getCurve().first;
- for (int i = 0; i < lux.length; i++) {
- if (brightnessSpline.interpolate(lux[i]) <
- mMinimumBrightnessCurve.interpolate(lux[i])) {
- return true;
- }
- }
- return false;
- }
}
}
diff --git a/services/core/java/com/android/server/wm/AnimatingAppWindowTokenRegistry.java b/services/core/java/com/android/server/wm/AnimatingAppWindowTokenRegistry.java
index ae343da..416469b 100644
--- a/services/core/java/com/android/server/wm/AnimatingAppWindowTokenRegistry.java
+++ b/services/core/java/com/android/server/wm/AnimatingAppWindowTokenRegistry.java
@@ -19,6 +19,7 @@
import android.util.ArrayMap;
import android.util.ArraySet;
+import java.io.PrintWriter;
import java.util.ArrayList;
/**
@@ -88,4 +89,13 @@
}
mTmpRunnableList.clear();
}
+
+ void dump(PrintWriter pw, String header, String prefix) {
+ if (!mAnimatingTokens.isEmpty() || !mFinishedTokens.isEmpty()) {
+ pw.print(prefix); pw.println(header);
+ prefix = prefix + " ";
+ pw.print(prefix); pw.print("mAnimatingTokens="); pw.println(mAnimatingTokens);
+ pw.print(prefix); pw.print("mFinishedTokens="); pw.println(mFinishedTokens);
+ }
+ }
}
diff --git a/services/core/java/com/android/server/wm/RemoteAnimationController.java b/services/core/java/com/android/server/wm/RemoteAnimationController.java
index 3e7feda..379a1a1 100644
--- a/services/core/java/com/android/server/wm/RemoteAnimationController.java
+++ b/services/core/java/com/android/server/wm/RemoteAnimationController.java
@@ -134,11 +134,18 @@
private RemoteAnimationTarget[] createAnimations() {
final ArrayList<RemoteAnimationTarget> targets = new ArrayList<>();
for (int i = mPendingAnimations.size() - 1; i >= 0; i--) {
+ final RemoteAnimationAdapterWrapper wrapper = mPendingAnimations.get(i);
final RemoteAnimationTarget target =
mPendingAnimations.get(i).createRemoteAppAnimation();
if (target != null) {
targets.add(target);
} else {
+
+ // We can't really start an animation but we still need to make sure to finish the
+ // pending animation that was started by SurfaceAnimator
+ if (wrapper.mCapturedFinishCallback != null) {
+ wrapper.mCapturedFinishCallback.onAnimationFinished(wrapper);
+ }
mPendingAnimations.remove(i);
}
}
diff --git a/services/core/java/com/android/server/wm/TaskStack.java b/services/core/java/com/android/server/wm/TaskStack.java
index 900e2df..62754ad 100644
--- a/services/core/java/com/android/server/wm/TaskStack.java
+++ b/services/core/java/com/android/server/wm/TaskStack.java
@@ -1387,6 +1387,7 @@
token.dump(pw, " ", dumpAll);
}
}
+ mAnimatingAppWindowTokenRegistry.dump(pw, "AnimatingApps:", prefix);
}
@Override
diff --git a/services/tests/servicestests/src/com/android/server/display/BrightnessMappingStrategyTest.java b/services/tests/servicestests/src/com/android/server/display/BrightnessMappingStrategyTest.java
index d922df3..fb25cf3 100644
--- a/services/tests/servicestests/src/com/android/server/display/BrightnessMappingStrategyTest.java
+++ b/services/tests/servicestests/src/com/android/server/display/BrightnessMappingStrategyTest.java
@@ -85,9 +85,6 @@
255
};
- private static final int[] MINIMUM_BRIGHTNESS_CURVE_LUX = { 2000, 4000 };
- private static final float[] MINIMUM_BRIGHTNESS_CURVE_NITS = { 1.0f, 50.0f, 90.0f };
-
private static final float[] DISPLAY_RANGE_NITS = { 2.685f, 478.5f };
private static final int[] BACKLIGHT_RANGE = { 1, 255 };
@@ -384,19 +381,6 @@
com.android.internal.R.array.config_autoBrightnessDisplayValuesNits))
.thenReturn(mockBrightnessLevelNits);
- int[] mockMinimumBrightnessCurveLux = new int[MINIMUM_BRIGHTNESS_CURVE_LUX.length];
- for (int i = 0; i < mockMinimumBrightnessCurveLux.length; i++) {
- mockMinimumBrightnessCurveLux[i] = (int) MINIMUM_BRIGHTNESS_CURVE_LUX[i];
- }
- when(mockResources.getIntArray(
- com.android.internal.R.array.config_autoBrightnessMinimumBrightnessCurveLux))
- .thenReturn(mockMinimumBrightnessCurveLux);
- TypedArray mockMinimumBrightnessCurveNits = createFloatTypedArray(
- MINIMUM_BRIGHTNESS_CURVE_NITS);
- when(mockResources.obtainTypedArray(
- com.android.internal.R.array.config_autoBrightnessMinimumBrightnessCurveNits))
- .thenReturn(mockMinimumBrightnessCurveNits);
-
TypedArray mockNitsRange = createFloatTypedArray(nitsRange);
when(mockResources.obtainTypedArray(
com.android.internal.R.array.config_screenBrightnessNits))
@@ -435,78 +419,4 @@
return mockArray;
}
- private float[] getNearMinimumNits(float epsilon) {
- float[] lux = new float[MINIMUM_BRIGHTNESS_CURVE_LUX.length + 1];
- for (int i = 0; i < MINIMUM_BRIGHTNESS_CURVE_LUX.length; i++) {
- lux[i+1] = MINIMUM_BRIGHTNESS_CURVE_LUX[i];
- }
- Spline minimumBrightnessCurve = Spline.createSpline(lux, MINIMUM_BRIGHTNESS_CURVE_NITS);
- float[] nits = new float[LUX_LEVELS.length];
- for (int i = 0; i < nits.length; i++) {
- nits[i] = minimumBrightnessCurve.interpolate(LUX_LEVELS[i]) + epsilon;
- }
- return nits;
- }
-
- @Test
- public void testCreateWithTooDarkBrightnessConfigurationThrowsException() {
- float[] nits = getNearMinimumNits(-0.1f);
- Resources res = createResources(LUX_LEVELS, nits, DISPLAY_RANGE_NITS, BACKLIGHT_RANGE);
- Exception thrown = null;
- try {
- BrightnessMappingStrategy.create(res);
- } catch (IllegalArgumentException e) {
- thrown = e;
- }
- assertNotNull("Failed to throw IllegalArgumentException", thrown);
- }
-
- @Test
- public void testCreationWithBrightEnoughBrightnessConfigurationDoesNotThrowException() {
- float[] nits = getNearMinimumNits(0);
- Resources res = createResources(LUX_LEVELS, nits, DISPLAY_RANGE_NITS, BACKLIGHT_RANGE);
- assertNotNull("Failed to create BrightnessMappingStrategy",
- BrightnessMappingStrategy.create(res));
- }
-
- @Test
- public void testSettingTooDarkBrightnessConfigurationThrowsException() {
- Resources res = createResources(LUX_LEVELS, DISPLAY_LEVELS_NITS, DISPLAY_RANGE_NITS,
- BACKLIGHT_RANGE);
- BrightnessMappingStrategy strategy = BrightnessMappingStrategy.create(res);
- assertNotNull("Failed to create BrightnessMappingStrategy", strategy);
- float[] lux = new float[LUX_LEVELS.length];
- for (int i = 0; i < lux.length; i++) {
- lux[i] = LUX_LEVELS[i];
- }
- float[] nits = getNearMinimumNits(-0.1f);
- BrightnessConfiguration config = new BrightnessConfiguration.Builder()
- .setCurve(lux, nits)
- .build();
- Exception thrown = null;
- try {
- strategy.setBrightnessConfiguration(config);
- } catch (IllegalArgumentException e) {
- thrown = e;
- }
- assertNotNull("Failed to throw IllegalArgumentException", thrown);
- }
-
- @Test
- public void testSettingBrightEnouhgBrightnessConfigurationDoesNotThrowException() {
- Resources res = createResources(LUX_LEVELS, DISPLAY_LEVELS_NITS, DISPLAY_RANGE_NITS,
- BACKLIGHT_RANGE);
- BrightnessMappingStrategy strategy = BrightnessMappingStrategy.create(res);
- assertNotNull("Failed to create BrightnessMappingStrategy", strategy);
- float[] lux = new float[LUX_LEVELS.length];
- for (int i = 0; i < lux.length; i++) {
- lux[i] = LUX_LEVELS[i];
- }
- float[] nits = getNearMinimumNits(0);
- BrightnessConfiguration config = new BrightnessConfiguration.Builder()
- .setCurve(lux, nits)
- .build();
- assertTrue("failed to set brightness configuration",
- strategy.setBrightnessConfiguration(config));
- }
}
diff --git a/services/tests/servicestests/src/com/android/server/wm/RemoteAnimationControllerTest.java b/services/tests/servicestests/src/com/android/server/wm/RemoteAnimationControllerTest.java
index 64501e4..553d658 100644
--- a/services/tests/servicestests/src/com/android/server/wm/RemoteAnimationControllerTest.java
+++ b/services/tests/servicestests/src/com/android/server/wm/RemoteAnimationControllerTest.java
@@ -197,4 +197,16 @@
assertEquals(1, appsCaptor.getValue().length);
assertEquals(mMockLeash, appsCaptor.getValue()[0].leash);
}
+
+ @Test
+ public void testRemovedBeforeStarted() throws Exception {
+ final WindowState win = createWindow(null /* parent */, TYPE_BASE_APPLICATION, "testWin");
+ final AnimationAdapter adapter = mController.createAnimationAdapter(win.mAppToken,
+ new Point(50, 100), new Rect(50, 100, 150, 150));
+ adapter.startAnimation(mMockLeash, mMockTransaction, mFinishedCallback);
+ win.mAppToken.removeImmediately();
+ mController.goodToGo();
+ verifyZeroInteractions(mMockRunner);
+ verify(mFinishedCallback).onAnimationFinished(eq(adapter));
+ }
}
diff --git a/tools/stringslint/stringslint_sha.sh b/tools/stringslint/stringslint_sha.sh
index c79ba04..bd80bb4 100755
--- a/tools/stringslint/stringslint_sha.sh
+++ b/tools/stringslint/stringslint_sha.sh
@@ -1,4 +1,5 @@
#!/bin/bash
+LOCAL_DIR="$( dirname ${BASH_SOURCE} )"
git show --name-only --pretty=format: $1 | grep values/strings.xml | while read file; do
- python $ANDROID_BUILD_TOP/frameworks/base/tools/stringslint/stringslint.py <(git show $1:$file) <(git show $1^:$file)
+ python $LOCAL_DIR/stringslint.py <(git show $1:$file) <(git show $1^:$file)
done