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

Commit 8f7726cc authored by Luca Stefani's avatar Luca Stefani
Browse files

Merge tag 'android-9.0.0_r16' into lineage-16.0

Android 9.0.0 Release 16 (PQ1A.181105.017.A1)

* tag 'android-9.0.0_r16': (262 commits)
  Keep app in high memory adjust if moving from TOP to FGS
  Revert "RESTRICT AUTOMERGE: Check both self and shared user id package for requested permissions."
  Revert "RESTRICT AUTOMERGE: Revoke permissions defined in a to-be removed package."
  Verify number of Map entries written to Parcel
  Changing SUPL_ES=1 for SUPL end point control
  RESTRICT AUTOMERGE: Check both self and shared user id package for requested permissions.
  Fixes possible issue with no-op creator.
  Add equality method for PhoneAccount.
  Reduce NearestTouchFrame size to prevent button taps on nav bar
  DO NOT MERGE Use correct lock when killing processes
  Added check for misprovisioned Pixel 2 device.
  Fix a typo in javadoc.
  DO NOT MERGE Do not kill processes when screen size changes
  BootAnimation: Fix boot animation with hidden cutout
  DO NOT MERGE Fix display freezing when screen size mismatches
  Update severe (5%/1 hour) warning to send through battery saver
  DO NOT MERGE Kill most processes when display size changes
  ScreenDecorations: Update corner radius when configuration changes
  Cutout: Add developer setting to mask the display cutout
  Cutout emulation: string changes
  ...

Change-Id: I7dd8224a24d4290d24285327f813054531af8daf
parents 252b9d1c 19463c58
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -264,7 +264,8 @@ framework_metalava_docs_LOCAL_DROIDDOC_OPTIONS := \
    --hide RequiresPermission \
    --hide MissingPermission --hide BroadcastBehavior \
    --hide HiddenSuperclass --hide DeprecationMismatch --hide UnavailableSymbol \
    --hide SdkConstant --hide HiddenTypeParameter --hide Todo --hide Typo
    --hide SdkConstant --hide HiddenTypeParameter --hide Todo --hide Typo \
    --include-annotation-classes tools/metalava/stub-annotations \

# ====  Public API diff ===========================
include $(CLEAR_VARS)
+48 −1
Original line number Diff line number Diff line
@@ -302,6 +302,7 @@ status_t BootAnimation::readyToRun() {
    mHeight = h;
    mFlingerSurfaceControl = control;
    mFlingerSurface = s;
    mTargetInset = -1;

    // If the device has encryption turned on or is in process
    // of being encrypted we show the encrypted boot animation.
@@ -942,6 +943,7 @@ bool BootAnimation::playAnimation(const Animation& animation)
                if (mClockEnabled && mTimeIsAccurate && validClock(part)) {
                    drawClock(animation.clockFont, part.clockPosX, part.clockPosY);
                }
                handleViewport(frameDuration);

                eglSwapBuffers(mDisplay, mSurface);

@@ -966,7 +968,7 @@ bool BootAnimation::playAnimation(const Animation& animation)
            usleep(part.pause * ns2us(frameDuration));

            // For infinite parts, we've now played them at least once, so perhaps exit
            if(exitPending() && !part.count)
            if(exitPending() && !part.count && mCurrentInset >= mTargetInset)
                break;
        }

@@ -986,6 +988,51 @@ bool BootAnimation::playAnimation(const Animation& animation)
    return true;
}

void BootAnimation::handleViewport(nsecs_t timestep) {
    if (mShuttingDown || !mFlingerSurfaceControl || mTargetInset == 0) {
        return;
    }
    if (mTargetInset < 0) {
        // Poll the amount for the top display inset. This will return -1 until persistent properties
        // have been loaded.
        mTargetInset = android::base::GetIntProperty("persist.sys.displayinset.top",
                -1 /* default */, -1 /* min */, mHeight / 2 /* max */);
    }
    if (mTargetInset <= 0) {
        return;
    }

    if (mCurrentInset < mTargetInset) {
        // After the device boots, the inset will effectively be cropped away. We animate this here.
        float fraction = static_cast<float>(mCurrentInset) / mTargetInset;
        int interpolatedInset = (cosf((fraction + 1) * M_PI) / 2.0f + 0.5f) * mTargetInset;

        SurfaceComposerClient::Transaction()
                .setCrop(mFlingerSurfaceControl, Rect(0, interpolatedInset, mWidth, mHeight))
                .apply();
    } else {
        // At the end of the animation, we switch to the viewport that DisplayManager will apply
        // later. This changes the coordinate system, and means we must move the surface up by
        // the inset amount.
        sp<IBinder> dtoken(SurfaceComposerClient::getBuiltInDisplay(
                ISurfaceComposer::eDisplayIdMain));

        Rect layerStackRect(0, 0, mWidth, mHeight - mTargetInset);
        Rect displayRect(0, mTargetInset, mWidth, mHeight);

        SurfaceComposerClient::Transaction t;
        t.setPosition(mFlingerSurfaceControl, 0, -mTargetInset)
                .setCrop(mFlingerSurfaceControl, Rect(0, mTargetInset, mWidth, mHeight));
        t.setDisplayProjection(dtoken, 0 /* orientation */, layerStackRect, displayRect);
        t.apply();

        mTargetInset = mCurrentInset = 0;
    }

    int delta = timestep * mTargetInset / ms2ns(200);
    mCurrentInset += delta;
}

void BootAnimation::releaseAnimation(Animation* animation) const
{
    for (Vector<Animation::Part>::iterator it = animation->parts.begin(),
+4 −0
Original line number Diff line number Diff line
@@ -157,11 +157,15 @@ private:

    void checkExit();

    void handleViewport(nsecs_t timestep);

    sp<SurfaceComposerClient>       mSession;
    AssetManager mAssets;
    Texture     mAndroid[2];
    int         mWidth;
    int         mHeight;
    int         mCurrentInset;
    int         mTargetInset;
    bool        mUseNpotTextures = false;
    EGLDisplay  mDisplay;
    EGLDisplay  mContext;
+15 −18
Original line number Diff line number Diff line
@@ -29,7 +29,6 @@ import android.content.res.Resources;
import android.content.res.TypedArray;
import android.content.res.XmlResourceParser;
import android.hardware.fingerprint.FingerprintManager;
import android.os.Build;
import android.os.Parcel;
import android.os.Parcelable;
import android.util.AttributeSet;
@@ -189,12 +188,10 @@ public class AccessibilityServiceInfo implements Parcelable {
     * content and also the accessibility service will receive accessibility events from
     * them.
     * <p>
     * <strong>Note:</strong> For accessibility services targeting API version
     * {@link Build.VERSION_CODES#JELLY_BEAN} or higher this flag has to be explicitly
     * set for the system to regard views that are not important for accessibility. For
     * accessibility services targeting API version lower than
     * {@link Build.VERSION_CODES#JELLY_BEAN} this flag is ignored and all views are
     * regarded for accessibility purposes.
     * <strong>Note:</strong> For accessibility services targeting Android 4.1 (API level 16) or
     * higher, this flag has to be explicitly set for the system to regard views that are not
     * important for accessibility. For accessibility services targeting Android 4.0.4 (API level
     * 15) or lower, this flag is ignored and all views are regarded for accessibility purposes.
     * </p>
     * <p>
     * Usually views not important for accessibility are layout managers that do not
@@ -219,19 +216,19 @@ public class AccessibilityServiceInfo implements Parcelable {
     * flag does not guarantee that the device will not be in touch exploration
     * mode since there may be another enabled service that requested it.
     * <p>
     * For accessibility services targeting API version higher than
     * {@link Build.VERSION_CODES#JELLY_BEAN_MR1} that want to set
     * this flag have to declare this capability in their meta-data by setting
     * the attribute {@link android.R.attr#canRequestTouchExplorationMode
     * canRequestTouchExplorationMode} to true, otherwise this flag will
     * For accessibility services targeting Android 4.3 (API level 18) or higher
     * that want to set this flag have to declare this capability in their
     * meta-data by setting the attribute
     * {@link android.R.attr#canRequestTouchExplorationMode
     * canRequestTouchExplorationMode} to true. Otherwise, this flag will
     * be ignored. For how to declare the meta-data of a service refer to
     * {@value AccessibilityService#SERVICE_META_DATA}.
     * </p>
     * <p>
     * Services targeting API version equal to or lower than
     * {@link Build.VERSION_CODES#JELLY_BEAN_MR1} will work normally, i.e.
     * the first time they are run, if this flag is specified, a dialog is
     * shown to the user to confirm enabling explore by touch.
     * Services targeting Android 4.2.2 (API level 17) or lower will work
     * normally. In other words, the first time they are run, if this flag is
     * specified, a dialog is shown to the user to confirm enabling explore by
     * touch.
     * </p>
     * @see android.R.styleable#AccessibilityService_canRequestTouchExplorationMode
     */
@@ -387,10 +384,10 @@ public class AccessibilityServiceInfo implements Parcelable {
    public int feedbackType;

    /**
     * The timeout after the most recent event of a given type before an
     * The timeout, in milliseconds, after the most recent event of a given type before an
     * {@link AccessibilityService} is notified.
     * <p>
     *   <strong>Can be dynamically set at runtime.</strong>.
     *   <strong>Can be dynamically set at runtime.</strong>
     * </p>
     * <p>
     * <strong>Note:</strong> The event notification timeout is useful to avoid propagating
+2 −2
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@ public class IntEvaluator implements TypeEvaluator<Integer> {
    /**
     * This function returns the result of linearly interpolating the start and end values, with
     * <code>fraction</code> representing the proportion between the start and end values. The
     * calculation is a simple parametric calculation: <code>result = x0 + t * (v1 - v0)</code>,
     * calculation is a simple parametric calculation: <code>result = x0 + t * (x1 - x0)</code>,
     * where <code>x0</code> is <code>startValue</code>, <code>x1</code> is <code>endValue</code>,
     * and <code>t</code> is <code>fraction</code>.
     *
Loading