Skip to content

Instantly share code, notes, and snippets.

@phhusson
Created June 6, 2023 10:16
Show Gist options
  • Save phhusson/b5df919bc0102542c7b5a324ac412f69 to your computer and use it in GitHub Desktop.
Save phhusson/b5df919bc0102542c7b5a324ac412f69 to your computer and use it in GitHub Desktop.
diff --git a/services/core/java/com/android/server/wm/DisplayPolicy.java b/services/core/java/com/android/server/wm/DisplayPolicy.java
index 0bb4022d9289..dfeb80cdb768 100644
--- a/services/core/java/com/android/server/wm/DisplayPolicy.java
+++ b/services/core/java/com/android/server/wm/DisplayPolicy.java
@@ -216,6 +216,8 @@ public class DisplayPolicy {
private boolean mCanSystemBarsBeShownByUser;
private boolean mNavButtonForcedVisible;
+ private vendor.mediatek.hardware.mtkpower.V1_1.IMtkPerf mMtkPerf;
+
StatusBarManagerInternal getStatusBarManagerInternal() {
synchronized (mServiceAcquireLock) {
if (mStatusBarManagerInternal == null) {
@@ -445,6 +447,13 @@ public class DisplayPolicy {
mScreenOnEarly = true;
mScreenOnFully = true;
}
+ try {
+ mMtkPerf = vendor.mediatek.hardware.mtkpower.V1_1.IMtkPerf.getService();
+ } catch(Throwable t) {
+ android.util.Log.d("PHH", "Retrieving mtkpower 1.0", t);
+ mMtkPerf = null;
+ }
+
final Looper looper = UiThread.getHandler().getLooper();
mHandler = new PolicyHandler(looper);
@@ -542,6 +551,14 @@ public class DisplayPolicy {
if (listener != null) {
listener.onTouchStart();
}
+ if(mMtkPerf != null) {
+ try {
+ android.util.Log.d("PHH", "mtk power hint");
+ mMtkPerf.perfCusLockHint(25, 300);
+ } catch(Throwable t) {
+ android.util.Log.d("PHH", "Failed sending touch power hint", t);
+ }
+ }
}
@Override
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment