|
20 | 20 | import android.annotation.Nullable; |
21 | 21 | import android.annotation.SuppressLint; |
22 | 22 | import android.annotation.SystemApi; |
| 23 | +import android.app.ActivityManager; |
23 | 24 | import android.app.Service; |
24 | 25 | import android.content.Context; |
25 | 26 | import android.content.Intent; |
@@ -1200,12 +1201,15 @@ void createOverlayView(IBinder windowToken, Rect frame) { |
1200 | 1201 | // We make the overlay view non-focusable and non-touchable so that |
1201 | 1202 | // the application that owns the window token can decide whether to consume or |
1202 | 1203 | // dispatch the input events. |
1203 | | - int flag = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE |
1204 | | - | WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS |
1205 | | - | WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE; |
| 1204 | + int flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE |
| 1205 | + | WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE |
| 1206 | + | WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS; |
| 1207 | + if (ActivityManager.isHighEndGfx()) { |
| 1208 | + flags |= WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED; |
| 1209 | + } |
1206 | 1210 | mWindowParams = new WindowManager.LayoutParams( |
1207 | 1211 | frame.right - frame.left, frame.bottom - frame.top, |
1208 | | - frame.left, frame.top, type, flag, PixelFormat.TRANSPARENT); |
| 1212 | + frame.left, frame.top, type, flags, PixelFormat.TRANSPARENT); |
1209 | 1213 | mWindowParams.privateFlags |= |
1210 | 1214 | WindowManager.LayoutParams.PRIVATE_FLAG_NO_MOVE_ANIMATION; |
1211 | 1215 | mWindowParams.gravity = Gravity.START | Gravity.TOP; |
|
0 commit comments