Skip to content

Commit

Permalink
Frameworks/SystemUI: Hide expanded dialog when screen is off
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Siddartha Pothapragada authored and TwistedUmbrella committed Mar 20, 2012
1 parent 63e2b71 commit 538a512
Showing 1 changed file with 11 additions and 0 deletions.
Expand Up @@ -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);

Expand Down Expand Up @@ -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();
}
}
};
Expand Down

0 comments on commit 538a512

Please sign in to comment.