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

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

Snap for 8499686 from a0bbba24 to tm-qpr1-release

Change-Id: I73e664b9c3e163018a8b3702b4f551c3a16fb0a6
parents 0a3e6980 a0bbba24
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -3322,8 +3322,8 @@ public class DevicePolicyManager {
     * Activity action: Starts the device policy management role holder updater.
     *
     * <p>The activity must handle the device policy management role holder update and set the
     * intent result to either {@link Activity#RESULT_OK} if the update was successful or not
     * necessary, {@link #RESULT_UPDATE_DEVICE_POLICY_MANAGEMENT_ROLE_HOLDER_RECOVERABLE_ERROR} if
     * intent result. This can include {@link Activity#RESULT_OK} if the update was successful,
     * {@link #RESULT_UPDATE_DEVICE_POLICY_MANAGEMENT_ROLE_HOLDER_RECOVERABLE_ERROR} if
     * it encounters a problem that may be solved by relaunching it again, {@link
     * #RESULT_UPDATE_DEVICE_POLICY_MANAGEMENT_ROLE_HOLDER_PROVISIONING_DISABLED} if role holder
     * provisioning is disabled, or {@link
@@ -3376,7 +3376,8 @@ public class DevicePolicyManager {
    /**
     * An {@code int} extra which contains the result code of the last attempt to update
     * the device policy management role holder.
     * the device policy management role holder via {@link
     * #ACTION_UPDATE_DEVICE_POLICY_MANAGEMENT_ROLE_HOLDER}.
     *
     * <p>This extra is provided to the device policy management role holder via either {@link
     * #ACTION_ROLE_HOLDER_PROVISION_MANAGED_DEVICE_FROM_TRUSTED_SOURCE} or {@link
@@ -3394,6 +3395,8 @@ public class DevicePolicyManager {
     *    encounters a problem that may be solved by relaunching it again.
     *    <li>{@link #RESULT_UPDATE_DEVICE_POLICY_MANAGEMENT_ROLE_HOLDER_UNRECOVERABLE_ERROR} if
     *    it encounters a problem that will not be solved by relaunching it again.
     *    <li>Any other value returned by {@link
     *    #ACTION_UPDATE_DEVICE_POLICY_MANAGEMENT_ROLE_HOLDER}
     * </ul>
     *
     * @hide
+10 −0
Original line number Diff line number Diff line
@@ -94,6 +94,8 @@ public class GraphicsEnvironment {

    private static final int VULKAN_1_0 = 0x00400000;
    private static final int VULKAN_1_1 = 0x00401000;
    private static final int VULKAN_1_2 = 0x00402000;
    private static final int VULKAN_1_3 = 0x00403000;

    // Values for UPDATABLE_DRIVER_ALL_APPS
    // 0: Default (Invalid values fallback to default as well)
@@ -213,6 +215,14 @@ public class GraphicsEnvironment {
    private int getVulkanVersion(PackageManager pm) {
        // PackageManager doesn't have an API to retrieve the version of a specific feature, and we
        // need to avoid retrieving all system features here and looping through them.
        if (pm.hasSystemFeature(PackageManager.FEATURE_VULKAN_HARDWARE_VERSION, VULKAN_1_3)) {
            return VULKAN_1_3;
        }

        if (pm.hasSystemFeature(PackageManager.FEATURE_VULKAN_HARDWARE_VERSION, VULKAN_1_2)) {
            return VULKAN_1_2;
        }

        if (pm.hasSystemFeature(PackageManager.FEATURE_VULKAN_HARDWARE_VERSION, VULKAN_1_1)) {
            return VULKAN_1_1;
        }
+17 −11
Original line number Diff line number Diff line
@@ -765,18 +765,24 @@ public final class Choreographer {
                startNanos = System.nanoTime();
                final long jitterNanos = startNanos - frameTimeNanos;
                if (jitterNanos >= frameIntervalNanos) {
                    final long lastFrameOffset = jitterNanos % frameIntervalNanos;
                    if (frameIntervalNanos == 0) {
                        Log.i(TAG, "Vsync data empty due to timeout");
                    } else {
                        final long skippedFrames = jitterNanos / frameIntervalNanos;
                        if (skippedFrames >= SKIPPED_FRAME_WARNING_LIMIT) {
                            Log.i(TAG, "Skipped " + skippedFrames + " frames!  "
                                + "The application may be doing too much work on its main thread.");
                                    + "The application may be doing too much work on its main "
                                    + "thread.");
                        }
                    final long lastFrameOffset = jitterNanos % frameIntervalNanos;
                        if (DEBUG_JANK) {
                            Log.d(TAG, "Missed vsync by " + (jitterNanos * 0.000001f) + " ms "
                                    + "which is more than the frame interval of "
                                    + (frameIntervalNanos * 0.000001f) + " ms!  "
                                    + "Skipping " + skippedFrames + " frames and setting frame "
                                + "time to " + (lastFrameOffset * 0.000001f) + " ms in the past.");
                                    + "time to " + (lastFrameOffset * 0.000001f)
                                    + " ms in the past.");
                        }
                    }
                    frameTimeNanos = startNanos - lastFrameOffset;
                    DisplayEventReceiver.VsyncEventData latestVsyncEventData =
+1 −41
Original line number Diff line number Diff line
@@ -26,11 +26,9 @@ import android.annotation.Nullable;
import android.annotation.RequiresPermission;
import android.annotation.SuppressLint;
import android.annotation.TestApi;
import android.app.ActivityThread;
import android.app.KeyguardManager;
import android.app.WindowConfiguration;
import android.compat.annotation.UnsupportedAppUsage;
import android.content.ComponentName;
import android.content.res.CompatibilityInfo;
import android.content.res.Configuration;
import android.content.res.Resources;
@@ -52,14 +50,11 @@ import android.util.ArraySet;
import android.util.DisplayMetrics;
import android.util.Log;

import com.android.internal.R;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;

/**
 * Provides information about the size and density of a logical display.
@@ -115,12 +110,6 @@ public final class Display {
    private int mCachedAppWidthCompat;
    private int mCachedAppHeightCompat;

    /**
     * Cache if the application is the recents component.
     * TODO(b/179308296) Remove once Launcher addresses issue
     */
    private Optional<Boolean> mIsRecentsComponent = Optional.empty();

    /**
     * The default Display id, which is the id of the primary display assuming there is one.
     */
@@ -1584,36 +1573,7 @@ public final class Display {
            return false;
        }
        final Configuration config = mResources.getConfiguration();
        // TODO(b/179308296) Temporarily exclude Launcher from being given max bounds, by checking
        // if the caller is the recents component.
        return config != null && !config.windowConfiguration.getMaxBounds().isEmpty()
                && !isRecentsComponent();
    }

    /**
     * Returns {@code true} when the calling package is the recents component.
     * TODO(b/179308296) Remove once Launcher addresses issue
     */
    boolean isRecentsComponent() {
        if (mIsRecentsComponent.isPresent()) {
            return mIsRecentsComponent.get();
        }
        if (mResources == null) {
            return false;
        }
        try {
            String recentsComponent = mResources.getString(R.string.config_recentsComponentName);
            if (recentsComponent == null) {
                return false;
            }
            String recentsPackage = ComponentName.unflattenFromString(recentsComponent)
                    .getPackageName();
            mIsRecentsComponent = Optional.of(recentsPackage != null
                    && recentsPackage.equals(ActivityThread.currentPackageName()));
            return mIsRecentsComponent.get();
        } catch (Resources.NotFoundException e) {
            return false;
        }
        return config != null && !config.windowConfiguration.getMaxBounds().isEmpty();
    }

    /**
+30 −12
Original line number Diff line number Diff line
@@ -12063,6 +12063,9 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     * Gets the coordinates of this view in the coordinate space of the
     * {@link Surface} that contains the view.
     *
     * <p>In multiple-screen scenarios, if the surface spans multiple screens,
     * the coordinate space of the surface also spans multiple screens.
     *
     * <p>After the method returns, the argument array contains the x- and
     * y-coordinates of the view relative to the view's left and top edges,
     * respectively.
@@ -25585,19 +25588,23 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
    }
    /**
     * Gets the global coordinates of this view. The coordinates are in the
     * coordinate space of the device screen, irrespective of system decorations
     * and whether the system is in multi-window mode.
     * Gets the coordinates of this view in the coordinate space of the device
     * screen, irrespective of system decorations and whether the system is in
     * multi-window mode.
     *
     * <p>In multi-window mode, the global coordinate space encompasses the
     * entire device screen, ignoring the bounds of the app window. For
     * example, if the view is in the bottom portion of a horizontal split
     * screen, the top edge of the screen&mdash;not the top edge of the
     * window&mdash;is the origin from which the y-coordinate is calculated.
     * <p>In multi-window mode, the coordinate space encompasses the entire
     * device screen, ignoring the bounds of the app window. For example, if the
     * view is in the bottom portion of a horizontal split screen, the top edge
     * of the screen&mdash;not the top edge of the window&mdash;is the origin
     * from which the y-coordinate is calculated.
     *
     * <p><b>Note:</b> In multiple-screen scenarios, the global coordinate space
     * is restricted to the screen on which the view is displayed. The
     * coordinate space does not span multiple screens.
     * <p>In multiple-screen scenarios, the coordinate space can span screens.
     * For example, if the app is spanning both screens of a dual-screen device
     * and the view is located on the right-hand screen, the x-coordinate is
     * calculated from the left edge of the left-hand screen to the left edge of
     * the view. When the app is restricted to a single screen in a
     * multiple-screen environment, the coordinate space includes only the
     * screen on which the app is running.
     *
     * <p>After the method returns, the argument array contains the x- and
     * y-coordinates of the view relative to the view's left and top edges,
@@ -25625,6 +25632,11 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     * top left corner of the window that contains the view. In full screen
     * mode, the origin is the top left corner of the device screen.
     *
     * <p>In multiple-screen scenarios, if the app spans multiple screens, the
     * coordinate space also spans multiple screens. But if the app is
     * restricted to a single screen, the coordinate space includes only the
     * screen on which the app is running.
     *
     * <p>After the method returns, the argument array contains the x- and
     * y-coordinates of the view relative to the view's left and top edges,
     * respectively.
@@ -28733,7 +28745,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     *     {@link InputDevice#SOURCE_MOUSE_RELATIVE}, and relative position changes will be
     *     available through {@link MotionEvent#getX} and {@link MotionEvent#getY}.</li>
     *
     *     <li>Events from a touchpad will be delivered with the source
     *     <li>Events from a touchpad or trackpad will be delivered with the source
     *     {@link InputDevice#SOURCE_TOUCHPAD}, where the absolute position of each of the pointers
     *     on the touchpad will be available through {@link MotionEvent#getX(int)} and
     *     {@link MotionEvent#getY(int)}, and their relative movements are stored in
@@ -28742,6 +28754,12 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     *     <li>Events from other types of devices, such as touchscreens, will not be affected.</li>
     * </ul>
     * <p>
     * When pointer capture changes, connected mouse and trackpad devices may be reconfigured,
     * and their properties (such as their sources or motion ranges) may change. Use an
     * {@link android.hardware.input.InputManager.InputDeviceListener} to be notified when a device
     * changes (which may happen after enabling or disabling pointer capture), and use
     * {@link InputDevice#getDevice(int)} to get the updated {@link InputDevice}.
     * <p>
     * Events captured through pointer capture will be dispatched to
     * {@link OnCapturedPointerListener#onCapturedPointer(View, MotionEvent)} if an
     * {@link OnCapturedPointerListener} is set, and otherwise to
Loading