SettingsLib: Build with AAPT2

Bug:22775504
Change-Id: I2e5015235384d124418d32186daa190f38e1c5b3
diff --git a/packages/SettingsLib/common.mk b/packages/SettingsLib/common.mk
index b017047..cf0ba6c 100644
--- a/packages/SettingsLib/common.mk
+++ b/packages/SettingsLib/common.mk
@@ -13,6 +13,16 @@
 #   include frameworks/base/packages/SettingsLib/common.mk
 #
 
+ifeq ($(LOCAL_USE_AAPT2),true)
+LOCAL_STATIC_ANDROID_LIBRARIES += \
+    android-support-annotations \
+    android-support-v4 \
+    SettingsLib
+else
 LOCAL_RESOURCE_DIR += $(call my-dir)/res
 LOCAL_AAPT_FLAGS += --auto-add-overlay --extra-packages com.android.settingslib
-LOCAL_STATIC_JAVA_LIBRARIES += SettingsLib
+LOCAL_STATIC_JAVA_LIBRARIES += \
+    android-support-annotations \
+    android-support-v4 \
+    SettingsLib
+endif