From 73eb3c1dc41d54b48dd3d2fc53825fe7e99f649e Mon Sep 17 00:00:00 2001 From: Nikolas Havrikov Date: Fri, 2 Sep 2022 16:22:17 +0200 Subject: [PATCH] Determine TV form factor based on FEATURE_LEANBACK This CL changes the implementation of isTelevision in DeviceUtils.java to be consistent with NFF checks for other form factors. Test: make Change-Id: I1922b27466a27bab5278fe93dc65f56c312b2f6a --- .../src/com/android/packageinstaller/DeviceUtils.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/PackageInstaller/src/com/android/packageinstaller/DeviceUtils.java b/packages/PackageInstaller/src/com/android/packageinstaller/DeviceUtils.java index b54cad6f9276a..40a9390e9ac0b 100644 --- a/packages/PackageInstaller/src/com/android/packageinstaller/DeviceUtils.java +++ b/packages/PackageInstaller/src/com/android/packageinstaller/DeviceUtils.java @@ -18,12 +18,10 @@ package com.android.packageinstaller; import android.content.Context; import android.content.pm.PackageManager; -import android.content.res.Configuration; public class DeviceUtils { public static boolean isTelevision(Context context) { - int uiMode = context.getResources().getConfiguration().uiMode; - return (uiMode & Configuration.UI_MODE_TYPE_MASK) == Configuration.UI_MODE_TYPE_TELEVISION; + return context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_LEANBACK); } public static boolean isWear(final Context context) {