Add API for obtaining changing configurations bitmask from Theme

Required to know when to reload the system context's theme in response
to configuration changes, and thus needed to support the DayNight theme.

Bug: 20267825
Change-Id: I7df5e28b7a6d8b611ea030032544cf4800788514
diff --git a/libs/androidfw/ResourceTypes.cpp b/libs/androidfw/ResourceTypes.cpp
index 04ebe70..19a5beb 100644
--- a/libs/androidfw/ResourceTypes.cpp
+++ b/libs/androidfw/ResourceTypes.cpp
@@ -3147,6 +3147,7 @@
 
 ResTable::Theme::Theme(const ResTable& table)
     : mTable(table)
+    , mTypeSpecFlags(0)
 {
     memset(mPackages, 0, sizeof(mPackages));
 }
@@ -3205,6 +3206,8 @@
         return N;
     }
 
+    mTypeSpecFlags |= bagTypeSpecFlags;
+
     uint32_t curPackage = 0xffffffff;
     ssize_t curPackageIndex = 0;
     package_info* curPI = NULL;
@@ -3323,6 +3326,8 @@
         }
     }
 
+    mTypeSpecFlags = other.mTypeSpecFlags;
+
     if (kDebugTableTheme) {
         ALOGI("Final theme:");
         dumpToLog();
@@ -3417,6 +3422,11 @@
             inoutTypeSpecFlags, inoutConfig);
 }
 
+uint32_t ResTable::Theme::getChangingConfigurations() const
+{
+    return mTypeSpecFlags;
+}
+
 void ResTable::Theme::dumpToLog() const
 {
     ALOGI("Theme %p:\n", this);