Skip to content

Commit 0b4226b

Browse files
committed
Themes: Fix theming of cmsdk assets
Missed the pkgid assignment bits in I4f64d53d82c9edafbe624c3b2eafcda7332587fb Change-Id: Ie442c8922f0d9eac3ed5bab70a99d3e065b719c4 TICKET: CYNGNOS-2723
1 parent 82fcd4a commit 0b4226b

3 files changed

Lines changed: 13 additions & 5 deletions

File tree

core/java/android/content/res/Resources.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ public class Resources {
120120
public static final int THEME_APP_PKG_ID = 0x61;
121121
/** @hide */
122122
public static final int THEME_ICON_PKG_ID = 0x62;
123+
/** @hide */
124+
public static final int THEME_CM_PKG_ID = 0x63;
123125
/**
124126
* The common resource pkg id needs to be less than the THEME_FRAMEWORK_PKG_ID
125127
* otherwise aapt will complain and fail

libs/androidfw/ResourceTypes.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,10 @@ namespace android {
6262
#define APP_PACKAGE_ID 0x7f
6363
#define CMSDK_PACKAGE_ID 0x3f
6464
#define SYS_PACKAGE_ID 0x01
65-
#define OVERLAY_APP_PACKAGE_ID 0x61
66-
#define OVERLAY_SYS_PACKAGE_ID 0x60
67-
#define OVERLAY_COMMON_PACKAGE_ID 0x5f
65+
#define OVERLAY_CMSDK_PACKAGE_ID 0x63
66+
#define OVERLAY_APP_PACKAGE_ID 0x61
67+
#define OVERLAY_SYS_PACKAGE_ID 0x60
68+
#define OVERLAY_COMMON_PACKAGE_ID 0x5f
6869

6970
// Define attributes from android.R.attr to protect from theme changes
7071
#define ATTR_WINDOW_NO_TITLE 0x01010056 // windowNoTitle
@@ -6391,6 +6392,7 @@ DynamicRefTable::DynamicRefTable(uint8_t packageId)
63916392
mLookupTable[OVERLAY_APP_PACKAGE_ID] = OVERLAY_APP_PACKAGE_ID;
63926393
mLookupTable[OVERLAY_SYS_PACKAGE_ID] = OVERLAY_SYS_PACKAGE_ID;
63936394
mLookupTable[OVERLAY_COMMON_PACKAGE_ID] = OVERLAY_COMMON_PACKAGE_ID;
6395+
mLookupTable[OVERLAY_CMSDK_PACKAGE_ID] = OVERLAY_CMSDK_PACKAGE_ID;
63946396
}
63956397

63966398
status_t DynamicRefTable::load(const ResTable_lib_header* const header)
@@ -6470,7 +6472,8 @@ status_t DynamicRefTable::lookupResourceId(uint32_t* resId) const {
64706472
size_t packageId = Res_GETPACKAGE(res) + 1;
64716473

64726474
if (packageId == APP_PACKAGE_ID || packageId == OVERLAY_APP_PACKAGE_ID ||
6473-
packageId == OVERLAY_SYS_PACKAGE_ID || packageId == OVERLAY_COMMON_PACKAGE_ID) {
6475+
packageId == OVERLAY_SYS_PACKAGE_ID || packageId == OVERLAY_COMMON_PACKAGE_ID ||
6476+
packageId == OVERLAY_CMSDK_PACKAGE_ID) {
64746477
// No lookup needs to be done, app package IDs are absolute.
64756478
return NO_ERROR;
64766479
}
@@ -6801,7 +6804,8 @@ bool ResTable::isResTypeAllowed(const char* type) const {
68016804
bool ResTable::isDynamicPackageId(const uint32_t pkgId) const {
68026805
return pkgId != APP_PACKAGE_ID && pkgId != SYS_PACKAGE_ID
68036806
&& pkgId != OVERLAY_APP_PACKAGE_ID && pkgId != OVERLAY_SYS_PACKAGE_ID
6804-
&& pkgId != OVERLAY_COMMON_PACKAGE_ID && pkgId != CMSDK_PACKAGE_ID;
6807+
&& pkgId != OVERLAY_COMMON_PACKAGE_ID && pkgId != CMSDK_PACKAGE_ID
6808+
&& pkgId != OVERLAY_CMSDK_PACKAGE_ID;
68056809
}
68066810

68076811
status_t ResTable::removeIdmappedTypesFromPackageGroup(PackageGroup* packageGroup) const {

services/core/java/com/android/server/pm/PackageManagerService.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8324,6 +8324,8 @@ private void compileResourcesWithAapt(String target, PackageParser.Package pkg)
83248324
int pkgId;
83258325
if ("android".equals(target)) {
83268326
pkgId = Resources.THEME_FRAMEWORK_PKG_ID;
8327+
} else if ("cyanogenmod.platform".equals(target)) {
8328+
pkgId = Resources.THEME_CM_PKG_ID;
83278329
} else if (isCommonResources) {
83288330
pkgId = Resources.THEME_COMMON_PKG_ID;
83298331
} else {

0 commit comments

Comments
 (0)