summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/aapt/ApkBuilder.h4
-rw-r--r--tools/aapt/Command.cpp17
-rw-r--r--tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderSessionImpl.java1
-rw-r--r--tools/layoutlib/create/src/com/android/tools/layoutlib/create/CreateInfo.java1
4 files changed, 20 insertions, 3 deletions
diff --git a/tools/aapt/ApkBuilder.h b/tools/aapt/ApkBuilder.h
index a4b7d4a..db23c84 100644
--- a/tools/aapt/ApkBuilder.h
+++ b/tools/aapt/ApkBuilder.h
@@ -55,6 +55,10 @@ public:
return mSplits;
}
+ android::sp<ApkSplit> getBaseSplit() {
+ return mSplits[0];
+ }
+
void print() const;
private:
diff --git a/tools/aapt/Command.cpp b/tools/aapt/Command.cpp
index deb2bc5..24a94a7 100644
--- a/tools/aapt/Command.cpp
+++ b/tools/aapt/Command.cpp
@@ -2066,10 +2066,16 @@ bail:
return (result != NO_ERROR);
}
-static status_t addResourcesToBuilder(const sp<AaptDir>& dir, const sp<ApkBuilder>& builder) {
+static status_t addResourcesToBuilder(const sp<AaptDir>& dir, const sp<ApkBuilder>& builder, bool ignoreConfig=false) {
const size_t numDirs = dir->getDirs().size();
for (size_t i = 0; i < numDirs; i++) {
- status_t err = addResourcesToBuilder(dir->getDirs().valueAt(i), builder);
+ bool ignore = ignoreConfig;
+ const sp<AaptDir>& subDir = dir->getDirs().valueAt(i);
+ const char* dirStr = subDir->getLeaf().string();
+ if (!ignore && strstr(dirStr, "mipmap") == dirStr) {
+ ignore = true;
+ }
+ status_t err = addResourcesToBuilder(subDir, builder, ignore);
if (err != NO_ERROR) {
return err;
}
@@ -2080,7 +2086,12 @@ static status_t addResourcesToBuilder(const sp<AaptDir>& dir, const sp<ApkBuilde
sp<AaptGroup> gp = dir->getFiles().valueAt(i);
const size_t numConfigs = gp->getFiles().size();
for (size_t j = 0; j < numConfigs; j++) {
- status_t err = builder->addEntry(gp->getPath(), gp->getFiles().valueAt(j));
+ status_t err = NO_ERROR;
+ if (ignoreConfig) {
+ err = builder->getBaseSplit()->addEntry(gp->getPath(), gp->getFiles().valueAt(j));
+ } else {
+ err = builder->addEntry(gp->getPath(), gp->getFiles().valueAt(j));
+ }
if (err != NO_ERROR) {
fprintf(stderr, "Failed to add %s (%s) to builder.\n",
gp->getPath().string(), gp->getFiles()[j]->getPrintableSource().string());
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderSessionImpl.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderSessionImpl.java
index 9787432..4af73cf 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderSessionImpl.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderSessionImpl.java
@@ -183,6 +183,7 @@ public class RenderSessionImpl extends RenderAction<SessionParams> {
SessionParams params = getParams();
BridgeContext context = getContext();
+
RenderResources resources = getParams().getResources();
DisplayMetrics metrics = getContext().getMetrics();
diff --git a/tools/layoutlib/create/src/com/android/tools/layoutlib/create/CreateInfo.java b/tools/layoutlib/create/src/com/android/tools/layoutlib/create/CreateInfo.java
index 813a895..59979ce 100644
--- a/tools/layoutlib/create/src/com/android/tools/layoutlib/create/CreateInfo.java
+++ b/tools/layoutlib/create/src/com/android/tools/layoutlib/create/CreateInfo.java
@@ -137,6 +137,7 @@ public final class CreateInfo implements ICreateInfo {
"android.text.format.DateFormat#is24HourFormat",
"android.view.Choreographer#getRefreshRate",
"android.view.Display#updateDisplayInfoLocked",
+ "android.view.Display#getWindowManager",
"android.view.LayoutInflater#rInflate",
"android.view.LayoutInflater#parseInclude",
"android.view.View#isInEditMode",