Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a10d0964 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 8683631 from 2c108ffd to tm-qpr1-release

Change-Id: I51bd549e8c039de41a55914cf753fcfdbc0f6cbb
parents 8459429b 2c108ffd
Loading
Loading
Loading
Loading
+51 −31
Original line number Diff line number Diff line
@@ -751,9 +751,15 @@ public final class Configuration implements Parcelable, Comparable<Configuration
    public static final int SCREEN_WIDTH_DP_UNDEFINED = 0;

    /**
     * The current width of the available screen space in dp units, excluding
     * the area occupied by screen decorations at the edges of the display.
     * Corresponds to the
     * The width of the available screen space in dp units excluding the area
     * occupied by {@link android.view.WindowInsets window insets}.
     *
     * <aside class="note"><b>Note:</b> The width measurement excludes window
     * insets even when the app is displayed edge to edge using
     * {@link android.view.Window#setDecorFitsSystemWindows(boolean)
     * Window#setDecorFitsSystemWindows(boolean)}.</aside>
     *
     * <p>Corresponds to the
     * <a href="{@docRoot}guide/topics/resources/providing-resources.html#AvailableWidthHeightQualifier">
     * available width</a> resource qualifier. Defaults to
     * {@link #SCREEN_WIDTH_DP_UNDEFINED} if no width is specified.
@@ -763,21 +769,25 @@ public final class Configuration implements Parcelable, Comparable<Configuration
     * (for example, when apps are displayed side by side in split-screen mode
     * in landscape orientation).
     *
     * <p>For embedded activities, equals the width of the individual
     * activities, not the width of the app window or the device screen.
     *
     * <p>In multiple-screen scenarios, the width measurement can span screens.
     * For example, if the app is spanning both screens of a dual-screen device
     * (with the screens side by side), {@code screenWidthDp} represents the
     * width of both screens, excluding the area occupied by screen decorations.
     * When the app is restricted to a single screen in a multiple-screen
     * width of both screens excluding the area occupied by window insets. When
     * the app is restricted to a single screen in a multiple-screen
     * environment, {@code screenWidthDp} is the width of the screen on which
     * the app is running.
     * the app is displayed excluding window insets.
     *
     * <p>Differs from {@link android.view.WindowMetrics} by not including
     * screen decorations in the width measurement and by expressing the
     * measurement in dp rather than px. Use {@code screenWidthDp} to obtain the
     * horizontal display area available to the app, excluding the area occupied
     * by screen decorations. Use {@link android.view.WindowMetrics#getBounds()}
     * to obtain the width of the display area available to the app, including
     * the area occupied by screen decorations.
     * window insets in the width measurement and by expressing the measurement
     * in dp rather than px. Use {@code screenWidthDp} to obtain the width of
     * the display area available to an app or embedded activity excluding the
     * area occupied by window insets. Use
     * {@link android.view.WindowMetrics#getBounds()} to obtain the horizontal
     * display area available to an app or embedded activity including the area
     * occupied by window insets.
     */
    public int screenWidthDp;

@@ -788,9 +798,16 @@ public final class Configuration implements Parcelable, Comparable<Configuration
    public static final int SCREEN_HEIGHT_DP_UNDEFINED = 0;

    /**
     * The current height of the available screen space in dp units, excluding
     * the area occupied by screen decorations at the edges of the display (such
     * as the status bar, navigation bar, and cutouts). Corresponds to the
     * The height of the available screen space in dp units excluding the area
     * occupied by {@link android.view.WindowInsets window insets}, such as the
     * status bar, navigation bar, and cutouts.
     *
     * <aside class="note"><b>Note:</b> The height measurement excludes window
     * insets even when the app is displayed edge to edge using
     * {@link android.view.Window#setDecorFitsSystemWindows(boolean)
     * Window#setDecorFitsSystemWindows(boolean)}.</aside>
     *
     * <p>Corresponds to the
     * <a href="{@docRoot}guide/topics/resources/providing-resources.html#AvailableWidthHeightQualifier">
     * available height</a> resource qualifier. Defaults to
     * {@link #SCREEN_HEIGHT_DP_UNDEFINED} if no height is specified.
@@ -800,22 +817,25 @@ public final class Configuration implements Parcelable, Comparable<Configuration
     * (for example, when apps are displayed one above another in split-screen
     * mode in portrait orientation).
     *
     * <p>For embedded activities, equals the height of the individual
     * activities, not the height of the app window or the device screen.
     *
     * <p>In multiple-screen scenarios, the height measurement can span screens.
     * For example, if the app is spanning both screens of a dual-screen device
     * rotated 90 degrees (one screen above the other), {@code screenHeightDp}
     * represents the height of both screens, excluding the area occupied by
     * screen decorations. When the app is restricted to a single screen in a
     * represents the height of both screens excluding the area occupied by
     * window insets. When the app is restricted to a single screen in a
     * multiple-screen environment, {@code screenHeightDp} is the height of the
     * screen on which the app is running.
     * screen on which the app is displayed excluding window insets.
     *
     * <p>Differs from {@link android.view.WindowMetrics} by not including
     * screen decorations in the height measurement and by expressing the
     * measurement in dp rather than px. Use {@code screenHeightDp} to obtain
     * the vertical display area available to the app, excluding the area
     * occupied by screen decorations. Use
     * {@link android.view.WindowMetrics#getBounds()} to obtain the height of
     * the display area available to the app, including the area occupied by
     * screen decorations.
     * window insets in the height measurement and by expressing the measurement
     * in dp rather than px. Use {@code screenHeightDp} to obtain the height of
     * the display area available to an app or embedded activity excluding the
     * area occupied by window insets. Use
     * {@link android.view.WindowMetrics#getBounds()} to obtain the vertical
     * display area available to an app or embedded activity including the area
     * occupied by window insets.
     */
    public int screenHeightDp;

@@ -826,12 +846,12 @@ public final class Configuration implements Parcelable, Comparable<Configuration
    public static final int SMALLEST_SCREEN_WIDTH_DP_UNDEFINED = 0;

    /**
     * The smallest screen size an application will see in normal operation,
     * corresponding to
     * <a href="{@docRoot}guide/topics/resources/providing-resources.html#SmallestScreenWidthQualifier">smallest
     * screen width</a> resource qualifier.
     * This is the smallest value of both screenWidthDp and screenHeightDp
     * in both portrait and landscape.  Set to
     * The smallest screen size an application will see in normal operation.
     * Corresponds to the
     * <a href="{@docRoot}guide/topics/resources/providing-resources.html#SmallestScreenWidthQualifier">
     * smallest width</a> resource qualifier. This is the smallest value of
     * {@link #screenWidthDp} and {@link #screenHeightDp} in both portrait and
     * landscape orientations. Defaults to
     * {@link #SMALLEST_SCREEN_WIDTH_DP_UNDEFINED} if no width is specified.
     */
    public int smallestScreenWidthDp;
+2 −1
Original line number Diff line number Diff line
@@ -765,10 +765,11 @@ public final class Choreographer {
                startNanos = System.nanoTime();
                final long jitterNanos = startNanos - frameTimeNanos;
                if (jitterNanos >= frameIntervalNanos) {
                    final long lastFrameOffset = jitterNanos % frameIntervalNanos;
                    long lastFrameOffset = 0;
                    if (frameIntervalNanos == 0) {
                        Log.i(TAG, "Vsync data empty due to timeout");
                    } else {
                        lastFrameOffset = jitterNanos % frameIntervalNanos;
                        final long skippedFrames = jitterNanos / frameIntervalNanos;
                        if (skippedFrames >= SKIPPED_FRAME_WARNING_LIMIT) {
                            Log.i(TAG, "Skipped " + skippedFrames + " frames!  "
+2 −5
Original line number Diff line number Diff line
@@ -35,7 +35,6 @@ import com.android.internal.app.ResolverActivity;
import com.android.internal.app.ResolverListAdapter.ResolveInfoPresentationGetter;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
@@ -206,7 +205,7 @@ public class DisplayResolveInfo implements TargetInfo, Parcelable {
        dest.writeCharSequence(mDisplayLabel);
        dest.writeCharSequence(mExtendedInfo);
        dest.writeParcelable(mResolvedIntent, 0);
        dest.writeParcelableArray((Intent[]) mSourceIntents.toArray(), 0);
        dest.writeTypedList(mSourceIntents);
        dest.writeBoolean(mIsSuspended);
        dest.writeBoolean(mPinned);
        dest.writeParcelable(mResolveInfo, 0);
@@ -227,9 +226,7 @@ public class DisplayResolveInfo implements TargetInfo, Parcelable {
        mDisplayLabel = in.readCharSequence();
        mExtendedInfo = in.readCharSequence();
        mResolvedIntent = in.readParcelable(null /* ClassLoader */, android.content.Intent.class);
        mSourceIntents.addAll(
                Arrays.asList((Intent[]) in.readParcelableArray(null /* ClassLoader */,
                        Intent.class)));
        in.readTypedList(mSourceIntents, Intent.CREATOR);
        mIsSuspended = in.readBoolean();
        mPinned = in.readBoolean();
        mResolveInfo = in.readParcelable(null /* ClassLoader */, android.content.pm.ResolveInfo.class);
+26 −34
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@

#define LOG_TAG "MotionEvent-JNI"

#include <nativehelper/JNIHelp.h>
#include "android_view_MotionEvent.h"

#include <android/graphics/matrix.h>
#include <android_runtime/AndroidRuntime.h>
@@ -24,12 +24,12 @@
#include <attestation/HmacKeyManager.h>
#include <gui/constants.h>
#include <input/Input.h>
#include <log/log.h>
#include <nativehelper/JNIHelp.h>
#include <nativehelper/ScopedUtfChars.h>
#include <utils/Log.h>

#include "android_os_Parcel.h"
#include "android_util_Binder.h"
#include "android_view_MotionEvent.h"

#include "core_jni_helpers.h"

namespace android {
@@ -158,19 +158,21 @@ static bool validatePointerCoordsObjArray(JNIEnv* env, jobjectArray pointerCoord
    return true;
}

static bool validatePointerIndex(JNIEnv* env, jint pointerIndex, size_t pointerCount) {
    if (pointerIndex < 0 || size_t(pointerIndex) >= pointerCount) {
        jniThrowException(env, "java/lang/IllegalArgumentException",
                "pointerIndex out of range");
static bool validatePointerIndex(JNIEnv* env, jint pointerIndex, const MotionEvent& event) {
    if (pointerIndex < 0 || size_t(pointerIndex) >= event.getPointerCount()) {
        std::stringstream message;
        message << "invalid pointerIndex " << pointerIndex << " for " << event;
        jniThrowException(env, "java/lang/IllegalArgumentException", message.str().c_str());
        return false;
    }
    return true;
}

static bool validateHistoryPos(JNIEnv* env, jint historyPos, size_t historySize) {
    if (historyPos < 0 || size_t(historyPos) >= historySize) {
        jniThrowException(env, "java/lang/IllegalArgumentException",
                "historyPos out of range");
static bool validateHistoryPos(JNIEnv* env, jint historyPos, const MotionEvent& event) {
    if (historyPos < 0 || size_t(historyPos) >= event.getHistorySize()) {
        std::stringstream message;
        message << "historyPos " << historyPos << " out of range for " << event;
        jniThrowException(env, "java/lang/IllegalArgumentException", message.str().c_str());
        return false;
    }
    return true;
@@ -399,13 +401,11 @@ static void android_view_MotionEvent_nativeAddBatch(JNIEnv* env, jclass clazz,
static void android_view_MotionEvent_nativeGetPointerCoords(JNIEnv* env, jclass clazz,
        jlong nativePtr, jint pointerIndex, jint historyPos, jobject outPointerCoordsObj) {
    MotionEvent* event = reinterpret_cast<MotionEvent*>(nativePtr);
    size_t pointerCount = event->getPointerCount();
    if (!validatePointerIndex(env, pointerIndex, pointerCount)
            || !validatePointerCoords(env, outPointerCoordsObj)) {
    if (!validatePointerIndex(env, pointerIndex, *event) ||
        !validatePointerCoords(env, outPointerCoordsObj)) {
        return;
    }
    if (historyPos != HISTORY_CURRENT &&
        !validateHistoryPos(env, historyPos, event->getHistorySize())) {
    if (historyPos != HISTORY_CURRENT && !validateHistoryPos(env, historyPos, *event)) {
        return;
    }

@@ -445,9 +445,8 @@ static void android_view_MotionEvent_nativeGetPointerCoords(JNIEnv* env, jclass
static void android_view_MotionEvent_nativeGetPointerProperties(JNIEnv* env, jclass clazz,
        jlong nativePtr, jint pointerIndex, jobject outPointerPropertiesObj) {
    MotionEvent* event = reinterpret_cast<MotionEvent*>(nativePtr);
    size_t pointerCount = event->getPointerCount();
    if (!validatePointerIndex(env, pointerIndex, pointerCount)
            || !validatePointerProperties(env, outPointerPropertiesObj)) {
    if (!validatePointerIndex(env, pointerIndex, *event) ||
        !validatePointerProperties(env, outPointerPropertiesObj)) {
        return;
    }

@@ -502,8 +501,7 @@ static jint android_view_MotionEvent_nativeAxisFromString(JNIEnv* env, jclass cl
static jint android_view_MotionEvent_nativeGetPointerId(JNIEnv* env, jclass clazz,
        jlong nativePtr, jint pointerIndex) {
    MotionEvent* event = reinterpret_cast<MotionEvent*>(nativePtr);
    size_t pointerCount = event->getPointerCount();
    if (!validatePointerIndex(env, pointerIndex, pointerCount)) {
    if (!validatePointerIndex(env, pointerIndex, *event)) {
        return -1;
    }
    return event->getPointerId(pointerIndex);
@@ -512,8 +510,7 @@ static jint android_view_MotionEvent_nativeGetPointerId(JNIEnv* env, jclass claz
static jint android_view_MotionEvent_nativeGetToolType(JNIEnv* env, jclass clazz,
        jlong nativePtr, jint pointerIndex) {
    MotionEvent* event = reinterpret_cast<MotionEvent*>(nativePtr);
    size_t pointerCount = event->getPointerCount();
    if (!validatePointerIndex(env, pointerIndex, pointerCount)) {
    if (!validatePointerIndex(env, pointerIndex, *event)) {
        return -1;
    }
    return event->getToolType(pointerIndex);
@@ -525,8 +522,7 @@ static jlong android_view_MotionEvent_nativeGetEventTimeNanos(JNIEnv* env, jclas
    if (historyPos == HISTORY_CURRENT) {
        return event->getEventTime();
    } else {
        size_t historySize = event->getHistorySize();
        if (!validateHistoryPos(env, historyPos, historySize)) {
        if (!validateHistoryPos(env, historyPos, *event)) {
            return 0;
        }
        return event->getHistoricalEventTime(historyPos);
@@ -537,16 +533,14 @@ static jfloat android_view_MotionEvent_nativeGetRawAxisValue(JNIEnv* env, jclass
        jlong nativePtr, jint axis,
        jint pointerIndex, jint historyPos) {
    MotionEvent* event = reinterpret_cast<MotionEvent*>(nativePtr);
    size_t pointerCount = event->getPointerCount();
    if (!validatePointerIndex(env, pointerIndex, pointerCount)) {
    if (!validatePointerIndex(env, pointerIndex, *event)) {
        return 0;
    }

    if (historyPos == HISTORY_CURRENT) {
        return event->getRawAxisValue(axis, pointerIndex);
    } else {
        size_t historySize = event->getHistorySize();
        if (!validateHistoryPos(env, historyPos, historySize)) {
        if (!validateHistoryPos(env, historyPos, *event)) {
            return 0;
        }
        return event->getHistoricalRawAxisValue(axis, pointerIndex, historyPos);
@@ -556,16 +550,14 @@ static jfloat android_view_MotionEvent_nativeGetRawAxisValue(JNIEnv* env, jclass
static jfloat android_view_MotionEvent_nativeGetAxisValue(JNIEnv* env, jclass clazz,
        jlong nativePtr, jint axis, jint pointerIndex, jint historyPos) {
    MotionEvent* event = reinterpret_cast<MotionEvent*>(nativePtr);
    size_t pointerCount = event->getPointerCount();
    if (!validatePointerIndex(env, pointerIndex, pointerCount)) {
    if (!validatePointerIndex(env, pointerIndex, *event)) {
        return 0;
    }

    if (historyPos == HISTORY_CURRENT) {
        return event->getAxisValue(axis, pointerIndex);
    } else {
        size_t historySize = event->getHistorySize();
        if (!validateHistoryPos(env, historyPos, historySize)) {
        if (!validateHistoryPos(env, historyPos, (*event))) {
            return 0;
        }
        return event->getHistoricalAxisValue(axis, pointerIndex, historyPos);
+1 −1
Original line number Diff line number Diff line
@@ -108,7 +108,7 @@ public class BubbleStackView extends FrameLayout
     * Set to {@code true} to enable home gesture handling in bubbles
     */
    public static final boolean HOME_GESTURE_ENABLED =
            SystemProperties.getBoolean("persist.wm.debug.bubbles_home_gesture", false);
            SystemProperties.getBoolean("persist.wm.debug.bubbles_home_gesture", true);

    private static final String TAG = TAG_WITH_CLASS_NAME ? "BubbleStackView" : TAG_BUBBLES;

Loading