From 538a512d6b0099ad6b8411d1722f6e097504f044 Mon Sep 17 00:00:00 2001 From: Siddartha Pothapragada Date: Wed, 7 Mar 2012 10:37:24 -0800 Subject: [PATCH] Frameworks/SystemUI: Hide expanded dialog when screen is off Hide the expanded dialog while screen is off. Otherwise it causes continuous buffer updates to SurfaceTexture even when SCREEN is turned off and while In-Call causing a spike in power consumtion. This fix ensures that the power consumption is kept to a minimum in such a scenario. (cherry picked from commit 406e56a8da1e76ef2abb20555470cf8b83dade5f) Change-Id: Id4bc02b71d3d6a4a048ac511b69c19b4cd454b1e CRs-Fixed: 339815 --- .../systemui/statusbar/phone/PhoneStatusBar.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java index 13027decac25a..78fec8bfa885d 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -442,6 +442,7 @@ public boolean onLongClick(View v) { IntentFilter filter = new IntentFilter(); filter.addAction(Intent.ACTION_CONFIGURATION_CHANGED); filter.addAction(Intent.ACTION_CLOSE_SYSTEM_DIALOGS); + filter.addAction(Intent.ACTION_SCREEN_ON); filter.addAction(Intent.ACTION_SCREEN_OFF); context.registerReceiver(mBroadcastReceiver, filter); @@ -2323,10 +2324,20 @@ public void onReceive(Context context, Intent intent) { } } animateCollapse(excludeRecents); + if(Intent.ACTION_SCREEN_OFF.equals(action)) { + // Explicitly hide the expanded dialog. Otherwise it + // causes continuous buffer updates to SurfaceTexture + // even when SCREEN is turned off (while In-Call). + // This keeps the power consumption to a minimum + // in such a scenario. + mExpandedDialog.hide(); + } } else if (Intent.ACTION_CONFIGURATION_CHANGED.equals(action)) { repositionNavigationBar(); updateResources(); + } else if (Intent.ACTION_SCREEN_ON.equals(action)) { + mExpandedDialog.show(); } } };