Create a special CONSTRAINED font bucket in noto-fonts.

This is a temporary font profile to get razor and razorg (Nexus 7,
2013 version). It's not tested thoroughly, and should not be used for
any other devices.

The CONSTRAINED profile removes Bamum, Lisu, Mandaic, Mongolian, New
Tai Lue, Syriac, Tibetan, and Vai fonts from razor[g] devices, and
switches the CJK fonts to the limited pre-Lollipop fonts.

Bug: 22929087
Change-Id: I1ffe2ee376010c27418d34fea2f038fa0e718573
diff --git a/Android.mk b/Android.mk
index f6e19ff..ec204ce 100644
--- a/Android.mk
+++ b/Android.mk
@@ -14,10 +14,13 @@
 
 NOTO_DIR := $(call my-dir)
 
-# Use full Noto Sans Japanese font on non-smaller footprints
+# Use full Noto Sans Japanese font on the normal footprints, but
+# exclude it from SMALLER and use a subset on the CONSTRAINED ones.
 ifneq ($(SMALLER_FONT_FOOTPRINT),true)
+ifneq ($(CONSTRAINED_FONT_FOOTPRINT),true)
 FONT_NOTOSANS_JP_FULL := true
 endif
+endif
 
 # We have to use BUILD_PREBUILT instead of PRODUCT_COPY_FILES,
 # to copy over the NOTICE file.
@@ -43,6 +46,7 @@
 ifneq ($(SMALLER_FONT_FOOTPRINT),true)
 LOCAL_PATH := $(NOTO_DIR)/cjk
 
+ifneq ($(CONSTRAINED_FONT_FOOTPRINT),true)
 font_src_files := \
     NotoSansKR-Regular.otf \
     NotoSansSC-Regular.otf \
@@ -50,6 +54,7 @@
 
 $(foreach f, $(font_src_files), $(call build-one-font-module, $(f)))
 font_src_files :=
+endif # !CONSTRAINED_FONT_FOOTPRINT
 
 #############################################################################
 # Include NotoSansJP, or a subset.
@@ -95,7 +100,6 @@
 font_src_files += \
     NotoColorEmoji.ttf \
     NotoSansBalinese-Regular.ttf \
-    NotoSansBamum-Regular.ttf \
     NotoSansBatak-Regular.ttf \
     NotoSansBengali-Regular.ttf \
     NotoSansBengali-Bold.ttf \
@@ -140,32 +144,25 @@
     NotoSansLaoUI-Bold.ttf \
     NotoSansLepcha-Regular.ttf \
     NotoSansLimbu-Regular.ttf \
-    NotoSansLisu-Regular.ttf \
     NotoSansMalayalam-Regular.ttf \
     NotoSansMalayalam-Bold.ttf \
     NotoSansMalayalamUI-Regular.ttf \
     NotoSansMalayalamUI-Bold.ttf \
-    NotoSansMandaic-Regular.ttf \
     NotoSansMeeteiMayek-Regular.ttf \
-    NotoSansMongolian-Regular.ttf \
     NotoSansMyanmar-Regular.ttf \
     NotoSansMyanmar-Bold.ttf \
     NotoSansMyanmarUI-Regular.ttf \
     NotoSansMyanmarUI-Bold.ttf \
-    NotoSansNewTaiLue-Regular.ttf \
     NotoSansNKo-Regular.ttf \
     NotoSansOlChiki-Regular.ttf \
     NotoSansOriya-Regular.ttf \
-    NotoSansOriya-Bold.ttf \
     NotoSansOriyaUI-Regular.ttf \
-    NotoSansOriyaUI-Bold.ttf \
     NotoSansRejang-Regular.ttf \
     NotoSansSaurashtra-Regular.ttf \
     NotoSansSinhala-Regular.ttf \
     NotoSansSinhala-Bold.ttf \
     NotoSansSundanese-Regular.ttf \
     NotoSansSylotiNagri-Regular.ttf \
-    NotoSansSyriacEstrangela-Regular.ttf \
     NotoSansTagbanwa-Regular.ttf \
     NotoSansTaiLe-Regular.ttf \
     NotoSansTaiTham-Regular.ttf \
@@ -184,10 +181,26 @@
     NotoSansThai-Bold.ttf \
     NotoSansThaiUI-Regular.ttf \
     NotoSansThaiUI-Bold.ttf \
-    NotoSansTibetan-Regular.ttf \
     NotoSansTifinagh-Regular.ttf \
-    NotoSansVai-Regular.ttf \
     NotoSansYi-Regular.ttf
+
+#############################################################################
+# The following fonts are excluded from CONSTRAINED_FONT_FOOTPRINT builds.
+#############################################################################
+ifneq ($(CONSTRAINED_FONT_FOOTPRINT),true)
+font_src_files += \
+    NotoSansBamum-Regular.ttf \
+    NotoSansLisu-Regular.ttf \
+    NotoSansMandaic-Regular.ttf \
+    NotoSansMongolian-Regular.ttf \
+    NotoSansNewTaiLue-Regular.ttf \
+    NotoSansOriya-Bold.ttf \
+    NotoSansOriyaUI-Bold.ttf \
+    NotoSansSyriacEstrangela-Regular.ttf \
+    NotoSansTibetan-Regular.ttf \
+    NotoSansVai-Regular.ttf
+endif # !CONSTRAINED_FONT_FOOTPRINT
+
 endif # !SMALLER_FONT_FOOTPRINT
 
 #############################################################################