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

Commit 1fde90c1 authored by Matt Buckley's avatar Matt Buckley
Browse files

Add plumbing for ADPF Power Efficiency hint

These patches introduce a new power efficiency mode for hint sessions
to the public API, and internally expose a new setMode API for hint
sessions that resembles the setMode API for iPower, to control
different session operating modes.

This set of patches:
 - Updates the PowerHAL AIDL to version 5, and updates relevant bp files
 - Exposes new setPreferPowerEfficiency(bool enabled) method from the
 SDK and NDK
 - Exposes new setMode(int mode, bool enabled) method from PowerHAL AIDL
 and HintManagerService
 - Adds support for new setMode call in PowerHAL

Bug: b/288117936
Test: manual
Change-Id: Id006341b5ab0ae6fadd975d740d2fcf89f0636e4
parent 42027e0e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -390,7 +390,7 @@
    </hal>
    <hal format="aidl" optional="true">
        <name>android.hardware.power</name>
        <version>4</version>
        <version>5</version>
        <interface>
            <name>IPower</name>
            <instance>default</instance>
+39 −1
Original line number Diff line number Diff line
@@ -55,6 +55,44 @@ aidl_interface {
        },

    ],
    frozen: true,
    frozen: false,

}

cc_defaults {
    name: "android.hardware.power-ndk_shared",
    shared_libs: [
        "android.hardware.power-V5-ndk",
    ],
}

cc_defaults {
    name: "android.hardware.power-ndk_export_shared",
    shared_libs: [
        "android.hardware.power-V5-ndk",
    ],
    export_shared_lib_headers: [
        "android.hardware.power-V5-ndk",
    ],
}

cc_defaults {
    name: "android.hardware.power-ndk_static",
    static_libs: [
        "android.hardware.power-V5-ndk",
    ],
}

java_defaults {
    name: "android.hardware.power-java_shared",
    libs: [
        "android.hardware.power-V5-java",
    ],
}

java_defaults {
    name: "android.hardware.power-java_static",
    static_libs: [
        "android.hardware.power-V5-java",
    ],
}
+6 −6
Original line number Diff line number Diff line
@@ -34,10 +34,10 @@
package android.hardware.power;
@Backing(type="int") @VintfStability
enum Boost {
  INTERACTION = 0,
  DISPLAY_UPDATE_IMMINENT = 1,
  ML_ACC = 2,
  AUDIO_LAUNCH = 3,
  CAMERA_LAUNCH = 4,
  CAMERA_SHOT = 5,
  INTERACTION,
  DISPLAY_UPDATE_IMMINENT,
  ML_ACC,
  AUDIO_LAUNCH,
  CAMERA_LAUNCH,
  CAMERA_SHOT,
}
+1 −0
Original line number Diff line number Diff line
@@ -41,4 +41,5 @@ interface IPowerHintSession {
  oneway void close();
  oneway void sendHint(android.hardware.power.SessionHint hint);
  void setThreads(in int[] threadIds);
  oneway void setMode(android.hardware.power.SessionMode type, boolean enabled);
}
+17 −17
Original line number Diff line number Diff line
@@ -34,21 +34,21 @@
package android.hardware.power;
@Backing(type="int") @VintfStability
enum Mode {
  DOUBLE_TAP_TO_WAKE = 0,
  LOW_POWER = 1,
  SUSTAINED_PERFORMANCE = 2,
  FIXED_PERFORMANCE = 3,
  VR = 4,
  LAUNCH = 5,
  EXPENSIVE_RENDERING = 6,
  INTERACTIVE = 7,
  DEVICE_IDLE = 8,
  DISPLAY_INACTIVE = 9,
  AUDIO_STREAMING_LOW_LATENCY = 10,
  CAMERA_STREAMING_SECURE = 11,
  CAMERA_STREAMING_LOW = 12,
  CAMERA_STREAMING_MID = 13,
  CAMERA_STREAMING_HIGH = 14,
  GAME = 15,
  GAME_LOADING = 16,
  DOUBLE_TAP_TO_WAKE,
  LOW_POWER,
  SUSTAINED_PERFORMANCE,
  FIXED_PERFORMANCE,
  VR,
  LAUNCH,
  EXPENSIVE_RENDERING,
  INTERACTIVE,
  DEVICE_IDLE,
  DISPLAY_INACTIVE,
  AUDIO_STREAMING_LOW_LATENCY,
  CAMERA_STREAMING_SECURE,
  CAMERA_STREAMING_LOW,
  CAMERA_STREAMING_MID,
  CAMERA_STREAMING_HIGH,
  GAME,
  GAME_LOADING,
}
Loading