diff options
author | Jae Seo <jaeseo@google.com> | 2015-07-22 00:14:08 -0700 |
---|---|---|
committer | Jae Seo <jaeseo@google.com> | 2015-07-22 12:34:17 -0700 |
commit | 345af96677d5fbfc00f8f38a46ab7d57c1ff4cbb (patch) | |
tree | fc4ccefd993539785fa28fa74eb3866dfe5d23c8 /media | |
parent | 4fc1b707442451f4a826929fc7e72967d443c73f (diff) | |
download | frameworks_base-345af96677d5fbfc00f8f38a46ab7d57c1ff4cbb.zip frameworks_base-345af96677d5fbfc00f8f38a46ab7d57c1ff4cbb.tar.gz frameworks_base-345af96677d5fbfc00f8f38a46ab7d57c1ff4cbb.tar.bz2 |
TIF: Enable hardware acceleration on overlay
Bug: 18162541
Change-Id: If57fb26ae88ca6ef701f01cce0e5dfd9c6eb1f0e
Diffstat (limited to 'media')
-rw-r--r-- | media/java/android/media/tv/TvInputService.java | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/media/java/android/media/tv/TvInputService.java b/media/java/android/media/tv/TvInputService.java index 86e8560..053d43b6 100644 --- a/media/java/android/media/tv/TvInputService.java +++ b/media/java/android/media/tv/TvInputService.java @@ -20,6 +20,7 @@ import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.SuppressLint; import android.annotation.SystemApi; +import android.app.ActivityManager; import android.app.Service; import android.content.Context; import android.content.Intent; @@ -1200,12 +1201,15 @@ public abstract class TvInputService extends Service { // We make the overlay view non-focusable and non-touchable so that // the application that owns the window token can decide whether to consume or // dispatch the input events. - int flag = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE - | WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS - | WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE; + int flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE + | WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE + | WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS; + if (ActivityManager.isHighEndGfx()) { + flags |= WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED; + } mWindowParams = new WindowManager.LayoutParams( frame.right - frame.left, frame.bottom - frame.top, - frame.left, frame.top, type, flag, PixelFormat.TRANSPARENT); + frame.left, frame.top, type, flags, PixelFormat.TRANSPARENT); mWindowParams.privateFlags |= WindowManager.LayoutParams.PRIVATE_FLAG_NO_MOVE_ANIMATION; mWindowParams.gravity = Gravity.START | Gravity.TOP; |