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

Commit a7bd2f67 authored by Jorim Jaggi's avatar Jorim Jaggi Committed by Android (Google) Code Review
Browse files

Merge "Revert "Add API support for GPU work duration report in ADPF."" into main

parents 73abc782 cc2767ef
Loading
Loading
Loading
Loading
+0 −18
Original line number Diff line number Diff line
@@ -33157,7 +33157,6 @@ package android.os {
  public static class PerformanceHintManager.Session implements java.io.Closeable {
    method public void close();
    method public void reportActualWorkDuration(long);
    method @FlaggedApi("android.os.adpf_gpu_report_actual_work_duration") public void reportActualWorkDuration(@NonNull android.os.WorkDuration);
    method @FlaggedApi("android.os.adpf_prefer_power_efficiency") public void setPreferPowerEfficiency(boolean);
    method public void setThreads(@NonNull int[]);
    method public void updateTargetWorkDuration(long);
@@ -33500,7 +33499,6 @@ package android.os {
    method public static boolean setCurrentTimeMillis(long);
    method public static void sleep(long);
    method public static long uptimeMillis();
    method @FlaggedApi("android.os.adpf_gpu_report_actual_work_duration") public static long uptimeNanos();
  }
  public class TestLooperManager {
@@ -33766,22 +33764,6 @@ package android.os {
    method @RequiresPermission(android.Manifest.permission.VIBRATE) public final void vibrate(@NonNull android.os.CombinedVibration, @Nullable android.os.VibrationAttributes);
  }
  @FlaggedApi("android.os.adpf_gpu_report_actual_work_duration") public final class WorkDuration implements android.os.Parcelable {
    ctor public WorkDuration();
    ctor public WorkDuration(long, long, long, long);
    method public int describeContents();
    method public long getActualCpuDurationNanos();
    method public long getActualGpuDurationNanos();
    method public long getActualTotalDurationNanos();
    method public long getWorkPeriodStartTimestampNanos();
    method public void setActualCpuDurationNanos(long);
    method public void setActualGpuDurationNanos(long);
    method public void setActualTotalDurationNanos(long);
    method public void setWorkPeriodStartTimestampNanos(long);
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.os.WorkDuration> CREATOR;
  }
  public class WorkSource implements android.os.Parcelable {
    ctor public WorkSource();
    ctor public WorkSource(android.os.WorkSource);
+0 −3
Original line number Diff line number Diff line
@@ -17,8 +17,6 @@

package android.os;

import android.os.WorkDuration;

/** {@hide} */
oneway interface IHintSession {
    void updateTargetWorkDuration(long targetDurationNanos);
@@ -26,5 +24,4 @@ oneway interface IHintSession {
    void close();
    void sendHint(int hint);
    void setMode(int mode, boolean enabled);
    void reportActualWorkDuration2(in WorkDuration[] workDurations);
}
+1 −38
Original line number Diff line number Diff line
@@ -103,7 +103,7 @@ public final class PerformanceHintManager {
     * Any call in this class will change its internal data, so you must do your own thread
     * safety to protect from racing.
     *
     * All timings should be in {@link SystemClock#uptimeNanos()}.
     * All timings should be in {@link SystemClock#elapsedRealtimeNanos()}.
     */
    public static class Session implements Closeable {
        private long mNativeSessionPtr;
@@ -269,40 +269,6 @@ public final class PerformanceHintManager {
        public @Nullable int[] getThreadIds() {
            return nativeGetThreadIds(mNativeSessionPtr);
        }

        /**
         * Reports the work duration for the last cycle of work.
         *
         * The system will attempt to adjust the core placement of the threads within the thread
         * group and/or the frequency of the core on which they are run to bring the actual duration
         * close to the target duration.
         *
         * @param workDuration the work duration of each component.
         * @throws IllegalArgumentException if work period start timestamp is not positive, or
         *         actual total duration is not positive, or actual CPU duration is not positive,
         *         or actual GPU duration is negative.
         */
        @FlaggedApi(Flags.FLAG_ADPF_GPU_REPORT_ACTUAL_WORK_DURATION)
        public void reportActualWorkDuration(@NonNull WorkDuration workDuration) {
            if (workDuration.mWorkPeriodStartTimestampNanos <= 0) {
                throw new IllegalArgumentException(
                    "the work period start timestamp should be positive.");
            }
            if (workDuration.mActualTotalDurationNanos <= 0) {
                throw new IllegalArgumentException("the actual total duration should be positive.");
            }
            if (workDuration.mActualCpuDurationNanos <= 0) {
                throw new IllegalArgumentException("the actual CPU duration should be positive.");
            }
            if (workDuration.mActualGpuDurationNanos < 0) {
                throw new IllegalArgumentException(
                    "the actual GPU duration should be non negative.");
            }
            nativeReportActualWorkDuration(mNativeSessionPtr,
                    workDuration.mWorkPeriodStartTimestampNanos,
                    workDuration.mActualTotalDurationNanos,
                    workDuration.mActualCpuDurationNanos, workDuration.mActualGpuDurationNanos);
        }
    }

    private static native long nativeAcquireManager();
@@ -319,7 +285,4 @@ public final class PerformanceHintManager {
    private static native void nativeSetThreads(long nativeSessionPtr, int[] tids);
    private static native void nativeSetPreferPowerEfficiency(long nativeSessionPtr,
            boolean enabled);
    private static native void nativeReportActualWorkDuration(long nativeSessionPtr,
            long workPeriodStartTimestampNanos, long actualTotalDurationNanos,
            long actualCpuDurationNanos, long actualGpuDurationNanos);
}
+1 −2
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@

package android.os;

import android.annotation.FlaggedApi;
import android.annotation.NonNull;
import android.app.IAlarmManager;
import android.app.time.UnixEpochTime;
@@ -203,8 +202,8 @@ public final class SystemClock {
     * Returns nanoseconds since boot, not counting time spent in deep sleep.
     *
     * @return nanoseconds of non-sleep uptime since boot.
     * @hide
     */
    @FlaggedApi(Flags.FLAG_ADPF_GPU_REPORT_ACTUAL_WORK_DURATION)
    @CriticalNative
    @android.ravenwood.annotation.RavenwoodReplace
    public static native long uptimeNanos();
+0 −19
Original line number Diff line number Diff line
/*
 * Copyright (C) 2023 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.os;

parcelable WorkDuration cpp_header "android/WorkDuration.h";
 No newline at end of file
Loading