aboutsummaryrefslogtreecommitdiff
path: root/usbtuner/Android.mk
blob: 6b4056239546047a6a8bf7c9fee3ced9e00336b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
LOCAL_PATH:= $(call my-dir)

# --------------------------------------------------------------
# Build the apk. This generates an standalone apk for USB tuner
# input service.
include $(CLEAR_VARS)

LOCAL_PACKAGE_NAME := UsbTunerTvInput
LOCAL_MODULE_TAGS := optional
# It's not required but keep it for a compatibility with the previous version.
LOCAL_PRIVILEGED_MODULE := true
LOCAL_SDK_VERSION := system_current
LOCAL_MIN_SDK_VERSION := 23  # M

LOCAL_STATIC_JAVA_LIBRARIES := \
    lib-exoplayer \
    usbtuner-tvinput

LOCAL_RESOURCE_DIR := \
    $(LOCAL_PATH)/res \
    $(LOCAL_PATH)/../common/res \
    $(TOP)/prebuilts/sdk/current/support/v7/recyclerview/res \
    $(TOP)/prebuilts/sdk/current/support/v17/leanback/res

LOCAL_AAPT_FLAGS := --auto-add-overlay \
    --extra-packages android.support.v7.recyclerview \
    --extra-packages android.support.v17.leanback \
    --extra-packages com.android.tv.common

LOCAL_JNI_SHARED_LIBRARIES := \
    libusbtuner_jni

LOCAL_PROGUARD_ENABLED := disabled

include $(BUILD_PACKAGE)

# --------------------------------------------------------------
# The final static library that apps can link against.
# The R class is automatically excluded from the generated library.
# Applications that use this library must specify LOCAL_RESOURCE_DIR
# in their makefiles to include the resources in their package.

include $(CLEAR_VARS)

LOCAL_MODULE := usbtuner-tvinput
LOCAL_MODULE_TAGS := optional
LOCAL_SRC_FILES := \
    $(call all-java-files-under, src) \
    $(call all-proto-files-under, proto)
LOCAL_SDK_VERSION := system_current
LOCAL_STATIC_JAVA_LIBRARIES := \
    android-support-v4 \
    android-support-v7-recyclerview \
    android-support-v17-leanback \
    icu4j-usbtuner \
    lib-exoplayer \
    libprotobuf-java-nano \
    tv-common


LOCAL_PROGUARD_ENABLED := disabled

LOCAL_RESOURCE_DIR := \
    $(LOCAL_PATH)/res \
    $(LOCAL_PATH)/../common/res \
    $(TOP)/prebuilts/sdk/current/support/v7/recyclerview/res \
    $(TOP)/prebuilts/sdk/current/support/v17/leanback/res

LOCAL_AAPT_FLAGS := --auto-add-overlay \
    --extra-packages android.support.v17.leanback \
    --extra-packages com.android.tv.common \

LOCAL_PROTOC_OPTIMIZE_TYPE := nano
LOCAL_PROTOC_FLAGS := --proto_path=$(LOCAL_PATH)/proto/

include $(BUILD_STATIC_JAVA_LIBRARY)

# --------------------------------------------------------------
# Build a tiny icu4j library out of the classes necessary for the project.

include $(CLEAR_VARS)

LOCAL_MODULE := icu4j-usbtuner
LOCAL_MODULE_TAGS := optional
icu4j_path := icu/icu4j
LOCAL_SRC_FILES := \
    $(icu4j_path)/main/classes/core/src/com/ibm/icu/text/SCSU.java \
    $(icu4j_path)/main/classes/core/src/com/ibm/icu/text/UnicodeDecompressor.java
LOCAL_SDK_VERSION := system_current

include $(BUILD_STATIC_JAVA_LIBRARY)
#############################################################
# Pre-built dependency jars
#############################################################

# --------------------------------------------------------------
# ExoPlayer library version 1.5.6
# https://github.com/google/ExoPlayer/archive/r1.5.6.zip
# TODO: Add ExoPlayer source code to external/ android repository.

include $(CLEAR_VARS)

LOCAL_MODULE_TAGS := optional

LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := \
   lib-exoplayer:libs/exoplayer_1.5.6.jar

include $(BUILD_MULTI_PREBUILT)

include $(call all-makefiles-under, $(LOCAL_PATH))