Disable camera features/server on TV SDK

Making camera unavailable on TV SDK also requires disabling
all camera features by android.app.cts.SystemFeaturesTest#testCameraFeatures.

Bug: 146211936
Test: run cts --module CtsCameraTestCases,
      CtsAppTestCases android.app.cts.SystemFeaturesTest#testCameraFeatures

Change-Id: I172f4c5ab309468dcc235eec55857b10c5d57144
(cherry picked from commit 5321f24ea5902ed1ead7f47bd4cdbc8858923255)
diff --git a/permissions/tv_sdk_excluded_core_hardware.xml b/permissions/tv_sdk_excluded_core_hardware.xml
new file mode 100644
index 0000000..5611ada
--- /dev/null
+++ b/permissions/tv_sdk_excluded_core_hardware.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright 2019 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<!-- Excludes all non-default ATV SDK features to comply with CTS -->
+<permissions>
+    <!-- ATV SDK is not designed to have any cameras by default -->
+    <unavailable-feature name="android.hardware.camera" />
+    <unavailable-feature name="android.hardware.camera.front" />
+    <unavailable-feature name="android.hardware.camera.any" />
+    <unavailable-feature name="android.hardware.camera.ar" />
+    <unavailable-feature name="android.hardware.camera.autofocus" />
+    <unavailable-feature name="android.hardware.camera.level.full" />
+    <unavailable-feature name="android.hardware.camera.capability.manual_sensor" />
+    <unavailable-feature name="android.hardware.camera.capability.manual_post_processing" />
+</permissions>
diff --git a/products/sdk_atv_armv7.mk b/products/sdk_atv_armv7.mk
index c112b17..812f18e 100644
--- a/products/sdk_atv_armv7.mk
+++ b/products/sdk_atv_armv7.mk
@@ -18,6 +18,9 @@
 
 PRODUCT_USE_DYNAMIC_PARTITIONS := true
 
+# ATV SDK is not designed to have a camera by default
+PRODUCT_SUPPORTS_CAMERA ?= false
+
 PRODUCT_PACKAGES := \
     LeanbackSampleApp \
     TelephonyProvider \
@@ -39,6 +42,11 @@
     frameworks/av/media/libstagefright/data/media_codecs_google_video.xml:system/etc/media_codecs_google_video.xml \
     hardware/libhardware_legacy/audio/audio_policy.conf:system/etc/audio_policy.conf
 
+# Exclude all non-default hardware features on ATV SDK.
+# All default supported features are defined via device/google/atv/permissions/tv_core_hardware.xml.
+PRODUCT_COPY_FILES += \
+    device/google/atv/permissions/tv_sdk_excluded_core_hardware.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/tv_sdk_excluded_core_hardware.xml
+
 # Put en_US first in the list, so make it default.
 PRODUCT_LOCALES := en_US