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

Commit ef2bb53c authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Remove frame rate flexibility token"

parents 76f44aed d5281fb1
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -2811,11 +2811,9 @@ package android.view {

  public final class SurfaceControl implements android.os.Parcelable {
    ctor public SurfaceControl(@NonNull android.view.SurfaceControl, @NonNull String);
    method public static long acquireFrameRateFlexibilityToken();
    method @NonNull public static android.os.IBinder getInternalDisplayToken();
    method public boolean isSameSurface(@NonNull android.view.SurfaceControl);
    method public static void overrideHdrTypes(@NonNull android.os.IBinder, @NonNull int[]);
    method public static void releaseFrameRateFlexibilityToken(long);
  }

  public class SurfaceControlViewHost {
+0 −23
Original line number Diff line number Diff line
@@ -230,8 +230,6 @@ public final class SurfaceControl implements Parcelable {
            float frameRate, int compatibility, int changeFrameRateStrategy);
    private static native long nativeGetHandle(long nativeObject);

    private static native long nativeAcquireFrameRateFlexibilityToken();
    private static native void nativeReleaseFrameRateFlexibilityToken(long token);
    private static native void nativeSetFixedTransformHint(long transactionObj, long nativeObject,
            int transformHint);
    private static native void nativeSetFocusedWindow(long transactionObj, IBinder toToken,
@@ -3708,27 +3706,6 @@ public final class SurfaceControl implements Parcelable {
        }
    }

    /**
     * Acquire a frame rate flexibility token, which allows surface flinger to freely switch display
     * frame rates. This is used by CTS tests to put the device in a consistent state. See
     * ISurfaceComposer::acquireFrameRateFlexibilityToken(). The caller must have the
     * ACCESS_SURFACE_FLINGER permission, or else the call will fail, returning 0.
     * @hide
     */
    @TestApi
    public static long acquireFrameRateFlexibilityToken() {
        return nativeAcquireFrameRateFlexibilityToken();
    }

    /**
     * Release a frame rate flexibility token.
     * @hide
     */
    @TestApi
    public static void releaseFrameRateFlexibilityToken(long token) {
        nativeReleaseFrameRateFlexibilityToken(token);
    }

    /**
     * This is a refactoring utility function to enable lower levels of code to be refactored
     * from using the global transaction (and instead use a passed in Transaction) without
+0 −21
Original line number Diff line number Diff line
@@ -888,23 +888,6 @@ static void nativeSetFrameRate(JNIEnv* env, jclass clazz, jlong transactionObj,
                              static_cast<int8_t>(changeFrameRateStrategy));
}

static jlong nativeAcquireFrameRateFlexibilityToken(JNIEnv* env, jclass clazz) {
    sp<ISurfaceComposer> composer = ComposerService::getComposerService();
    sp<IBinder> token;
    status_t result = composer->acquireFrameRateFlexibilityToken(&token);
    if (result < 0) {
        ALOGE("Failed acquiring frame rate flexibility token: %s (%d)", strerror(-result), result);
        return 0;
    }
    token->incStrong((void*)nativeAcquireFrameRateFlexibilityToken);
    return reinterpret_cast<jlong>(token.get());
}

static void nativeReleaseFrameRateFlexibilityToken(JNIEnv* env, jclass clazz, jlong tokenLong) {
    sp<IBinder> token(reinterpret_cast<IBinder*>(tokenLong));
    token->decStrong((void*)nativeAcquireFrameRateFlexibilityToken);
}

static void nativeSetFixedTransformHint(JNIEnv* env, jclass clazz, jlong transactionObj,
                                        jlong nativeObject, jint transformHint) {
    auto transaction = reinterpret_cast<SurfaceComposerClient::Transaction*>(transactionObj);
@@ -1956,10 +1939,6 @@ static const JNINativeMethod sSurfaceControlMethods[] = {
            (void*)nativeSetShadowRadius },
    {"nativeSetFrameRate", "(JJFII)V",
            (void*)nativeSetFrameRate },
    {"nativeAcquireFrameRateFlexibilityToken", "()J",
            (void*)nativeAcquireFrameRateFlexibilityToken },
    {"nativeReleaseFrameRateFlexibilityToken", "(J)V",
            (void*)nativeReleaseFrameRateFlexibilityToken },
    {"nativeGetPhysicalDisplayIds", "()[J",
            (void*)nativeGetPhysicalDisplayIds },
    {"nativeGetPrimaryPhysicalDisplayId", "()J",