Skip to content

Commit 787e2c2

Browse files
Jamie GennisAndroid Git Automerger
authored andcommitted
am ca5c881: Merge "SystemUI: Disable HW acceleration for status bar" into ics-mr0
* commit 'ca5c881374d051361eb5f9a191d51b5716ef2366': SystemUI: Disable HW acceleration for status bar
2 parents 51c00a5 + ca5c881 commit 787e2c2

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

packages/SystemUI/src/com/android/systemui/statusbar/StatusBar.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,15 +118,20 @@ public void start() {
118118
WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
119119
| WindowManager.LayoutParams.FLAG_TOUCHABLE_WHEN_WAKING
120120
| WindowManager.LayoutParams.FLAG_SPLIT_TOUCH,
121-
PixelFormat.OPAQUE);
121+
// We use a pixel format of RGB565 for the status bar to save memory bandwidth and
122+
// to ensure that the layer can be handled by HWComposer. On some devices the
123+
// HWComposer is unable to handle SW-rendered RGBX_8888 layers.
124+
PixelFormat.RGB_565);
122125

123126
// the status bar should be in an overlay if possible
124127
final Display defaultDisplay
125128
= ((WindowManager)mContext.getSystemService(Context.WINDOW_SERVICE))
126129
.getDefaultDisplay();
127-
if (ActivityManager.isHighEndGfx(defaultDisplay)) {
128-
lp.flags |= WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED;
129-
}
130+
131+
// We explicitly leave FLAG_HARDWARE_ACCELERATED out of the flags. The status bar occupies
132+
// very little screen real-estate and is updated fairly frequently. By using CPU rendering
133+
// for the status bar, we prevent the GPU from having to wake up just to do these small
134+
// updates, which should help keep power consumption down.
130135

131136
lp.gravity = getStatusBarGravity();
132137
lp.setTitle("StatusBar");

0 commit comments

Comments
 (0)