Merge "TIF: Enable hardware acceleration on overlay" into mnc-dev
This commit is contained in:
@@ -20,6 +20,7 @@ import android.annotation.NonNull;
|
|||||||
import android.annotation.Nullable;
|
import android.annotation.Nullable;
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.annotation.SystemApi;
|
import android.annotation.SystemApi;
|
||||||
|
import android.app.ActivityManager;
|
||||||
import android.app.Service;
|
import android.app.Service;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
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
|
// 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
|
// the application that owns the window token can decide whether to consume or
|
||||||
// dispatch the input events.
|
// dispatch the input events.
|
||||||
int flag = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
|
int flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
|
||||||
| WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS
|
| WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE
|
||||||
| WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE;
|
| WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS;
|
||||||
|
if (ActivityManager.isHighEndGfx()) {
|
||||||
|
flags |= WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED;
|
||||||
|
}
|
||||||
mWindowParams = new WindowManager.LayoutParams(
|
mWindowParams = new WindowManager.LayoutParams(
|
||||||
frame.right - frame.left, frame.bottom - frame.top,
|
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 |=
|
mWindowParams.privateFlags |=
|
||||||
WindowManager.LayoutParams.PRIVATE_FLAG_NO_MOVE_ANIMATION;
|
WindowManager.LayoutParams.PRIVATE_FLAG_NO_MOVE_ANIMATION;
|
||||||
mWindowParams.gravity = Gravity.START | Gravity.TOP;
|
mWindowParams.gravity = Gravity.START | Gravity.TOP;
|
||||||
|
|||||||
Reference in New Issue
Block a user