summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/aapt/AaptAssets.cpp50
-rw-r--r--tools/aapt/AaptAssets.h8
-rw-r--r--tools/aapt/Android.mk7
-rw-r--r--tools/aapt/Bundle.h6
-rw-r--r--tools/aapt/Command.cpp44
-rw-r--r--tools/aapt/Images.cpp48
-rw-r--r--tools/aapt/Main.cpp2
-rw-r--r--tools/aapt/Resource.cpp44
-rw-r--r--tools/aapt/ResourceTable.cpp18
-rw-r--r--tools/aidl/Android.mk4
-rw-r--r--tools/aidl/aidl.cpp15
-rw-r--r--tools/layoutlib/bridge/src/android/content/res/AssetManager_Delegate.java2
-rw-r--r--tools/layoutlib/bridge/src/android/graphics/AvoidXfermode_Delegate.java2
-rw-r--r--tools/layoutlib/bridge/src/android/graphics/BitmapFactory_Delegate.java2
-rw-r--r--tools/layoutlib/bridge/src/android/graphics/BitmapShader_Delegate.java4
-rw-r--r--tools/layoutlib/bridge/src/android/graphics/Bitmap_Delegate.java50
-rw-r--r--tools/layoutlib/bridge/src/android/graphics/BlurMaskFilter_Delegate.java2
-rw-r--r--tools/layoutlib/bridge/src/android/graphics/Canvas_Delegate.java157
-rw-r--r--tools/layoutlib/bridge/src/android/graphics/ColorFilter_Delegate.java4
-rw-r--r--tools/layoutlib/bridge/src/android/graphics/ColorMatrixColorFilter_Delegate.java4
-rw-r--r--tools/layoutlib/bridge/src/android/graphics/ComposePathEffect_Delegate.java2
-rw-r--r--tools/layoutlib/bridge/src/android/graphics/ComposeShader_Delegate.java14
-rw-r--r--tools/layoutlib/bridge/src/android/graphics/CornerPathEffect_Delegate.java2
-rw-r--r--tools/layoutlib/bridge/src/android/graphics/DashPathEffect_Delegate.java2
-rw-r--r--tools/layoutlib/bridge/src/android/graphics/DiscretePathEffect_Delegate.java2
-rw-r--r--tools/layoutlib/bridge/src/android/graphics/DrawFilter_Delegate.java4
-rw-r--r--tools/layoutlib/bridge/src/android/graphics/EmbossMaskFilter_Delegate.java2
-rw-r--r--tools/layoutlib/bridge/src/android/graphics/LayerRasterizer_Delegate.java4
-rw-r--r--tools/layoutlib/bridge/src/android/graphics/LightingColorFilter_Delegate.java4
-rw-r--r--tools/layoutlib/bridge/src/android/graphics/LinearGradient_Delegate.java12
-rw-r--r--tools/layoutlib/bridge/src/android/graphics/MaskFilter_Delegate.java4
-rw-r--r--tools/layoutlib/bridge/src/android/graphics/Matrix_Delegate.java84
-rw-r--r--tools/layoutlib/bridge/src/android/graphics/NinePatch_Delegate.java18
-rw-r--r--tools/layoutlib/bridge/src/android/graphics/PaintFlagsDrawFilter_Delegate.java2
-rw-r--r--tools/layoutlib/bridge/src/android/graphics/Paint_Delegate.java72
-rw-r--r--tools/layoutlib/bridge/src/android/graphics/PathDashPathEffect_Delegate.java2
-rw-r--r--tools/layoutlib/bridge/src/android/graphics/PathEffect_Delegate.java4
-rw-r--r--tools/layoutlib/bridge/src/android/graphics/Path_Delegate.java82
-rw-r--r--tools/layoutlib/bridge/src/android/graphics/PixelXorXfermode_Delegate.java2
-rw-r--r--tools/layoutlib/bridge/src/android/graphics/PorterDuffColorFilter_Delegate.java4
-rw-r--r--tools/layoutlib/bridge/src/android/graphics/PorterDuffXfermode_Delegate.java2
-rw-r--r--tools/layoutlib/bridge/src/android/graphics/RadialGradient_Delegate.java8
-rw-r--r--tools/layoutlib/bridge/src/android/graphics/Rasterizer_Delegate.java4
-rw-r--r--tools/layoutlib/bridge/src/android/graphics/Region_Delegate.java32
-rw-r--r--tools/layoutlib/bridge/src/android/graphics/Shader_Delegate.java8
-rw-r--r--tools/layoutlib/bridge/src/android/graphics/SumPathEffect_Delegate.java2
-rw-r--r--tools/layoutlib/bridge/src/android/graphics/SweepGradient_Delegate.java8
-rw-r--r--tools/layoutlib/bridge/src/android/graphics/Typeface_Delegate.java16
-rw-r--r--tools/layoutlib/bridge/src/android/graphics/Xfermode_Delegate.java4
-rw-r--r--tools/layoutlib/bridge/src/android/view/IWindowManagerImpl.java5
-rw-r--r--tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java7
-rw-r--r--tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgePowerManager.java4
-rw-r--r--tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeWindow.java5
-rw-r--r--tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/DelegateManager.java8
-rw-r--r--tools/layoutlib/bridge/src/com/android/layoutlib/bridge/util/SparseWeakArray.java51
-rw-r--r--tools/layoutlib/bridge/src/libcore/icu/ICU_Delegate.java15
-rw-r--r--tools/layoutlib/create/README.txt272
-rw-r--r--tools/layoutlib/create/src/com/android/tools/layoutlib/create/AsmAnalyzer.java34
-rw-r--r--tools/layoutlib/create/src/com/android/tools/layoutlib/create/AsmGenerator.java36
-rw-r--r--tools/layoutlib/create/src/com/android/tools/layoutlib/create/Main.java5
-rw-r--r--tools/layoutlib/create/src/com/android/tools/layoutlib/create/ReplaceMethodCallsAdapter.java53
61 files changed, 752 insertions, 622 deletions
diff --git a/tools/aapt/AaptAssets.cpp b/tools/aapt/AaptAssets.cpp
index d8e113a..729a048 100644
--- a/tools/aapt/AaptAssets.cpp
+++ b/tools/aapt/AaptAssets.cpp
@@ -1117,6 +1117,11 @@ bool AaptGroupEntry::getUiModeTypeName(const char* name,
(out->uiMode&~ResTable_config::MASK_UI_MODE_TYPE)
| ResTable_config::UI_MODE_TYPE_APPLIANCE;
return true;
+ } else if (strcmp(name, "watch") == 0) {
+ if (out) out->uiMode =
+ (out->uiMode&~ResTable_config::MASK_UI_MODE_TYPE)
+ | ResTable_config::UI_MODE_TYPE_WATCH;
+ return true;
}
return false;
@@ -1631,9 +1636,18 @@ String8 AaptFile::getPrintableSource() const
// =========================================================================
// =========================================================================
-status_t AaptGroup::addFile(const sp<AaptFile>& file)
+status_t AaptGroup::addFile(const sp<AaptFile>& file, const bool overwriteDuplicate)
{
- if (mFiles.indexOfKey(file->getGroupEntry()) < 0) {
+ ssize_t index = mFiles.indexOfKey(file->getGroupEntry());
+ if (index >= 0 && overwriteDuplicate) {
+ fprintf(stderr, "warning: overwriting '%s' with '%s'\n",
+ mFiles[index]->getSourceFile().string(),
+ file->getSourceFile().string());
+ removeFile(index);
+ index = -1;
+ }
+
+ if (index < 0) {
file->mPath = mPath;
mFiles.add(file->getGroupEntry(), file);
return NO_ERROR;
@@ -1739,7 +1753,8 @@ void AaptDir::removeDir(const String8& name)
mDirs.removeItem(name);
}
-status_t AaptDir::addLeafFile(const String8& leafName, const sp<AaptFile>& file)
+status_t AaptDir::addLeafFile(const String8& leafName, const sp<AaptFile>& file,
+ const bool overwrite)
{
sp<AaptGroup> group;
if (mFiles.indexOfKey(leafName) >= 0) {
@@ -1749,12 +1764,12 @@ status_t AaptDir::addLeafFile(const String8& leafName, const sp<AaptFile>& file)
mFiles.add(leafName, group);
}
- return group->addFile(file);
+ return group->addFile(file, overwrite);
}
ssize_t AaptDir::slurpFullTree(Bundle* bundle, const String8& srcDir,
const AaptGroupEntry& kind, const String8& resType,
- sp<FilePathStore>& fullResPaths)
+ sp<FilePathStore>& fullResPaths, const bool overwrite)
{
Vector<String8> fileNames;
{
@@ -1813,7 +1828,7 @@ ssize_t AaptDir::slurpFullTree(Bundle* bundle, const String8& srcDir,
notAdded = true;
}
ssize_t res = subdir->slurpFullTree(bundle, pathName, kind,
- resType, fullResPaths);
+ resType, fullResPaths, overwrite);
if (res < NO_ERROR) {
return res;
}
@@ -1823,7 +1838,7 @@ ssize_t AaptDir::slurpFullTree(Bundle* bundle, const String8& srcDir,
count += res;
} else if (type == kFileTypeRegular) {
sp<AaptFile> file = new AaptFile(pathName, kind, resType);
- status_t err = addLeafFile(fileNames[i], file);
+ status_t err = addLeafFile(fileNames[i], file, overwrite);
if (err != NO_ERROR) {
return err;
}
@@ -2089,24 +2104,24 @@ ssize_t AaptAssets::slurpFromArgs(Bundle* bundle)
/*
* If a directory of custom assets was supplied, slurp 'em up.
*/
- if (bundle->getAssetSourceDir()) {
- const char* assetDir = bundle->getAssetSourceDir();
-
- FileType type = getFileType(assetDir);
+ const Vector<const char*>& assetDirs = bundle->getAssetSourceDirs();
+ const int AN = assetDirs.size();
+ for (int i = 0; i < AN; i++) {
+ FileType type = getFileType(assetDirs[i]);
if (type == kFileTypeNonexistent) {
- fprintf(stderr, "ERROR: asset directory '%s' does not exist\n", assetDir);
+ fprintf(stderr, "ERROR: asset directory '%s' does not exist\n", assetDirs[i]);
return UNKNOWN_ERROR;
}
if (type != kFileTypeDirectory) {
- fprintf(stderr, "ERROR: '%s' is not a directory\n", assetDir);
+ fprintf(stderr, "ERROR: '%s' is not a directory\n", assetDirs[i]);
return UNKNOWN_ERROR;
}
- String8 assetRoot(assetDir);
+ String8 assetRoot(assetDirs[i]);
sp<AaptDir> assetAaptDir = makeDir(String8(kAssetDir));
AaptGroupEntry group;
count = assetAaptDir->slurpFullTree(bundle, assetRoot, group,
- String8(), mFullAssetPaths);
+ String8(), mFullAssetPaths, true);
if (count < 0) {
totalCount = count;
goto bail;
@@ -2116,9 +2131,10 @@ ssize_t AaptAssets::slurpFromArgs(Bundle* bundle)
}
totalCount += count;
- if (bundle->getVerbose())
+ if (bundle->getVerbose()) {
printf("Found %d custom asset file%s in %s\n",
- count, (count==1) ? "" : "s", assetDir);
+ count, (count==1) ? "" : "s", assetDirs[i]);
+ }
}
/*
diff --git a/tools/aapt/AaptAssets.h b/tools/aapt/AaptAssets.h
index 5cfa913..9cc9007 100644
--- a/tools/aapt/AaptAssets.h
+++ b/tools/aapt/AaptAssets.h
@@ -235,7 +235,7 @@ public:
const DefaultKeyedVector<AaptGroupEntry, sp<AaptFile> >& getFiles() const
{ return mFiles; }
- status_t addFile(const sp<AaptFile>& file);
+ status_t addFile(const sp<AaptFile>& file, const bool overwriteDuplicate=false);
void removeFile(size_t index);
void print(const String8& prefix) const;
@@ -301,12 +301,14 @@ private:
status_t addDir(const String8& name, const sp<AaptDir>& dir);
sp<AaptDir> makeDir(const String8& name);
status_t addLeafFile(const String8& leafName,
- const sp<AaptFile>& file);
+ const sp<AaptFile>& file,
+ const bool overwrite=false);
virtual ssize_t slurpFullTree(Bundle* bundle,
const String8& srcDir,
const AaptGroupEntry& kind,
const String8& resType,
- sp<FilePathStore>& fullResPaths);
+ sp<FilePathStore>& fullResPaths,
+ const bool overwrite=false);
String8 mLeaf;
String8 mPath;
diff --git a/tools/aapt/Android.mk b/tools/aapt/Android.mk
index 452c60a..806f8ff 100644
--- a/tools/aapt/Android.mk
+++ b/tools/aapt/Android.mk
@@ -5,7 +5,7 @@
#
# This tool is prebuilt if we're doing an app-only build.
-ifeq ($(TARGET_BUILD_APPS),)
+ifeq ($(TARGET_BUILD_APPS)$(filter true,$(TARGET_BUILD_PDK)),)
aapt_src_files := \
@@ -50,7 +50,8 @@ LOCAL_STATIC_LIBRARIES := \
libcutils \
libexpat \
libpng \
- liblog
+ liblog \
+ libziparchive-host
ifeq ($(HOST_OS),linux)
LOCAL_LDLIBS += -lrt -ldl -lpthread
@@ -100,4 +101,4 @@ LOCAL_STATIC_LIBRARIES := \
include $(BUILD_EXECUTABLE)
endif
-endif # TARGET_BUILD_APPS
+endif # No TARGET_BUILD_APPS or TARGET_BUILD_PDK
diff --git a/tools/aapt/Bundle.h b/tools/aapt/Bundle.h
index 5089b9d..26b10a6 100644
--- a/tools/aapt/Bundle.h
+++ b/tools/aapt/Bundle.h
@@ -55,7 +55,6 @@ public:
mCompressionMethod(0), mJunkPath(false), mOutputAPKFile(NULL),
mManifestPackageNameOverride(NULL), mInstrumentationPackageNameOverride(NULL),
mAutoAddOverlay(false), mGenDependencies(false),
- mAssetSourceDir(NULL),
mCrunchedOutputDir(NULL), mProguardFile(NULL),
mAndroidManifestFile(NULL), mPublicOutputFile(NULL),
mRClassDir(NULL), mResourceIntermediatesDir(NULL), mManifestMinSdkVersion(NULL),
@@ -123,8 +122,8 @@ public:
/*
* Input options.
*/
- const char* getAssetSourceDir() const { return mAssetSourceDir; }
- void setAssetSourceDir(const char* dir) { mAssetSourceDir = dir; }
+ const android::Vector<const char*>& getAssetSourceDirs() const { return mAssetSourceDirs; }
+ void addAssetSourceDir(const char* dir) { mAssetSourceDirs.insertAt(dir,0); }
const char* getCrunchedOutputDir() const { return mCrunchedOutputDir; }
void setCrunchedOutputDir(const char* dir) { mCrunchedOutputDir = dir; }
const char* getProguardFile() const { return mProguardFile; }
@@ -272,6 +271,7 @@ private:
android::Vector<const char*> mPackageIncludes;
android::Vector<const char*> mJarFiles;
android::Vector<const char*> mNoCompressExtensions;
+ android::Vector<const char*> mAssetSourceDirs;
android::Vector<const char*> mResourceSourceDirs;
const char* mManifestMinSdkVersion;
diff --git a/tools/aapt/Command.cpp b/tools/aapt/Command.cpp
index 632efe0..d9e2dc5 100644
--- a/tools/aapt/Command.cpp
+++ b/tools/aapt/Command.cpp
@@ -375,6 +375,7 @@ enum {
LARGEST_WIDTH_LIMIT_DP_ATTR = 0x01010366,
PUBLIC_KEY_ATTR = 0x010103a6,
CATEGORY_ATTR = 0x010103e8,
+ BANNER_ATTR = 0x10103f2,
};
const char *getComponentName(String8 &pkgName, String8 &componentName) {
@@ -505,7 +506,7 @@ int doDump(Bundle* bundle)
const char* filename = bundle->getFileSpecEntry(1);
AssetManager assets;
- void* assetsCookie;
+ int32_t assetsCookie;
if (!assets.addAssetPath(String8(filename), &assetsCookie)) {
fprintf(stderr, "ERROR: dump failed because assets could not be loaded\n");
return 1;
@@ -677,6 +678,7 @@ int doDump(Bundle* bundle)
bool withinActivity = false;
bool isMainActivity = false;
bool isLauncherActivity = false;
+ bool isLeanbackLauncherActivity = false;
bool isSearchable = false;
bool withinApplication = false;
bool withinSupportsInput = false;
@@ -787,6 +789,7 @@ int doDump(Bundle* bundle)
String8 activityName;
String8 activityLabel;
String8 activityIcon;
+ String8 activityBanner;
String8 receiverName;
String8 serviceName;
Vector<String8> supportedInput;
@@ -810,15 +813,27 @@ int doDump(Bundle* bundle)
withinApplication = false;
withinSupportsInput = false;
} else if (depth < 3) {
- if (withinActivity && isMainActivity && isLauncherActivity) {
+ if (withinActivity && isMainActivity) {
const char *aName = getComponentName(pkg, activityName);
- printf("launchable-activity:");
- if (aName != NULL) {
- printf(" name='%s' ", aName);
+ if (isLauncherActivity) {
+ printf("launchable-activity:");
+ if (aName != NULL) {
+ printf(" name='%s' ", aName);
+ }
+ printf(" label='%s' icon='%s'\n",
+ activityLabel.string(),
+ activityIcon.string());
+ }
+ if (isLeanbackLauncherActivity) {
+ printf("leanback-launchable-activity:");
+ if (aName != NULL) {
+ printf(" name='%s' ", aName);
+ }
+ printf(" label='%s' icon='%s' banner='%s'\n",
+ activityLabel.string(),
+ activityIcon.string(),
+ activityBanner.string());
}
- printf(" label='%s' icon='%s'\n",
- activityLabel.string(),
- activityIcon.string());
}
if (!hasIntentFilter) {
hasOtherActivities |= withinActivity;
@@ -836,7 +851,7 @@ int doDump(Bundle* bundle)
withinService = false;
withinReceiver = false;
hasIntentFilter = false;
- isMainActivity = isLauncherActivity = false;
+ isMainActivity = isLauncherActivity = isLeanbackLauncherActivity = false;
} else if (depth < 4) {
if (withinIntentFilter) {
if (withinActivity) {
@@ -1231,6 +1246,13 @@ int doDump(Bundle* bundle)
goto bail;
}
+ activityBanner = getResolvedAttribute(&res, tree, BANNER_ATTR, &error);
+ if (error != "") {
+ fprintf(stderr, "ERROR getting 'android:banner' attribute: %s\n",
+ error.string());
+ goto bail;
+ }
+
int32_t orien = getResolvedIntegerAttribute(&res, tree,
SCREEN_ORIENTATION_ATTR, &error);
if (error == "") {
@@ -1412,6 +1434,8 @@ int doDump(Bundle* bundle)
if (withinActivity) {
if (category == "android.intent.category.LAUNCHER") {
isLauncherActivity = true;
+ } else if (category == "android.intent.category.LEANBACK_LAUNCHER") {
+ isLeanbackLauncherActivity = true;
}
}
}
@@ -1896,7 +1920,7 @@ int doPackage(Bundle* bundle)
N = bundle->getFileSpecCount();
if (N < 1 && bundle->getResourceSourceDirs().size() == 0 && bundle->getJarFiles().size() == 0
- && bundle->getAndroidManifestFile() == NULL && bundle->getAssetSourceDir() == NULL) {
+ && bundle->getAndroidManifestFile() == NULL && bundle->getAssetSourceDirs().size() == 0) {
fprintf(stderr, "ERROR: no input files\n");
goto bail;
}
diff --git a/tools/aapt/Images.cpp b/tools/aapt/Images.cpp
index 9de685a..25a948d 100644
--- a/tools/aapt/Images.cpp
+++ b/tools/aapt/Images.cpp
@@ -12,13 +12,15 @@
#include <utils/ByteOrder.h>
#include <png.h>
+#include <zlib.h>
#define NOISY(x) //x
static void
png_write_aapt_file(png_structp png_ptr, png_bytep data, png_size_t length)
{
- status_t err = ((AaptFile*)png_ptr->io_ptr)->writeData(data, length);
+ AaptFile* aaptfile = (AaptFile*) png_get_io_ptr(png_ptr);
+ status_t err = aaptfile->writeData(data, length);
if (err != NO_ERROR) {
png_error(png_ptr, "Write Error");
}
@@ -90,7 +92,7 @@ static void read_png(const char* imageName,
png_set_palette_to_rgb(read_ptr);
if (color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8)
- png_set_gray_1_2_4_to_8(read_ptr);
+ png_set_expand_gray_1_2_4_to_8(read_ptr);
if (png_get_valid(read_ptr, read_info, PNG_INFO_tRNS)) {
//printf("Has PNG_INFO_tRNS!\n");
@@ -109,7 +111,7 @@ static void read_png(const char* imageName,
png_read_update_info(read_ptr, read_info);
outImageInfo->rows = (png_bytepp)malloc(
- outImageInfo->height * png_sizeof(png_bytep));
+ outImageInfo->height * sizeof(png_bytep));
outImageInfo->allocHeight = outImageInfo->height;
outImageInfo->allocRows = outImageInfo->rows;
@@ -450,10 +452,11 @@ static status_t do_9patch(const char* imageName, image_info* image)
int maxSizeXDivs = W * sizeof(int32_t);
int maxSizeYDivs = H * sizeof(int32_t);
- int32_t* xDivs = (int32_t*) malloc(maxSizeXDivs);
- int32_t* yDivs = (int32_t*) malloc(maxSizeYDivs);
- uint8_t numXDivs = 0;
- uint8_t numYDivs = 0;
+ int32_t* xDivs = image->info9Patch.xDivs = (int32_t*) malloc(maxSizeXDivs);
+ int32_t* yDivs = image->info9Patch.yDivs = (int32_t*) malloc(maxSizeYDivs);
+ uint8_t numXDivs = 0;
+ uint8_t numYDivs = 0;
+
int8_t numColors;
int numRows;
int numCols;
@@ -508,6 +511,10 @@ static status_t do_9patch(const char* imageName, image_info* image)
goto getout;
}
+ // Copy patch size data into image...
+ image->info9Patch.numXDivs = numXDivs;
+ image->info9Patch.numYDivs = numYDivs;
+
// Find left and right of padding area...
if (get_horizontal_ticks(image->rows[H-1], W, transparent, false, &image->info9Patch.paddingLeft,
&image->info9Patch.paddingRight, &errorMsg, NULL, false) != NO_ERROR) {
@@ -543,12 +550,6 @@ static status_t do_9patch(const char* imageName, image_info* image)
image->layoutBoundsRight, image->layoutBoundsBottom));
}
- // Copy patch data into image
- image->info9Patch.numXDivs = numXDivs;
- image->info9Patch.numYDivs = numYDivs;
- image->info9Patch.xDivs = xDivs;
- image->info9Patch.yDivs = yDivs;
-
// If padding is not yet specified, take values from size.
if (image->info9Patch.paddingLeft < 0) {
image->info9Patch.paddingLeft = xDivs[0];
@@ -573,7 +574,7 @@ static status_t do_9patch(const char* imageName, image_info* image)
image->info9Patch.paddingTop, image->info9Patch.paddingBottom));
// Remove frame from image.
- image->rows = (png_bytepp)malloc((H-2) * png_sizeof(png_bytep));
+ image->rows = (png_bytepp)malloc((H-2) * sizeof(png_bytep));
for (i=0; i<(H-2); i++) {
image->rows[i] = image->allocRows[i+1];
memmove(image->rows[i], image->rows[i]+4, (W-2)*4);
@@ -955,7 +956,7 @@ static void analyze_image(const char *imageName, image_info &imageInfo, int gray
gg = *row++;
bb = *row++;
aa = *row++;
-
+
if (isGrayscale) {
*out++ = rr;
} else {
@@ -984,7 +985,7 @@ static void write_png(const char* imageName,
unknowns[0].data = NULL;
unknowns[1].data = NULL;
- png_bytepp outRows = (png_bytepp) malloc((int) imageInfo.height * png_sizeof(png_bytep));
+ png_bytepp outRows = (png_bytepp) malloc((int) imageInfo.height * sizeof(png_bytep));
if (outRows == (png_bytepp) 0) {
printf("Can't allocate output buffer!\n");
exit(1);
@@ -1073,18 +1074,19 @@ static void write_png(const char* imageName,
unknowns[b_index].size = chunk_size;
}
+ for (int i = 0; i < chunk_count; i++) {
+ unknowns[i].location = PNG_HAVE_PLTE;
+ }
png_set_keep_unknown_chunks(write_ptr, PNG_HANDLE_CHUNK_ALWAYS,
chunk_names, chunk_count);
png_set_unknown_chunks(write_ptr, write_info, unknowns, chunk_count);
- // XXX I can't get this to work without forcibly changing
- // the location to what I want... which apparently is supposed
- // to be a private API, but everything else I have tried results
- // in the location being set to what I -last- wrote so I never
- // get written. :p
+#if PNG_LIBPNG_VER < 10600
+ /* Deal with unknown chunk location bug in 1.5.x and earlier */
png_set_unknown_chunk_location(write_ptr, write_info, 0, PNG_HAVE_PLTE);
if (imageInfo.haveLayoutBounds) {
png_set_unknown_chunk_location(write_ptr, write_info, 1, PNG_HAVE_PLTE);
}
+#endif
}
@@ -1092,7 +1094,9 @@ static void write_png(const char* imageName,
png_bytepp rows;
if (color_type == PNG_COLOR_TYPE_RGB || color_type == PNG_COLOR_TYPE_RGB_ALPHA) {
- png_set_filler(write_ptr, 0, PNG_FILLER_AFTER);
+ if (color_type == PNG_COLOR_TYPE_RGB) {
+ png_set_filler(write_ptr, 0, PNG_FILLER_AFTER);
+ }
rows = imageInfo.rows;
} else {
rows = outRows;
diff --git a/tools/aapt/Main.cpp b/tools/aapt/Main.cpp
index 977226b..d1d3deb 100644
--- a/tools/aapt/Main.cpp
+++ b/tools/aapt/Main.cpp
@@ -345,7 +345,7 @@ int main(int argc, char* const argv[])
goto bail;
}
convertPath(argv[0]);
- bundle.setAssetSourceDir(argv[0]);
+ bundle.addAssetSourceDir(argv[0]);
break;
case 'G':
argc--;
diff --git a/tools/aapt/Resource.cpp b/tools/aapt/Resource.cpp
index 822bfa5..5865b00 100644
--- a/tools/aapt/Resource.cpp
+++ b/tools/aapt/Resource.cpp
@@ -469,7 +469,7 @@ static int validateAttr(const String8& path, const ResTable& table,
value.data);
return ATTR_NOT_FOUND;
}
-
+
pool = table.getTableStringBlock(strIdx);
#if 0
if (pool != NULL) {
@@ -705,7 +705,7 @@ bool addTagAttribute(const sp<XMLNode>& node, const char* ns8,
// don't stop the build.
return true;
}
-
+
node->addAttribute(ns, attr, String16(value));
return true;
}
@@ -756,7 +756,7 @@ status_t massageManifest(Bundle* bundle, sp<XMLNode> root)
bundle->getVersionName(), errorOnFailedInsert)) {
return UNKNOWN_ERROR;
}
-
+
if (bundle->getMinSdkVersion() != NULL
|| bundle->getTargetSdkVersion() != NULL
|| bundle->getMaxSdkVersion() != NULL) {
@@ -765,7 +765,7 @@ status_t massageManifest(Bundle* bundle, sp<XMLNode> root)
vers = XMLNode::newElement(root->getFilename(), String16(), String16("uses-sdk"));
root->insertChildAt(vers, 0);
}
-
+
if (!addTagAttribute(vers, RESOURCES_ANDROID_NAMESPACE, "minSdkVersion",
bundle->getMinSdkVersion(), errorOnFailedInsert)) {
return UNKNOWN_ERROR;
@@ -840,7 +840,7 @@ status_t massageManifest(Bundle* bundle, sp<XMLNode> root)
}
}
}
-
+
return NO_ERROR;
}
@@ -924,7 +924,7 @@ status_t buildResources(Bundle* bundle, const sp<AaptAssets>& assets)
// --------------------------------------------------------------
// resType -> leafName -> group
- KeyedVector<String8, sp<ResourceTypeSet> > *resources =
+ KeyedVector<String8, sp<ResourceTypeSet> > *resources =
new KeyedVector<String8, sp<ResourceTypeSet> >;
collect_files(assets, resources);
@@ -956,7 +956,7 @@ status_t buildResources(Bundle* bundle, const sp<AaptAssets>& assets)
// now go through any resource overlays and collect their files
sp<AaptAssets> current = assets->getOverlay();
while(current.get()) {
- KeyedVector<String8, sp<ResourceTypeSet> > *resources =
+ KeyedVector<String8, sp<ResourceTypeSet> > *resources =
new KeyedVector<String8, sp<ResourceTypeSet> >;
current->setResources(resources);
collect_files(current, resources);
@@ -1059,7 +1059,7 @@ status_t buildResources(Bundle* bundle, const sp<AaptAssets>& assets)
// compile resources
current = assets;
while(current.get()) {
- KeyedVector<String8, sp<ResourceTypeSet> > *resources =
+ KeyedVector<String8, sp<ResourceTypeSet> > *resources =
current->getResources();
ssize_t index = resources->indexOfKey(String8("values"));
@@ -1068,7 +1068,7 @@ status_t buildResources(Bundle* bundle, const sp<AaptAssets>& assets)
ssize_t res;
while ((res=it.next()) == NO_ERROR) {
sp<AaptFile> file = it.getFile();
- res = compileResourceFile(bundle, assets, file, it.getParams(),
+ res = compileResourceFile(bundle, assets, file, it.getParams(),
(current!=assets), &table);
if (res != NO_ERROR) {
hasErrors = true;
@@ -1254,7 +1254,7 @@ status_t buildResources(Bundle* bundle, const sp<AaptAssets>& assets)
if (table.validateLocalizations()) {
hasErrors = true;
}
-
+
if (hasErrors) {
return UNKNOWN_ERROR;
}
@@ -1287,7 +1287,7 @@ status_t buildResources(Bundle* bundle, const sp<AaptAssets>& assets)
ResTable finalResTable;
sp<AaptFile> resFile;
-
+
if (table.hasResources()) {
sp<AaptSymbols> symbols = assets->getSymbolsFor(String8("R"));
err = table.addSymbols(symbols);
@@ -1319,10 +1319,10 @@ status_t buildResources(Bundle* bundle, const sp<AaptAssets>& assets)
table.writePublicDefinitions(String16(assets->getPackage()), fp);
fclose(fp);
}
-
+
// Read resources back in,
finalResTable.add(resFile->getData(), resFile->getSize(), NULL);
-
+
#if 0
NOISY(
printf("Generated resources:\n");
@@ -1330,7 +1330,7 @@ status_t buildResources(Bundle* bundle, const sp<AaptAssets>& assets)
)
#endif
}
-
+
// Perform a basic validation of the manifest file. This time we
// parse it with the comments intact, so that we can use them to
// generate java docs... so we are not going to write this one
@@ -1425,7 +1425,7 @@ status_t buildResources(Bundle* bundle, const sp<AaptAssets>& assets)
ssize_t index = block.indexOfAttribute(RESOURCES_ANDROID_NAMESPACE, "name");
const uint16_t* id = block.getAttributeStringValue(index, &len);
if (id == NULL) {
- fprintf(stderr, "%s:%d: missing name attribute in element <%s>.\n",
+ fprintf(stderr, "%s:%d: missing name attribute in element <%s>.\n",
manifestPath.string(), block.getLineNumber(),
String8(block.getElementName(&len)).string());
hasErrors = true;
@@ -1583,7 +1583,7 @@ status_t buildResources(Bundle* bundle, const sp<AaptAssets>& assets)
return err;
}
}
-
+
return err;
}
@@ -1705,7 +1705,7 @@ static status_t writeLayoutClasses(
NA = idents.size();
bool deprecated = false;
-
+
String16 comment = symbols->getComment(realClassName);
fprintf(fp, "%s/** ", indentStr);
if (comment.size() > 0) {
@@ -1788,7 +1788,7 @@ static status_t writeLayoutClasses(
if (deprecated) {
fprintf(fp, "%s@Deprecated\n", indentStr);
}
-
+
fprintf(fp,
"%spublic static final int[] %s = {\n"
"%s",
@@ -1833,9 +1833,9 @@ static status_t writeLayoutClasses(
//printf("%s:%s/%s: 0x%08x\n", String8(package16).string(),
// String8(attr16).string(), String8(name16).string(), typeSpecFlags);
const bool pub = (typeSpecFlags&ResTable_typeSpec::SPEC_PUBLIC) != 0;
-
+
bool deprecated = false;
-
+
fprintf(fp, "%s/**\n", indentStr);
if (comment.size() > 0) {
String8 cmt(comment);
@@ -2220,10 +2220,10 @@ status_t writeResourceSymbols(Bundle* bundle, const sp<AaptAssets>& assets,
status_t err = writeSymbolClass(fp, assets, includePrivate, symbols,
className, 0, bundle->getNonConstantId());
+ fclose(fp);
if (err != NO_ERROR) {
return err;
}
- fclose(fp);
if (textSymbolsDest != NULL && R == className) {
String8 textDest(textSymbolsDest);
@@ -2242,10 +2242,10 @@ status_t writeResourceSymbols(Bundle* bundle, const sp<AaptAssets>& assets,
status_t err = writeTextSymbolClass(fp, assets, includePrivate, symbols,
className);
+ fclose(fp);
if (err != NO_ERROR) {
return err;
}
- fclose(fp);
}
// If we were asked to generate a dependency file, we'll go ahead and add this R.java
diff --git a/tools/aapt/ResourceTable.cpp b/tools/aapt/ResourceTable.cpp
index f2e5254..6ced8b3 100644
--- a/tools/aapt/ResourceTable.cpp
+++ b/tools/aapt/ResourceTable.cpp
@@ -1342,7 +1342,7 @@ status_t compileResourceFile(Bundle* bundle,
curType = string16;
curFormat = ResTable_map::TYPE_REFERENCE|ResTable_map::TYPE_STRING;
curIsStyled = true;
- curIsPseudolocalizable = true;
+ curIsPseudolocalizable = (translatable != false16);
} else if (strcmp16(block.getElementName(&len), drawable16.string()) == 0) {
curTag = &drawable16;
curType = drawable16;
@@ -1408,15 +1408,24 @@ status_t compileResourceFile(Bundle* bundle,
// Check whether these strings need valid formats.
// (simplified form of what string16 does above)
size_t n = block.getAttributeCount();
+
+ // Pseudolocalizable by default, unless this string array isn't
+ // translatable.
+ curIsPseudolocalizable = true;
for (size_t i = 0; i < n; i++) {
size_t length;
const uint16_t* attr = block.getAttributeName(i, &length);
- if (strcmp16(attr, translatable16.string()) == 0
- || strcmp16(attr, formatted16.string()) == 0) {
+ if (strcmp16(attr, translatable16.string()) == 0) {
+ const uint16_t* value = block.getAttributeStringValue(i, &length);
+ if (strcmp16(value, false16.string()) == 0) {
+ curIsPseudolocalizable = false;
+ }
+ }
+
+ if (strcmp16(attr, formatted16.string()) == 0) {
const uint16_t* value = block.getAttributeStringValue(i, &length);
if (strcmp16(value, false16.string()) == 0) {
curIsFormatted = false;
- break;
}
}
}
@@ -1426,7 +1435,6 @@ status_t compileResourceFile(Bundle* bundle,
curFormat = ResTable_map::TYPE_REFERENCE|ResTable_map::TYPE_STRING;
curIsBag = true;
curIsBagReplaceOnOverwrite = true;
- curIsPseudolocalizable = true;
} else if (strcmp16(block.getElementName(&len), integer_array16.string()) == 0) {
curTag = &integer_array16;
curType = array16;
diff --git a/tools/aidl/Android.mk b/tools/aidl/Android.mk
index 77d46ab..efd60a2 100644
--- a/tools/aidl/Android.mk
+++ b/tools/aidl/Android.mk
@@ -3,7 +3,7 @@
# Copies files into the directory structure described by a manifest
# This tool is prebuilt if we're doing an app-only build.
-ifeq ($(TARGET_BUILD_APPS),)
+ifeq ($(TARGET_BUILD_APPS)$(filter true,$(TARGET_BUILD_PDK)),)
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
@@ -26,4 +26,4 @@ LOCAL_MODULE := aidl
include $(BUILD_HOST_EXECUTABLE)
-endif # TARGET_BUILD_APPS
+endif # No TARGET_BUILD_APPS or TARGET_BUILD_PDK
diff --git a/tools/aidl/aidl.cpp b/tools/aidl/aidl.cpp
index b8a4803..a84d743 100644
--- a/tools/aidl/aidl.cpp
+++ b/tools/aidl/aidl.cpp
@@ -207,7 +207,7 @@ check_filename(const char* filename, const char* package, buffer_type* name)
p = strchr(name->data, '.');
len = p ? p-name->data : strlen(name->data);
expected.append(name->data, len);
-
+
expected += ".aidl";
len = fn.length();
@@ -473,7 +473,7 @@ check_method(const char* filename, int kind, method_type* m)
err = 1;
goto next;
}
-
+
if (!(kind == INTERFACE_TYPE_BINDER ? t->CanWriteToParcel() : t->CanWriteToRpcData())) {
fprintf(stderr, "%s:%d parameter %d: '%s %s' can't be marshalled.\n",
filename, m->type.type.lineno, index,
@@ -536,7 +536,7 @@ check_method(const char* filename, int kind, method_type* m)
filename, m->name.lineno, index, arg->name.data);
err = 1;
}
-
+
next:
index++;
arg = arg->next;
@@ -797,7 +797,7 @@ parse_preprocessed_file(const string& filename)
//printf("%s:%d:...%s...%s...%s...\n", filename.c_str(), lineno,
// type, packagename, classname);
document_item_type* doc;
-
+
if (0 == strcmp("parcelable", type)) {
user_data_type* parcl = (user_data_type*)malloc(
sizeof(user_data_type));
@@ -847,6 +847,7 @@ parse_preprocessed_file(const string& filename)
else {
fprintf(stderr, "%s:%d: bad type in line: %s\n",
filename.c_str(), lineno, line);
+ fclose(f);
return 1;
}
err = gather_types(filename.c_str(), doc);
@@ -1103,13 +1104,13 @@ preprocess_aidl(const Options& options)
}
// write preprocessed file
- int fd = open( options.outputFileName.c_str(),
+ int fd = open( options.outputFileName.c_str(),
O_RDWR|O_CREAT|O_TRUNC|O_BINARY,
#ifdef HAVE_MS_C_RUNTIME
_S_IREAD|_S_IWRITE);
-#else
+#else
S_IRUSR|S_IWUSR|S_IRGRP);
-#endif
+#endif
if (fd == -1) {
fprintf(stderr, "aidl: could not open file for write: %s\n",
options.outputFileName.c_str());
diff --git a/tools/layoutlib/bridge/src/android/content/res/AssetManager_Delegate.java b/tools/layoutlib/bridge/src/android/content/res/AssetManager_Delegate.java
index f3d6ba3..7df21ce 100644
--- a/tools/layoutlib/bridge/src/android/content/res/AssetManager_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/content/res/AssetManager_Delegate.java
@@ -29,7 +29,7 @@ public class AssetManager_Delegate {
@LayoutlibDelegate
/*package*/ static int newTheme(AssetManager manager) {
- return Resources_Theme_Delegate.getDelegateManager()
+ return (int) Resources_Theme_Delegate.getDelegateManager()
.addNewDelegate(new Resources_Theme_Delegate());
}
diff --git a/tools/layoutlib/bridge/src/android/graphics/AvoidXfermode_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/AvoidXfermode_Delegate.java
index a50a2bd..34ae825 100644
--- a/tools/layoutlib/bridge/src/android/graphics/AvoidXfermode_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/AvoidXfermode_Delegate.java
@@ -61,7 +61,7 @@ public class AvoidXfermode_Delegate extends Xfermode_Delegate {
// ---- native methods ----
@LayoutlibDelegate
- /*package*/ static int nativeCreate(int opColor, int tolerance, int nativeMode) {
+ /*package*/ static long nativeCreate(int opColor, int tolerance, int nativeMode) {
AvoidXfermode_Delegate newDelegate = new AvoidXfermode_Delegate();
return sManager.addNewDelegate(newDelegate);
}
diff --git a/tools/layoutlib/bridge/src/android/graphics/BitmapFactory_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/BitmapFactory_Delegate.java
index d85c3d1..06673c1 100644
--- a/tools/layoutlib/bridge/src/android/graphics/BitmapFactory_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/BitmapFactory_Delegate.java
@@ -102,7 +102,7 @@ import java.util.Set;
}
@LayoutlibDelegate
- /*package*/ static Bitmap nativeDecodeAsset(int asset, Rect padding, Options opts) {
+ /*package*/ static Bitmap nativeDecodeAsset(long asset, Rect padding, Options opts) {
opts.inBitmap = null;
return null;
}
diff --git a/tools/layoutlib/bridge/src/android/graphics/BitmapShader_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/BitmapShader_Delegate.java
index 65a75b0..cdbbe46 100644
--- a/tools/layoutlib/bridge/src/android/graphics/BitmapShader_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/BitmapShader_Delegate.java
@@ -65,7 +65,7 @@ public class BitmapShader_Delegate extends Shader_Delegate {
// ---- native methods ----
@LayoutlibDelegate
- /*package*/ static int nativeCreate(int native_bitmap, int shaderTileModeX,
+ /*package*/ static long nativeCreate(long native_bitmap, int shaderTileModeX,
int shaderTileModeY) {
Bitmap_Delegate bitmap = Bitmap_Delegate.getDelegate(native_bitmap);
if (bitmap == null) {
@@ -80,7 +80,7 @@ public class BitmapShader_Delegate extends Shader_Delegate {
}
@LayoutlibDelegate
- /*package*/ static int nativePostCreate(int native_shader, int native_bitmap,
+ /*package*/ static long nativePostCreate(long native_shader, long native_bitmap,
int shaderTileModeX, int shaderTileModeY) {
// pass, not needed.
return 0;
diff --git a/tools/layoutlib/bridge/src/android/graphics/Bitmap_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/Bitmap_Delegate.java
index f74e4d1..7016136 100644
--- a/tools/layoutlib/bridge/src/android/graphics/Bitmap_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/Bitmap_Delegate.java
@@ -83,7 +83,7 @@ public final class Bitmap_Delegate {
/**
* Returns the native delegate associated to a given an int referencing a {@link Bitmap} object.
*/
- public static Bitmap_Delegate getDelegate(int native_bitmap) {
+ public static Bitmap_Delegate getDelegate(long native_bitmap) {
return sManager.getDelegate(native_bitmap);
}
@@ -274,7 +274,7 @@ public final class Bitmap_Delegate {
}
@LayoutlibDelegate
- /*package*/ static Bitmap nativeCopy(int srcBitmap, int nativeConfig, boolean isMutable) {
+ /*package*/ static Bitmap nativeCopy(long srcBitmap, int nativeConfig, boolean isMutable) {
Bitmap_Delegate srcBmpDelegate = sManager.getDelegate(srcBitmap);
if (srcBmpDelegate == null) {
return null;
@@ -303,25 +303,25 @@ public final class Bitmap_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void nativeDestructor(int nativeBitmap) {
+ /*package*/ static void nativeDestructor(long nativeBitmap) {
sManager.removeJavaReferenceFor(nativeBitmap);
}
@LayoutlibDelegate
- /*package*/ static boolean nativeRecycle(int nativeBitmap) {
+ /*package*/ static boolean nativeRecycle(long nativeBitmap) {
sManager.removeJavaReferenceFor(nativeBitmap);
return true;
}
@LayoutlibDelegate
- /*package*/ static void nativeReconfigure(int nativeBitmap, int width, int height,
+ /*package*/ static void nativeReconfigure(long nativeBitmap, int width, int height,
int config, int allocSize) {
Bridge.getLog().error(LayoutLog.TAG_UNSUPPORTED,
"Bitmap.reconfigure() is not supported", null /*data*/);
}
@LayoutlibDelegate
- /*package*/ static boolean nativeCompress(int nativeBitmap, int format, int quality,
+ /*package*/ static boolean nativeCompress(long nativeBitmap, int format, int quality,
OutputStream stream, byte[] tempStorage) {
Bridge.getLog().error(LayoutLog.TAG_UNSUPPORTED,
"Bitmap.compress() is not supported", null /*data*/);
@@ -329,7 +329,7 @@ public final class Bitmap_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void nativeErase(int nativeBitmap, int color) {
+ /*package*/ static void nativeErase(long nativeBitmap, int color) {
// get the delegate from the native int.
Bitmap_Delegate delegate = sManager.getDelegate(nativeBitmap);
if (delegate == null) {
@@ -349,7 +349,7 @@ public final class Bitmap_Delegate {
}
@LayoutlibDelegate
- /*package*/ static int nativeRowBytes(int nativeBitmap) {
+ /*package*/ static int nativeRowBytes(long nativeBitmap) {
// get the delegate from the native int.
Bitmap_Delegate delegate = sManager.getDelegate(nativeBitmap);
if (delegate == null) {
@@ -360,7 +360,7 @@ public final class Bitmap_Delegate {
}
@LayoutlibDelegate
- /*package*/ static int nativeConfig(int nativeBitmap) {
+ /*package*/ static int nativeConfig(long nativeBitmap) {
// get the delegate from the native int.
Bitmap_Delegate delegate = sManager.getDelegate(nativeBitmap);
if (delegate == null) {
@@ -371,7 +371,7 @@ public final class Bitmap_Delegate {
}
@LayoutlibDelegate
- /*package*/ static boolean nativeHasAlpha(int nativeBitmap) {
+ /*package*/ static boolean nativeHasAlpha(long nativeBitmap) {
// get the delegate from the native int.
Bitmap_Delegate delegate = sManager.getDelegate(nativeBitmap);
if (delegate == null) {
@@ -382,7 +382,7 @@ public final class Bitmap_Delegate {
}
@LayoutlibDelegate
- /*package*/ static boolean nativeHasMipMap(int nativeBitmap) {
+ /*package*/ static boolean nativeHasMipMap(long nativeBitmap) {
// get the delegate from the native int.
Bitmap_Delegate delegate = sManager.getDelegate(nativeBitmap);
if (delegate == null) {
@@ -393,7 +393,7 @@ public final class Bitmap_Delegate {
}
@LayoutlibDelegate
- /*package*/ static int nativeGetPixel(int nativeBitmap, int x, int y,
+ /*package*/ static int nativeGetPixel(long nativeBitmap, int x, int y,
boolean isPremultiplied) {
// get the delegate from the native int.
Bitmap_Delegate delegate = sManager.getDelegate(nativeBitmap);
@@ -406,7 +406,7 @@ public final class Bitmap_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void nativeGetPixels(int nativeBitmap, int[] pixels, int offset,
+ /*package*/ static void nativeGetPixels(long nativeBitmap, int[] pixels, int offset,
int stride, int x, int y, int width, int height, boolean isPremultiplied) {
Bitmap_Delegate delegate = sManager.getDelegate(nativeBitmap);
if (delegate == null) {
@@ -418,7 +418,7 @@ public final class Bitmap_Delegate {
@LayoutlibDelegate
- /*package*/ static void nativeSetPixel(int nativeBitmap, int x, int y, int color,
+ /*package*/ static void nativeSetPixel(long nativeBitmap, int x, int y, int color,
boolean isPremultiplied) {
Bitmap_Delegate delegate = sManager.getDelegate(nativeBitmap);
if (delegate == null) {
@@ -429,7 +429,7 @@ public final class Bitmap_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void nativeSetPixels(int nativeBitmap, int[] colors, int offset,
+ /*package*/ static void nativeSetPixels(long nativeBitmap, int[] colors, int offset,
int stride, int x, int y, int width, int height, boolean isPremultiplied) {
Bitmap_Delegate delegate = sManager.getDelegate(nativeBitmap);
if (delegate == null) {
@@ -440,21 +440,21 @@ public final class Bitmap_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void nativeCopyPixelsToBuffer(int nativeBitmap, Buffer dst) {
+ /*package*/ static void nativeCopyPixelsToBuffer(long nativeBitmap, Buffer dst) {
// FIXME implement native delegate
Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
"Bitmap.copyPixelsToBuffer is not supported.", null, null /*data*/);
}
@LayoutlibDelegate
- /*package*/ static void nativeCopyPixelsFromBuffer(int nb, Buffer src) {
+ /*package*/ static void nativeCopyPixelsFromBuffer(long nb, Buffer src) {
// FIXME implement native delegate
Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
"Bitmap.copyPixelsFromBuffer is not supported.", null, null /*data*/);
}
@LayoutlibDelegate
- /*package*/ static int nativeGenerationId(int nativeBitmap) {
+ /*package*/ static int nativeGenerationId(long nativeBitmap) {
Bitmap_Delegate delegate = sManager.getDelegate(nativeBitmap);
if (delegate == null) {
return 0;
@@ -474,7 +474,7 @@ public final class Bitmap_Delegate {
}
@LayoutlibDelegate
- /*package*/ static boolean nativeWriteToParcel(int nativeBitmap, boolean isMutable,
+ /*package*/ static boolean nativeWriteToParcel(long nativeBitmap, boolean isMutable,
int density, Parcel p) {
// This is only called when sending a bitmap through aidl, so really this should not
// be called.
@@ -485,7 +485,7 @@ public final class Bitmap_Delegate {
}
@LayoutlibDelegate
- /*package*/ static Bitmap nativeExtractAlpha(int nativeBitmap, int nativePaint,
+ /*package*/ static Bitmap nativeExtractAlpha(long nativeBitmap, long nativePaint,
int[] offsetXY) {
Bitmap_Delegate bitmap = sManager.getDelegate(nativeBitmap);
if (bitmap == null) {
@@ -513,12 +513,12 @@ public final class Bitmap_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void nativePrepareToDraw(int nativeBitmap) {
+ /*package*/ static void nativePrepareToDraw(long nativeBitmap) {
// nothing to be done here.
}
@LayoutlibDelegate
- /*package*/ static void nativeSetAlphaAndPremultiplied(int nativeBitmap, boolean hasAlpha,
+ /*package*/ static void nativeSetAlphaAndPremultiplied(long nativeBitmap, boolean hasAlpha,
boolean isPremul) {
// get the delegate from the native int.
Bitmap_Delegate delegate = sManager.getDelegate(nativeBitmap);
@@ -530,7 +530,7 @@ public final class Bitmap_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void nativeSetHasMipMap(int nativeBitmap, boolean hasMipMap) {
+ /*package*/ static void nativeSetHasMipMap(long nativeBitmap, boolean hasMipMap) {
// get the delegate from the native int.
Bitmap_Delegate delegate = sManager.getDelegate(nativeBitmap);
if (delegate == null) {
@@ -541,7 +541,7 @@ public final class Bitmap_Delegate {
}
@LayoutlibDelegate
- /*package*/ static boolean nativeSameAs(int nb0, int nb1) {
+ /*package*/ static boolean nativeSameAs(long nb0, long nb1) {
Bitmap_Delegate delegate1 = sManager.getDelegate(nb0);
if (delegate1 == null) {
return false;
@@ -594,7 +594,7 @@ public final class Bitmap_Delegate {
private static Bitmap createBitmap(Bitmap_Delegate delegate,
Set<BitmapCreateFlags> createFlags, int density) {
// get its native_int
- int nativeInt = sManager.addNewDelegate(delegate);
+ long nativeInt = sManager.addNewDelegate(delegate);
int width = delegate.mImage.getWidth();
int height = delegate.mImage.getHeight();
diff --git a/tools/layoutlib/bridge/src/android/graphics/BlurMaskFilter_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/BlurMaskFilter_Delegate.java
index 4becba1..d2569c7 100644
--- a/tools/layoutlib/bridge/src/android/graphics/BlurMaskFilter_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/BlurMaskFilter_Delegate.java
@@ -55,7 +55,7 @@ public class BlurMaskFilter_Delegate extends MaskFilter_Delegate {
// ---- native methods ----
@LayoutlibDelegate
- /*package*/ static int nativeConstructor(float radius, int style) {
+ /*package*/ static long nativeConstructor(float radius, int style) {
BlurMaskFilter_Delegate newDelegate = new BlurMaskFilter_Delegate();
return sManager.addNewDelegate(newDelegate);
}
diff --git a/tools/layoutlib/bridge/src/android/graphics/Canvas_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/Canvas_Delegate.java
index 10ad0a3..44a8e49 100644
--- a/tools/layoutlib/bridge/src/android/graphics/Canvas_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/Canvas_Delegate.java
@@ -77,7 +77,7 @@ public final class Canvas_Delegate {
/**
* Returns the native delegate associated to a given an int referencing a {@link Canvas} object.
*/
- public static Canvas_Delegate getDelegate(int native_canvas) {
+ public static Canvas_Delegate getDelegate(long native_canvas) {
return sManager.getDelegate(native_canvas);
}
@@ -310,7 +310,7 @@ public final class Canvas_Delegate {
}
@LayoutlibDelegate
- /*package*/ static int initRaster(int nativeBitmapOrZero) {
+ /*package*/ static long initRaster(long nativeBitmapOrZero) {
if (nativeBitmapOrZero > 0) {
// get the Bitmap from the int
Bitmap_Delegate bitmapDelegate = Bitmap_Delegate.getDelegate(nativeBitmapOrZero);
@@ -328,7 +328,7 @@ public final class Canvas_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void copyNativeCanvasState(int srcCanvas, int dstCanvas) {
+ /*package*/ static void copyNativeCanvasState(long srcCanvas, long dstCanvas) {
// get the delegate from the native int.
Canvas_Delegate srcCanvasDelegate = sManager.getDelegate(srcCanvas);
if (srcCanvasDelegate == null) {
@@ -344,8 +344,8 @@ public final class Canvas_Delegate {
}
@LayoutlibDelegate
- /*package*/ static int native_saveLayer(int nativeCanvas, RectF bounds,
- int paint, int layerFlags) {
+ /*package*/ static int native_saveLayer(long nativeCanvas, RectF bounds,
+ long paint, int layerFlags) {
// get the delegate from the native int.
Canvas_Delegate canvasDelegate = sManager.getDelegate(nativeCanvas);
if (canvasDelegate == null) {
@@ -361,9 +361,9 @@ public final class Canvas_Delegate {
}
@LayoutlibDelegate
- /*package*/ static int native_saveLayer(int nativeCanvas, float l,
+ /*package*/ static int native_saveLayer(long nativeCanvas, float l,
float t, float r, float b,
- int paint, int layerFlags) {
+ long paint, int layerFlags) {
// get the delegate from the native int.
Canvas_Delegate canvasDelegate = sManager.getDelegate(nativeCanvas);
if (canvasDelegate == null) {
@@ -380,7 +380,7 @@ public final class Canvas_Delegate {
}
@LayoutlibDelegate
- /*package*/ static int native_saveLayerAlpha(int nativeCanvas,
+ /*package*/ static int native_saveLayerAlpha(long nativeCanvas,
RectF bounds, int alpha,
int layerFlags) {
// get the delegate from the native int.
@@ -393,7 +393,7 @@ public final class Canvas_Delegate {
}
@LayoutlibDelegate
- /*package*/ static int native_saveLayerAlpha(int nativeCanvas, float l,
+ /*package*/ static int native_saveLayerAlpha(long nativeCanvas, float l,
float t, float r, float b,
int alpha, int layerFlags) {
// get the delegate from the native int.
@@ -407,7 +407,7 @@ public final class Canvas_Delegate {
@LayoutlibDelegate
- /*package*/ static void native_concat(int nCanvas, int nMatrix) {
+ /*package*/ static void native_concat(long nCanvas, long nMatrix) {
// get the delegate from the native int.
Canvas_Delegate canvasDelegate = sManager.getDelegate(nCanvas);
if (canvasDelegate == null) {
@@ -435,7 +435,7 @@ public final class Canvas_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void native_setMatrix(int nCanvas, int nMatrix) {
+ /*package*/ static void native_setMatrix(long nCanvas, long nMatrix) {
// get the delegate from the native int.
Canvas_Delegate canvasDelegate = sManager.getDelegate(nCanvas);
if (canvasDelegate == null) {
@@ -465,7 +465,7 @@ public final class Canvas_Delegate {
}
@LayoutlibDelegate
- /*package*/ static boolean native_clipRect(int nCanvas,
+ /*package*/ static boolean native_clipRect(long nCanvas,
float left, float top,
float right, float bottom,
int regionOp) {
@@ -480,8 +480,8 @@ public final class Canvas_Delegate {
}
@LayoutlibDelegate
- /*package*/ static boolean native_clipPath(int nativeCanvas,
- int nativePath,
+ /*package*/ static boolean native_clipPath(long nativeCanvas,
+ long nativePath,
int regionOp) {
Canvas_Delegate canvasDelegate = sManager.getDelegate(nativeCanvas);
if (canvasDelegate == null) {
@@ -497,8 +497,8 @@ public final class Canvas_Delegate {
}
@LayoutlibDelegate
- /*package*/ static boolean native_clipRegion(int nativeCanvas,
- int nativeRegion,
+ /*package*/ static boolean native_clipRegion(long nativeCanvas,
+ long nativeRegion,
int regionOp) {
Canvas_Delegate canvasDelegate = sManager.getDelegate(nativeCanvas);
if (canvasDelegate == null) {
@@ -514,7 +514,7 @@ public final class Canvas_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void nativeSetDrawFilter(int nativeCanvas, int nativeFilter) {
+ /*package*/ static void nativeSetDrawFilter(long nativeCanvas, long nativeFilter) {
Canvas_Delegate canvasDelegate = sManager.getDelegate(nativeCanvas);
if (canvasDelegate == null) {
return;
@@ -530,7 +530,7 @@ public final class Canvas_Delegate {
}
@LayoutlibDelegate
- /*package*/ static boolean native_getClipBounds(int nativeCanvas,
+ /*package*/ static boolean native_getClipBounds(long nativeCanvas,
Rect bounds) {
// get the delegate from the native int.
Canvas_Delegate canvasDelegate = sManager.getDelegate(nativeCanvas);
@@ -551,7 +551,7 @@ public final class Canvas_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void native_getCTM(int canvas, int matrix) {
+ /*package*/ static void native_getCTM(long canvas, long matrix) {
// get the delegate from the native int.
Canvas_Delegate canvasDelegate = sManager.getDelegate(canvas);
if (canvasDelegate == null) {
@@ -568,21 +568,21 @@ public final class Canvas_Delegate {
}
@LayoutlibDelegate
- /*package*/ static boolean native_quickReject(int nativeCanvas,
+ /*package*/ static boolean native_quickReject(long nativeCanvas,
RectF rect) {
// FIXME properly implement quickReject
return false;
}
@LayoutlibDelegate
- /*package*/ static boolean native_quickReject(int nativeCanvas,
- int path) {
+ /*package*/ static boolean native_quickReject(long nativeCanvas,
+ long path) {
// FIXME properly implement quickReject
return false;
}
@LayoutlibDelegate
- /*package*/ static boolean native_quickReject(int nativeCanvas,
+ /*package*/ static boolean native_quickReject(long nativeCanvas,
float left, float top,
float right, float bottom) {
// FIXME properly implement quickReject
@@ -590,25 +590,25 @@ public final class Canvas_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void native_drawRGB(int nativeCanvas, int r, int g, int b) {
+ /*package*/ static void native_drawRGB(long nativeCanvas, int r, int g, int b) {
native_drawColor(nativeCanvas, 0xFF000000 | r << 16 | (g&0xFF) << 8 | (b&0xFF),
PorterDuff.Mode.SRC_OVER.nativeInt);
}
@LayoutlibDelegate
- /*package*/ static void native_drawARGB(int nativeCanvas, int a, int r, int g, int b) {
+ /*package*/ static void native_drawARGB(long nativeCanvas, int a, int r, int g, int b) {
native_drawColor(nativeCanvas, a << 24 | (r&0xFF) << 16 | (g&0xFF) << 8 | (b&0xFF),
PorterDuff.Mode.SRC_OVER.nativeInt);
}
@LayoutlibDelegate
- /*package*/ static void native_drawColor(int nativeCanvas, int color) {
+ /*package*/ static void native_drawColor(long nativeCanvas, int color) {
native_drawColor(nativeCanvas, color, PorterDuff.Mode.SRC_OVER.nativeInt);
}
@LayoutlibDelegate
- /*package*/ static void native_drawColor(int nativeCanvas, final int color, final int mode) {
+ /*package*/ static void native_drawColor(long nativeCanvas, final int color, final int mode) {
// get the delegate from the native int.
Canvas_Delegate canvasDelegate = sManager.getDelegate(nativeCanvas);
if (canvasDelegate == null) {
@@ -639,16 +639,16 @@ public final class Canvas_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void native_drawPaint(int nativeCanvas, int paint) {
+ /*package*/ static void native_drawPaint(long nativeCanvas, long paint) {
// FIXME
Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
"Canvas.drawPaint is not supported.", null, null /*data*/);
}
@LayoutlibDelegate
- /*package*/ static void native_drawLine(int nativeCanvas,
+ /*package*/ static void native_drawLine(long nativeCanvas,
final float startX, final float startY, final float stopX, final float stopY,
- int paint) {
+ long paint) {
draw(nativeCanvas, paint, false /*compositeOnly*/, false /*forceSrcMode*/,
new GcSnapshot.Drawable() {
@@ -660,14 +660,13 @@ public final class Canvas_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void native_drawRect(int nativeCanvas, RectF rect,
- int paint) {
+ /*package*/ static void native_drawRect(long nativeCanvas, RectF rect, long paint) {
native_drawRect(nativeCanvas, rect.left, rect.top, rect.right, rect.bottom, paint);
}
@LayoutlibDelegate
- /*package*/ static void native_drawRect(int nativeCanvas,
- final float left, final float top, final float right, final float bottom, int paint) {
+ /*package*/ static void native_drawRect(long nativeCanvas,
+ final float left, final float top, final float right, final float bottom, long paint) {
draw(nativeCanvas, paint, false /*compositeOnly*/, false /*forceSrcMode*/,
new GcSnapshot.Drawable() {
@@ -692,7 +691,7 @@ public final class Canvas_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void native_drawOval(int nativeCanvas, final RectF oval, int paint) {
+ /*package*/ static void native_drawOval(long nativeCanvas, final RectF oval, long paint) {
if (oval.right > oval.left && oval.bottom > oval.top) {
draw(nativeCanvas, paint, false /*compositeOnly*/, false /*forceSrcMode*/,
new GcSnapshot.Drawable() {
@@ -718,17 +717,17 @@ public final class Canvas_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void native_drawCircle(int nativeCanvas,
- float cx, float cy, float radius, int paint) {
+ /*package*/ static void native_drawCircle(long nativeCanvas,
+ float cx, float cy, float radius, long paint) {
native_drawOval(nativeCanvas,
new RectF(cx - radius, cy - radius, cx + radius, cy + radius),
paint);
}
@LayoutlibDelegate
- /*package*/ static void native_drawArc(int nativeCanvas,
+ /*package*/ static void native_drawArc(long nativeCanvas,
final RectF oval, final float startAngle, final float sweep,
- final boolean useCenter, int paint) {
+ final boolean useCenter, long paint) {
if (oval.right > oval.left && oval.bottom > oval.top) {
draw(nativeCanvas, paint, false /*compositeOnly*/, false /*forceSrcMode*/,
new GcSnapshot.Drawable() {
@@ -757,8 +756,8 @@ public final class Canvas_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void native_drawRoundRect(int nativeCanvas,
- final RectF rect, final float rx, final float ry, int paint) {
+ /*package*/ static void native_drawRoundRect(long nativeCanvas,
+ final RectF rect, final float rx, final float ry, long paint) {
draw(nativeCanvas, paint, false /*compositeOnly*/, false /*forceSrcMode*/,
new GcSnapshot.Drawable() {
@@ -787,7 +786,7 @@ public final class Canvas_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void native_drawPath(int nativeCanvas, int path, int paint) {
+ /*package*/ static void native_drawPath(long nativeCanvas, long path, long paint) {
final Path_Delegate pathDelegate = Path_Delegate.getDelegate(path);
if (pathDelegate == null) {
return;
@@ -814,9 +813,9 @@ public final class Canvas_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void native_drawBitmap(Canvas thisCanvas, int nativeCanvas, int bitmap,
+ /*package*/ static void native_drawBitmap(Canvas thisCanvas, long nativeCanvas, long bitmap,
float left, float top,
- int nativePaintOrZero,
+ long nativePaintOrZero,
int canvasDensity,
int screenDensity,
int bitmapDensity) {
@@ -836,9 +835,9 @@ public final class Canvas_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void native_drawBitmap(Canvas thisCanvas, int nativeCanvas, int bitmap,
+ /*package*/ static void native_drawBitmap(Canvas thisCanvas, long nativeCanvas, long bitmap,
Rect src, RectF dst,
- int nativePaintOrZero,
+ long nativePaintOrZero,
int screenDensity,
int bitmapDensity) {
// get the delegate from the native int.
@@ -861,9 +860,9 @@ public final class Canvas_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void native_drawBitmap(int nativeCanvas, int bitmap,
+ /*package*/ static void native_drawBitmap(long nativeCanvas, long bitmap,
Rect src, Rect dst,
- int nativePaintOrZero,
+ long nativePaintOrZero,
int screenDensity,
int bitmapDensity) {
// get the delegate from the native int.
@@ -886,11 +885,11 @@ public final class Canvas_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void native_drawBitmap(int nativeCanvas, int[] colors,
+ /*package*/ static void native_drawBitmap(long nativeCanvas, int[] colors,
int offset, int stride, final float x,
final float y, int width, int height,
boolean hasAlpha,
- int nativePaintOrZero) {
+ long nativePaintOrZero) {
// create a temp BufferedImage containing the content.
final BufferedImage image = new BufferedImage(width, height,
@@ -912,8 +911,8 @@ public final class Canvas_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void nativeDrawBitmapMatrix(int nCanvas, int nBitmap,
- int nMatrix, int nPaint) {
+ /*package*/ static void nativeDrawBitmapMatrix(long nCanvas, long nBitmap,
+ long nMatrix, long nPaint) {
// get the delegate from the native int.
Canvas_Delegate canvasDelegate = sManager.getDelegate(nCanvas);
if (canvasDelegate == null) {
@@ -953,30 +952,30 @@ public final class Canvas_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void nativeDrawBitmapMesh(int nCanvas, int nBitmap,
+ /*package*/ static void nativeDrawBitmapMesh(long nCanvas, long nBitmap,
int meshWidth, int meshHeight, float[] verts, int vertOffset, int[] colors,
- int colorOffset, int nPaint) {
+ int colorOffset, long nPaint) {
// FIXME
Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
"Canvas.drawBitmapMesh is not supported.", null, null /*data*/);
}
@LayoutlibDelegate
- /*package*/ static void nativeDrawVertices(int nCanvas, int mode, int n,
+ /*package*/ static void nativeDrawVertices(long nCanvas, int mode, int n,
float[] verts, int vertOffset,
float[] texs, int texOffset,
int[] colors, int colorOffset,
short[] indices, int indexOffset,
- int indexCount, int nPaint) {
+ int indexCount, long nPaint) {
// FIXME
Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
"Canvas.drawVertices is not supported.", null, null /*data*/);
}
@LayoutlibDelegate
- /*package*/ static void native_drawText(int nativeCanvas,
+ /*package*/ static void native_drawText(long nativeCanvas,
final char[] text, final int index, final int count,
- final float startX, final float startY, final int flags, int paint) {
+ final float startX, final float startY, final int flags, long paint) {
draw(nativeCanvas, paint, false /*compositeOnly*/, false /*forceSrcMode*/,
new GcSnapshot.Drawable() {
@@ -1006,8 +1005,8 @@ public final class Canvas_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void native_drawText(int nativeCanvas, String text,
- int start, int end, float x, float y, final int flags, int paint) {
+ /*package*/ static void native_drawText(long nativeCanvas, String text,
+ int start, int end, float x, float y, final int flags, long paint) {
int count = end - start;
char[] buffer = TemporaryBuffer.obtain(count);
TextUtils.getChars(text, start, end, buffer, 0);
@@ -1016,9 +1015,9 @@ public final class Canvas_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void native_drawTextRun(int nativeCanvas, String text,
+ /*package*/ static void native_drawTextRun(long nativeCanvas, String text,
int start, int end, int contextStart, int contextEnd,
- float x, float y, int flags, int paint) {
+ float x, float y, int flags, long paint) {
int count = end - start;
char[] buffer = TemporaryBuffer.obtain(count);
TextUtils.getChars(text, start, end, buffer, 0);
@@ -1027,56 +1026,56 @@ public final class Canvas_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void native_drawTextRun(int nativeCanvas, char[] text,
+ /*package*/ static void native_drawTextRun(long nativeCanvas, char[] text,
int start, int count, int contextStart, int contextCount,
- float x, float y, int flags, int paint) {
+ float x, float y, int flags, long paint) {
native_drawText(nativeCanvas, text, start, count, x, y, flags, paint);
}
@LayoutlibDelegate
- /*package*/ static void native_drawPosText(int nativeCanvas,
+ /*package*/ static void native_drawPosText(long nativeCanvas,
char[] text, int index,
int count, float[] pos,
- int paint) {
+ long paint) {
// FIXME
Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
"Canvas.drawPosText is not supported.", null, null /*data*/);
}
@LayoutlibDelegate
- /*package*/ static void native_drawPosText(int nativeCanvas,
+ /*package*/ static void native_drawPosText(long nativeCanvas,
String text, float[] pos,
- int paint) {
+ long paint) {
// FIXME
Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
"Canvas.drawPosText is not supported.", null, null /*data*/);
}
@LayoutlibDelegate
- /*package*/ static void native_drawTextOnPath(int nativeCanvas,
+ /*package*/ static void native_drawTextOnPath(long nativeCanvas,
char[] text, int index,
- int count, int path,
+ int count, long path,
float hOffset,
float vOffset, int bidiFlags,
- int paint) {
+ long paint) {
// FIXME
Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
"Canvas.drawTextOnPath is not supported.", null, null /*data*/);
}
@LayoutlibDelegate
- /*package*/ static void native_drawTextOnPath(int nativeCanvas,
- String text, int path,
+ /*package*/ static void native_drawTextOnPath(long nativeCanvas,
+ String text, long path,
float hOffset,
float vOffset,
- int flags, int paint) {
+ int flags, long paint) {
// FIXME
Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
"Canvas.drawTextOnPath is not supported.", null, null /*data*/);
}
@LayoutlibDelegate
- /*package*/ static void finalizer(int nativeCanvas) {
+ /*package*/ static void finalizer(long nativeCanvas) {
// get the delegate from the native int so that it can be disposed.
Canvas_Delegate canvasDelegate = sManager.getDelegate(nativeCanvas);
if (canvasDelegate == null) {
@@ -1096,7 +1095,7 @@ public final class Canvas_Delegate {
* <p>Note that the drawable may actually be executed several times if there are
* layers involved (see {@link #saveLayer(RectF, int, int)}.
*/
- private static void draw(int nCanvas, int nPaint, boolean compositeOnly, boolean forceSrcMode,
+ private static void draw(long nCanvas, long nPaint, boolean compositeOnly, boolean forceSrcMode,
GcSnapshot.Drawable drawable) {
// get the delegate from the native int.
Canvas_Delegate canvasDelegate = sManager.getDelegate(nCanvas);
@@ -1116,7 +1115,7 @@ public final class Canvas_Delegate {
* <p>Note that the drawable may actually be executed several times if there are
* layers involved (see {@link #saveLayer(RectF, int, int)}.
*/
- private static void draw(int nCanvas, GcSnapshot.Drawable drawable) {
+ private static void draw(long nCanvas, GcSnapshot.Drawable drawable) {
// get the delegate from the native int.
Canvas_Delegate canvasDelegate = sManager.getDelegate(nCanvas);
if (canvasDelegate == null) {
@@ -1194,9 +1193,9 @@ public final class Canvas_Delegate {
}
private static void drawBitmap(
- int nativeCanvas,
+ long nativeCanvas,
Bitmap_Delegate bitmap,
- int nativePaintOrZero,
+ long nativePaintOrZero,
final int sleft, final int stop, final int sright, final int sbottom,
final int dleft, final int dtop, final int dright, final int dbottom) {
// get the delegate from the native int.
diff --git a/tools/layoutlib/bridge/src/android/graphics/ColorFilter_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/ColorFilter_Delegate.java
index e5a7ab6..d6b3da1 100644
--- a/tools/layoutlib/bridge/src/android/graphics/ColorFilter_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/ColorFilter_Delegate.java
@@ -46,7 +46,7 @@ public abstract class ColorFilter_Delegate {
// ---- Public Helper methods ----
- public static ColorFilter_Delegate getDelegate(int nativeShader) {
+ public static ColorFilter_Delegate getDelegate(long nativeShader) {
return sManager.getDelegate(nativeShader);
}
@@ -56,7 +56,7 @@ public abstract class ColorFilter_Delegate {
// ---- native methods ----
@LayoutlibDelegate
- /*package*/ static void finalizer(int native_instance, int nativeColorFilter) {
+ /*package*/ static void finalizer(long native_instance, long nativeColorFilter) {
sManager.removeJavaReferenceFor(native_instance);
}
diff --git a/tools/layoutlib/bridge/src/android/graphics/ColorMatrixColorFilter_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/ColorMatrixColorFilter_Delegate.java
index 2de344b..ca8f450 100644
--- a/tools/layoutlib/bridge/src/android/graphics/ColorMatrixColorFilter_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/ColorMatrixColorFilter_Delegate.java
@@ -55,13 +55,13 @@ public class ColorMatrixColorFilter_Delegate extends ColorFilter_Delegate {
// ---- native methods ----
@LayoutlibDelegate
- /*package*/ static int nativeColorMatrixFilter(float[] array) {
+ /*package*/ static long nativeColorMatrixFilter(float[] array) {
ColorMatrixColorFilter_Delegate newDelegate = new ColorMatrixColorFilter_Delegate();
return sManager.addNewDelegate(newDelegate);
}
@LayoutlibDelegate
- /*package*/ static int nColorMatrixFilter(int nativeFilter, float[] array) {
+ /*package*/ static long nColorMatrixFilter(long nativeFilter, float[] array) {
// pass
return 0;
}
diff --git a/tools/layoutlib/bridge/src/android/graphics/ComposePathEffect_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/ComposePathEffect_Delegate.java
index 7c04a87..bc3df7d 100644
--- a/tools/layoutlib/bridge/src/android/graphics/ComposePathEffect_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/ComposePathEffect_Delegate.java
@@ -62,7 +62,7 @@ public class ComposePathEffect_Delegate extends PathEffect_Delegate {
// ---- native methods ----
@LayoutlibDelegate
- /*package*/ static int nativeCreate(int outerpe, int innerpe) {
+ /*package*/ static long nativeCreate(long outerpe, long innerpe) {
ComposePathEffect_Delegate newDelegate = new ComposePathEffect_Delegate();
return sManager.addNewDelegate(newDelegate);
}
diff --git a/tools/layoutlib/bridge/src/android/graphics/ComposeShader_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/ComposeShader_Delegate.java
index f6e1d00..fae8aef 100644
--- a/tools/layoutlib/bridge/src/android/graphics/ComposeShader_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/ComposeShader_Delegate.java
@@ -63,15 +63,15 @@ public class ComposeShader_Delegate extends Shader_Delegate {
// ---- native methods ----
@LayoutlibDelegate
- /*package*/ static int nativeCreate1(int native_shaderA, int native_shaderB,
- int native_mode) {
+ /*package*/ static long nativeCreate1(long native_shaderA, long native_shaderB,
+ long native_mode) {
// FIXME not supported yet.
ComposeShader_Delegate newDelegate = new ComposeShader_Delegate();
return sManager.addNewDelegate(newDelegate);
}
@LayoutlibDelegate
- /*package*/ static int nativeCreate2(int native_shaderA, int native_shaderB,
+ /*package*/ static long nativeCreate2(long native_shaderA, long native_shaderB,
int porterDuffMode) {
// FIXME not supported yet.
ComposeShader_Delegate newDelegate = new ComposeShader_Delegate();
@@ -79,15 +79,15 @@ public class ComposeShader_Delegate extends Shader_Delegate {
}
@LayoutlibDelegate
- /*package*/ static int nativePostCreate1(int native_shader, int native_skiaShaderA,
- int native_skiaShaderB, int native_mode) {
+ /*package*/ static long nativePostCreate1(long native_shader, long native_skiaShaderA,
+ long native_skiaShaderB, long native_mode) {
// pass, not needed.
return 0;
}
@LayoutlibDelegate
- /*package*/ static int nativePostCreate2(int native_shader, int native_skiaShaderA,
- int native_skiaShaderB, int porterDuffMode) {
+ /*package*/ static long nativePostCreate2(long native_shader, long native_skiaShaderA,
+ long native_skiaShaderB, int porterDuffMode) {
// pass, not needed.
return 0;
}
diff --git a/tools/layoutlib/bridge/src/android/graphics/CornerPathEffect_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/CornerPathEffect_Delegate.java
index b0f8168..73745c3 100644
--- a/tools/layoutlib/bridge/src/android/graphics/CornerPathEffect_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/CornerPathEffect_Delegate.java
@@ -62,7 +62,7 @@ public class CornerPathEffect_Delegate extends PathEffect_Delegate {
// ---- native methods ----
@LayoutlibDelegate
- /*package*/ static int nativeCreate(float radius) {
+ /*package*/ static long nativeCreate(float radius) {
CornerPathEffect_Delegate newDelegate = new CornerPathEffect_Delegate();
return sManager.addNewDelegate(newDelegate);
}
diff --git a/tools/layoutlib/bridge/src/android/graphics/DashPathEffect_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/DashPathEffect_Delegate.java
index d97c2ec..881afde 100644
--- a/tools/layoutlib/bridge/src/android/graphics/DashPathEffect_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/DashPathEffect_Delegate.java
@@ -73,7 +73,7 @@ public final class DashPathEffect_Delegate extends PathEffect_Delegate {
// ---- native methods ----
@LayoutlibDelegate
- /*package*/ static int nativeCreate(float intervals[], float phase) {
+ /*package*/ static long nativeCreate(float intervals[], float phase) {
DashPathEffect_Delegate newDelegate = new DashPathEffect_Delegate(intervals, phase);
return sManager.addNewDelegate(newDelegate);
}
diff --git a/tools/layoutlib/bridge/src/android/graphics/DiscretePathEffect_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/DiscretePathEffect_Delegate.java
index ec4a810..46109f3 100644
--- a/tools/layoutlib/bridge/src/android/graphics/DiscretePathEffect_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/DiscretePathEffect_Delegate.java
@@ -62,7 +62,7 @@ public class DiscretePathEffect_Delegate extends PathEffect_Delegate {
// ---- native methods ----
@LayoutlibDelegate
- /*package*/ static int nativeCreate(float length, float deviation) {
+ /*package*/ static long nativeCreate(float length, float deviation) {
DiscretePathEffect_Delegate newDelegate = new DiscretePathEffect_Delegate();
return sManager.addNewDelegate(newDelegate);
}
diff --git a/tools/layoutlib/bridge/src/android/graphics/DrawFilter_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/DrawFilter_Delegate.java
index 870c46b..2e10740 100644
--- a/tools/layoutlib/bridge/src/android/graphics/DrawFilter_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/DrawFilter_Delegate.java
@@ -46,7 +46,7 @@ public abstract class DrawFilter_Delegate {
// ---- Public Helper methods ----
- public static DrawFilter_Delegate getDelegate(int nativeDrawFilter) {
+ public static DrawFilter_Delegate getDelegate(long nativeDrawFilter) {
return sManager.getDelegate(nativeDrawFilter);
}
@@ -56,7 +56,7 @@ public abstract class DrawFilter_Delegate {
// ---- native methods ----
@LayoutlibDelegate
- /*package*/ static void nativeDestructor(int nativeDrawFilter) {
+ /*package*/ static void nativeDestructor(long nativeDrawFilter) {
sManager.removeJavaReferenceFor(nativeDrawFilter);
}
diff --git a/tools/layoutlib/bridge/src/android/graphics/EmbossMaskFilter_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/EmbossMaskFilter_Delegate.java
index ebc1c1d..e5040cc 100644
--- a/tools/layoutlib/bridge/src/android/graphics/EmbossMaskFilter_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/EmbossMaskFilter_Delegate.java
@@ -55,7 +55,7 @@ public class EmbossMaskFilter_Delegate extends MaskFilter_Delegate {
// ---- native methods ----
@LayoutlibDelegate
- /*package*/ static int nativeConstructor(float[] direction, float ambient,
+ /*package*/ static long nativeConstructor(float[] direction, float ambient,
float specular, float blurRadius) {
EmbossMaskFilter_Delegate newDelegate = new EmbossMaskFilter_Delegate();
return sManager.addNewDelegate(newDelegate);
diff --git a/tools/layoutlib/bridge/src/android/graphics/LayerRasterizer_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/LayerRasterizer_Delegate.java
index 51e0576..10cc572 100644
--- a/tools/layoutlib/bridge/src/android/graphics/LayerRasterizer_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/LayerRasterizer_Delegate.java
@@ -55,13 +55,13 @@ public class LayerRasterizer_Delegate extends Rasterizer_Delegate {
// ---- native methods ----
@LayoutlibDelegate
- /*package*/ static int nativeConstructor() {
+ /*package*/ static long nativeConstructor() {
LayerRasterizer_Delegate newDelegate = new LayerRasterizer_Delegate();
return sManager.addNewDelegate(newDelegate);
}
@LayoutlibDelegate
- /*package*/ static void nativeAddLayer(int native_layer, int native_paint, float dx, float dy) {
+ /*package*/ static void nativeAddLayer(long native_layer, long native_paint, float dx, float dy) {
}
diff --git a/tools/layoutlib/bridge/src/android/graphics/LightingColorFilter_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/LightingColorFilter_Delegate.java
index 0ee883d..d7cf922 100644
--- a/tools/layoutlib/bridge/src/android/graphics/LightingColorFilter_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/LightingColorFilter_Delegate.java
@@ -55,13 +55,13 @@ public class LightingColorFilter_Delegate extends ColorFilter_Delegate {
// ---- native methods ----
@LayoutlibDelegate
- /*package*/ static int native_CreateLightingFilter(int mul, int add) {
+ /*package*/ static long native_CreateLightingFilter(int mul, int add) {
LightingColorFilter_Delegate newDelegate = new LightingColorFilter_Delegate();
return sManager.addNewDelegate(newDelegate);
}
@LayoutlibDelegate
- /*package*/ static int nCreateLightingFilter(int nativeFilter, int mul, int add) {
+ /*package*/ static long nCreateLightingFilter(long nativeFilter, int mul, int add) {
// pass
return 0;
}
diff --git a/tools/layoutlib/bridge/src/android/graphics/LinearGradient_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/LinearGradient_Delegate.java
index f117fca..ac77377 100644
--- a/tools/layoutlib/bridge/src/android/graphics/LinearGradient_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/LinearGradient_Delegate.java
@@ -54,7 +54,7 @@ public final class LinearGradient_Delegate extends Gradient_Delegate {
// ---- native methods ----
@LayoutlibDelegate
- /*package*/ static int nativeCreate1(LinearGradient thisGradient,
+ /*package*/ static long nativeCreate1(LinearGradient thisGradient,
float x0, float y0, float x1, float y1,
int colors[], float positions[], int tileMode) {
LinearGradient_Delegate newDelegate = new LinearGradient_Delegate(x0, y0, x1, y1,
@@ -63,7 +63,7 @@ public final class LinearGradient_Delegate extends Gradient_Delegate {
}
@LayoutlibDelegate
- /*package*/ static int nativeCreate2(LinearGradient thisGradient,
+ /*package*/ static long nativeCreate2(LinearGradient thisGradient,
float x0, float y0, float x1, float y1,
int color0, int color1, int tileMode) {
return nativeCreate1(thisGradient,
@@ -72,16 +72,16 @@ public final class LinearGradient_Delegate extends Gradient_Delegate {
}
@LayoutlibDelegate
- /*package*/ static int nativePostCreate1(LinearGradient thisGradient,
- int native_shader, float x0, float y0, float x1, float y1,
+ /*package*/ static long nativePostCreate1(LinearGradient thisGradient,
+ long native_shader, float x0, float y0, float x1, float y1,
int colors[], float positions[], int tileMode) {
// nothing to be done here.
return 0;
}
@LayoutlibDelegate
- /*package*/ static int nativePostCreate2(LinearGradient thisGradient,
- int native_shader, float x0, float y0, float x1, float y1,
+ /*package*/ static long nativePostCreate2(LinearGradient thisGradient,
+ long native_shader, float x0, float y0, float x1, float y1,
int color0, int color1, int tileMode) {
// nothing to be done here.
return 0;
diff --git a/tools/layoutlib/bridge/src/android/graphics/MaskFilter_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/MaskFilter_Delegate.java
index c2f27e4..e726c59 100644
--- a/tools/layoutlib/bridge/src/android/graphics/MaskFilter_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/MaskFilter_Delegate.java
@@ -46,7 +46,7 @@ public abstract class MaskFilter_Delegate {
// ---- Public Helper methods ----
- public static MaskFilter_Delegate getDelegate(int nativeShader) {
+ public static MaskFilter_Delegate getDelegate(long nativeShader) {
return sManager.getDelegate(nativeShader);
}
@@ -56,7 +56,7 @@ public abstract class MaskFilter_Delegate {
// ---- native methods ----
@LayoutlibDelegate
- /*package*/ static void nativeDestructor(int native_filter) {
+ /*package*/ static void nativeDestructor(long native_filter) {
sManager.removeJavaReferenceFor(native_filter);
}
diff --git a/tools/layoutlib/bridge/src/android/graphics/Matrix_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/Matrix_Delegate.java
index 5df2a21..ebfe9bc 100644
--- a/tools/layoutlib/bridge/src/android/graphics/Matrix_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/Matrix_Delegate.java
@@ -53,7 +53,7 @@ public final class Matrix_Delegate {
// ---- Public Helper methods ----
- public static Matrix_Delegate getDelegate(int native_instance) {
+ public static Matrix_Delegate getDelegate(long native_instance) {
return sManager.getDelegate(native_instance);
}
@@ -174,7 +174,7 @@ public final class Matrix_Delegate {
// ---- native methods ----
@LayoutlibDelegate
- /*package*/ static int native_create(int native_src_or_zero) {
+ /*package*/ static long native_create(long native_src_or_zero) {
// create the delegate
Matrix_Delegate newDelegate = new Matrix_Delegate();
@@ -193,7 +193,7 @@ public final class Matrix_Delegate {
}
@LayoutlibDelegate
- /*package*/ static boolean native_isIdentity(int native_object) {
+ /*package*/ static boolean native_isIdentity(long native_object) {
Matrix_Delegate d = sManager.getDelegate(native_object);
if (d == null) {
return false;
@@ -203,7 +203,7 @@ public final class Matrix_Delegate {
}
@LayoutlibDelegate
- /*package*/ static boolean native_rectStaysRect(int native_object) {
+ /*package*/ static boolean native_rectStaysRect(long native_object) {
Matrix_Delegate d = sManager.getDelegate(native_object);
if (d == null) {
return true;
@@ -213,7 +213,7 @@ public final class Matrix_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void native_reset(int native_object) {
+ /*package*/ static void native_reset(long native_object) {
Matrix_Delegate d = sManager.getDelegate(native_object);
if (d == null) {
return;
@@ -223,7 +223,7 @@ public final class Matrix_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void native_set(int native_object, int other) {
+ /*package*/ static void native_set(long native_object, long other) {
Matrix_Delegate d = sManager.getDelegate(native_object);
if (d == null) {
return;
@@ -238,7 +238,7 @@ public final class Matrix_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void native_setTranslate(int native_object, float dx, float dy) {
+ /*package*/ static void native_setTranslate(long native_object, float dx, float dy) {
Matrix_Delegate d = sManager.getDelegate(native_object);
if (d == null) {
return;
@@ -248,7 +248,7 @@ public final class Matrix_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void native_setScale(int native_object, float sx, float sy,
+ /*package*/ static void native_setScale(long native_object, float sx, float sy,
float px, float py) {
Matrix_Delegate d = sManager.getDelegate(native_object);
if (d == null) {
@@ -259,7 +259,7 @@ public final class Matrix_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void native_setScale(int native_object, float sx, float sy) {
+ /*package*/ static void native_setScale(long native_object, float sx, float sy) {
Matrix_Delegate d = sManager.getDelegate(native_object);
if (d == null) {
return;
@@ -277,7 +277,7 @@ public final class Matrix_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void native_setRotate(int native_object, float degrees, float px, float py) {
+ /*package*/ static void native_setRotate(long native_object, float degrees, float px, float py) {
Matrix_Delegate d = sManager.getDelegate(native_object);
if (d == null) {
return;
@@ -287,7 +287,7 @@ public final class Matrix_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void native_setRotate(int native_object, float degrees) {
+ /*package*/ static void native_setRotate(long native_object, float degrees) {
Matrix_Delegate d = sManager.getDelegate(native_object);
if (d == null) {
return;
@@ -297,7 +297,7 @@ public final class Matrix_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void native_setSinCos(int native_object, float sinValue, float cosValue,
+ /*package*/ static void native_setSinCos(long native_object, float sinValue, float cosValue,
float px, float py) {
Matrix_Delegate d = sManager.getDelegate(native_object);
if (d == null) {
@@ -316,7 +316,7 @@ public final class Matrix_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void native_setSinCos(int native_object, float sinValue, float cosValue) {
+ /*package*/ static void native_setSinCos(long native_object, float sinValue, float cosValue) {
Matrix_Delegate d = sManager.getDelegate(native_object);
if (d == null) {
return;
@@ -326,7 +326,7 @@ public final class Matrix_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void native_setSkew(int native_object, float kx, float ky,
+ /*package*/ static void native_setSkew(long native_object, float kx, float ky,
float px, float py) {
Matrix_Delegate d = sManager.getDelegate(native_object);
if (d == null) {
@@ -337,7 +337,7 @@ public final class Matrix_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void native_setSkew(int native_object, float kx, float ky) {
+ /*package*/ static void native_setSkew(long native_object, float kx, float ky) {
Matrix_Delegate d = sManager.getDelegate(native_object);
if (d == null) {
return;
@@ -355,7 +355,7 @@ public final class Matrix_Delegate {
}
@LayoutlibDelegate
- /*package*/ static boolean native_setConcat(int native_object, int a, int b) {
+ /*package*/ static boolean native_setConcat(long native_object, long a, long b) {
if (a == native_object) {
return native_preConcat(native_object, b);
} else if (b == native_object) {
@@ -383,7 +383,7 @@ public final class Matrix_Delegate {
}
@LayoutlibDelegate
- /*package*/ static boolean native_preTranslate(int native_object, float dx, float dy) {
+ /*package*/ static boolean native_preTranslate(long native_object, float dx, float dy) {
Matrix_Delegate d = sManager.getDelegate(native_object);
if (d == null) {
return false;
@@ -394,7 +394,7 @@ public final class Matrix_Delegate {
}
@LayoutlibDelegate
- /*package*/ static boolean native_preScale(int native_object, float sx, float sy,
+ /*package*/ static boolean native_preScale(long native_object, float sx, float sy,
float px, float py) {
Matrix_Delegate d = sManager.getDelegate(native_object);
if (d == null) {
@@ -406,7 +406,7 @@ public final class Matrix_Delegate {
}
@LayoutlibDelegate
- /*package*/ static boolean native_preScale(int native_object, float sx, float sy) {
+ /*package*/ static boolean native_preScale(long native_object, float sx, float sy) {
Matrix_Delegate d = sManager.getDelegate(native_object);
if (d == null) {
return false;
@@ -417,7 +417,7 @@ public final class Matrix_Delegate {
}
@LayoutlibDelegate
- /*package*/ static boolean native_preRotate(int native_object, float degrees,
+ /*package*/ static boolean native_preRotate(long native_object, float degrees,
float px, float py) {
Matrix_Delegate d = sManager.getDelegate(native_object);
if (d == null) {
@@ -429,7 +429,7 @@ public final class Matrix_Delegate {
}
@LayoutlibDelegate
- /*package*/ static boolean native_preRotate(int native_object, float degrees) {
+ /*package*/ static boolean native_preRotate(long native_object, float degrees) {
Matrix_Delegate d = sManager.getDelegate(native_object);
if (d == null) {
return false;
@@ -444,7 +444,7 @@ public final class Matrix_Delegate {
}
@LayoutlibDelegate
- /*package*/ static boolean native_preSkew(int native_object, float kx, float ky,
+ /*package*/ static boolean native_preSkew(long native_object, float kx, float ky,
float px, float py) {
Matrix_Delegate d = sManager.getDelegate(native_object);
if (d == null) {
@@ -456,7 +456,7 @@ public final class Matrix_Delegate {
}
@LayoutlibDelegate
- /*package*/ static boolean native_preSkew(int native_object, float kx, float ky) {
+ /*package*/ static boolean native_preSkew(long native_object, float kx, float ky) {
Matrix_Delegate d = sManager.getDelegate(native_object);
if (d == null) {
return false;
@@ -467,7 +467,7 @@ public final class Matrix_Delegate {
}
@LayoutlibDelegate
- /*package*/ static boolean native_preConcat(int native_object, int other_matrix) {
+ /*package*/ static boolean native_preConcat(long native_object, long other_matrix) {
Matrix_Delegate d = sManager.getDelegate(native_object);
if (d == null) {
return false;
@@ -483,7 +483,7 @@ public final class Matrix_Delegate {
}
@LayoutlibDelegate
- /*package*/ static boolean native_postTranslate(int native_object, float dx, float dy) {
+ /*package*/ static boolean native_postTranslate(long native_object, float dx, float dy) {
Matrix_Delegate d = sManager.getDelegate(native_object);
if (d == null) {
return false;
@@ -494,7 +494,7 @@ public final class Matrix_Delegate {
}
@LayoutlibDelegate
- /*package*/ static boolean native_postScale(int native_object, float sx, float sy,
+ /*package*/ static boolean native_postScale(long native_object, float sx, float sy,
float px, float py) {
Matrix_Delegate d = sManager.getDelegate(native_object);
if (d == null) {
@@ -506,7 +506,7 @@ public final class Matrix_Delegate {
}
@LayoutlibDelegate
- /*package*/ static boolean native_postScale(int native_object, float sx, float sy) {
+ /*package*/ static boolean native_postScale(long native_object, float sx, float sy) {
Matrix_Delegate d = sManager.getDelegate(native_object);
if (d == null) {
return false;
@@ -517,7 +517,7 @@ public final class Matrix_Delegate {
}
@LayoutlibDelegate
- /*package*/ static boolean native_postRotate(int native_object, float degrees,
+ /*package*/ static boolean native_postRotate(long native_object, float degrees,
float px, float py) {
Matrix_Delegate d = sManager.getDelegate(native_object);
if (d == null) {
@@ -529,7 +529,7 @@ public final class Matrix_Delegate {
}
@LayoutlibDelegate
- /*package*/ static boolean native_postRotate(int native_object, float degrees) {
+ /*package*/ static boolean native_postRotate(long native_object, float degrees) {
Matrix_Delegate d = sManager.getDelegate(native_object);
if (d == null) {
return false;
@@ -540,7 +540,7 @@ public final class Matrix_Delegate {
}
@LayoutlibDelegate
- /*package*/ static boolean native_postSkew(int native_object, float kx, float ky,
+ /*package*/ static boolean native_postSkew(long native_object, float kx, float ky,
float px, float py) {
Matrix_Delegate d = sManager.getDelegate(native_object);
if (d == null) {
@@ -552,7 +552,7 @@ public final class Matrix_Delegate {
}
@LayoutlibDelegate
- /*package*/ static boolean native_postSkew(int native_object, float kx, float ky) {
+ /*package*/ static boolean native_postSkew(long native_object, float kx, float ky) {
Matrix_Delegate d = sManager.getDelegate(native_object);
if (d == null) {
return false;
@@ -563,7 +563,7 @@ public final class Matrix_Delegate {
}
@LayoutlibDelegate
- /*package*/ static boolean native_postConcat(int native_object, int other_matrix) {
+ /*package*/ static boolean native_postConcat(long native_object, long other_matrix) {
Matrix_Delegate d = sManager.getDelegate(native_object);
if (d == null) {
return false;
@@ -579,7 +579,7 @@ public final class Matrix_Delegate {
}
@LayoutlibDelegate
- /*package*/ static boolean native_setRectToRect(int native_object, RectF src,
+ /*package*/ static boolean native_setRectToRect(long native_object, RectF src,
RectF dst, int stf) {
Matrix_Delegate d = sManager.getDelegate(native_object);
if (d == null) {
@@ -644,7 +644,7 @@ public final class Matrix_Delegate {
}
@LayoutlibDelegate
- /*package*/ static boolean native_setPolyToPoly(int native_object, float[] src, int srcIndex,
+ /*package*/ static boolean native_setPolyToPoly(long native_object, float[] src, int srcIndex,
float[] dst, int dstIndex, int pointCount) {
// FIXME
Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
@@ -654,7 +654,7 @@ public final class Matrix_Delegate {
}
@LayoutlibDelegate
- /*package*/ static boolean native_invert(int native_object, int inverse) {
+ /*package*/ static boolean native_invert(long native_object, long inverse) {
Matrix_Delegate d = sManager.getDelegate(native_object);
if (d == null) {
return false;
@@ -682,7 +682,7 @@ public final class Matrix_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void native_mapPoints(int native_object, float[] dst, int dstIndex,
+ /*package*/ static void native_mapPoints(long native_object, float[] dst, int dstIndex,
float[] src, int srcIndex, int ptCount, boolean isPts) {
Matrix_Delegate d = sManager.getDelegate(native_object);
if (d == null) {
@@ -697,7 +697,7 @@ public final class Matrix_Delegate {
}
@LayoutlibDelegate
- /*package*/ static boolean native_mapRect(int native_object, RectF dst, RectF src) {
+ /*package*/ static boolean native_mapRect(long native_object, RectF dst, RectF src) {
Matrix_Delegate d = sManager.getDelegate(native_object);
if (d == null) {
return false;
@@ -707,7 +707,7 @@ public final class Matrix_Delegate {
}
@LayoutlibDelegate
- /*package*/ static float native_mapRadius(int native_object, float radius) {
+ /*package*/ static float native_mapRadius(long native_object, float radius) {
Matrix_Delegate d = sManager.getDelegate(native_object);
if (d == null) {
return 0.f;
@@ -723,7 +723,7 @@ public final class Matrix_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void native_getValues(int native_object, float[] values) {
+ /*package*/ static void native_getValues(long native_object, float[] values) {
Matrix_Delegate d = sManager.getDelegate(native_object);
if (d == null) {
return;
@@ -733,7 +733,7 @@ public final class Matrix_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void native_setValues(int native_object, float[] values) {
+ /*package*/ static void native_setValues(long native_object, float[] values) {
Matrix_Delegate d = sManager.getDelegate(native_object);
if (d == null) {
return;
@@ -743,7 +743,7 @@ public final class Matrix_Delegate {
}
@LayoutlibDelegate
- /*package*/ static boolean native_equals(int native_a, int native_b) {
+ /*package*/ static boolean native_equals(long native_a, long native_b) {
Matrix_Delegate a = sManager.getDelegate(native_a);
if (a == null) {
return false;
@@ -764,7 +764,7 @@ public final class Matrix_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void finalizer(int native_instance) {
+ /*package*/ static void finalizer(long native_instance) {
sManager.removeJavaReferenceFor(native_instance);
}
diff --git a/tools/layoutlib/bridge/src/android/graphics/NinePatch_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/NinePatch_Delegate.java
index a79ec8f..74b2893 100644
--- a/tools/layoutlib/bridge/src/android/graphics/NinePatch_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/NinePatch_Delegate.java
@@ -158,7 +158,7 @@ public final class NinePatch_Delegate {
}
@LayoutlibDelegate
- /*package*/ static int validateNinePatchChunk(int bitmap, byte[] chunk) {
+ /*package*/ static long validateNinePatchChunk(long bitmap, byte[] chunk) {
// the default JNI implementation only checks that the byte[] has the same
// size as the C struct it represent. Since we cannot do the same check (serialization
// will return different size depending on content), we do nothing.
@@ -168,13 +168,13 @@ public final class NinePatch_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void nativeFinalize(int chunk) {
+ /*package*/ static void nativeFinalize(long chunk) {
sManager.removeJavaReferenceFor(chunk);
}
@LayoutlibDelegate
- /*package*/ static void nativeDraw(int canvas_instance, RectF loc, int bitmap_instance,
- int chunk, int paint_instance_or_null, int destDensity, int srcDensity) {
+ /*package*/ static void nativeDraw(long canvas_instance, RectF loc, long bitmap_instance,
+ long chunk, long paint_instance_or_null, int destDensity, int srcDensity) {
draw(canvas_instance,
(int) loc.left, (int) loc.top, (int) loc.right, (int) loc.bottom,
bitmap_instance, chunk, paint_instance_or_null,
@@ -182,8 +182,8 @@ public final class NinePatch_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void nativeDraw(int canvas_instance, Rect loc, int bitmap_instance,
- int chunk, int paint_instance_or_null, int destDensity, int srcDensity) {
+ /*package*/ static void nativeDraw(long canvas_instance, Rect loc, long bitmap_instance,
+ long chunk, long paint_instance_or_null, int destDensity, int srcDensity) {
draw(canvas_instance,
loc.left, loc.top, loc.right, loc.bottom,
bitmap_instance, chunk, paint_instance_or_null,
@@ -191,15 +191,15 @@ public final class NinePatch_Delegate {
}
@LayoutlibDelegate
- /*package*/ static int nativeGetTransparentRegion(int bitmap, int chunk, Rect location) {
+ /*package*/ static long nativeGetTransparentRegion(long bitmap, long chunk, Rect location) {
return 0;
}
// ---- Private Helper methods ----
- private static void draw(int canvas_instance,
+ private static void draw(long canvas_instance,
final int left, final int top, final int right, final int bottom,
- int bitmap_instance, int chunk, int paint_instance_or_null,
+ long bitmap_instance, long chunk, long paint_instance_or_null,
final int destDensity, final int srcDensity) {
// get the delegate from the native int.
final Bitmap_Delegate bitmap_delegate = Bitmap_Delegate.getDelegate(bitmap_instance);
diff --git a/tools/layoutlib/bridge/src/android/graphics/PaintFlagsDrawFilter_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/PaintFlagsDrawFilter_Delegate.java
index 71d346a..fa20746 100644
--- a/tools/layoutlib/bridge/src/android/graphics/PaintFlagsDrawFilter_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/PaintFlagsDrawFilter_Delegate.java
@@ -55,7 +55,7 @@ public class PaintFlagsDrawFilter_Delegate extends DrawFilter_Delegate {
// ---- native methods ----
@LayoutlibDelegate
- /*package*/ static int nativeConstructor(int clearBits, int setBits) {
+ /*package*/ static long nativeConstructor(int clearBits, int setBits) {
PaintFlagsDrawFilter_Delegate newDelegate = new PaintFlagsDrawFilter_Delegate();
return sManager.addNewDelegate(newDelegate);
}
diff --git a/tools/layoutlib/bridge/src/android/graphics/Paint_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/Paint_Delegate.java
index 4ad1a17..de2e592 100644
--- a/tools/layoutlib/bridge/src/android/graphics/Paint_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/Paint_Delegate.java
@@ -96,7 +96,7 @@ public class Paint_Delegate {
// ---- Public Helper methods ----
- public static Paint_Delegate getDelegate(int native_paint) {
+ public static Paint_Delegate getDelegate(long native_paint) {
return sManager.getDelegate(native_paint);
}
@@ -642,13 +642,13 @@ public class Paint_Delegate {
}
@LayoutlibDelegate
- /*package*/ static int native_init() {
+ /*package*/ static long native_init() {
Paint_Delegate newDelegate = new Paint_Delegate();
return sManager.addNewDelegate(newDelegate);
}
@LayoutlibDelegate
- /*package*/ static int native_initWithPaint(int paint) {
+ /*package*/ static long native_initWithPaint(long paint) {
// get the delegate from the native int.
Paint_Delegate delegate = sManager.getDelegate(paint);
if (delegate == null) {
@@ -660,7 +660,7 @@ public class Paint_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void native_reset(int native_object) {
+ /*package*/ static void native_reset(long native_object) {
// get the delegate from the native int.
Paint_Delegate delegate = sManager.getDelegate(native_object);
if (delegate == null) {
@@ -671,7 +671,7 @@ public class Paint_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void native_set(int native_dst, int native_src) {
+ /*package*/ static void native_set(long native_dst, long native_src) {
// get the delegate from the native int.
Paint_Delegate delegate_dst = sManager.getDelegate(native_dst);
if (delegate_dst == null) {
@@ -688,7 +688,7 @@ public class Paint_Delegate {
}
@LayoutlibDelegate
- /*package*/ static int native_getStyle(int native_object) {
+ /*package*/ static int native_getStyle(long native_object) {
// get the delegate from the native int.
Paint_Delegate delegate = sManager.getDelegate(native_object);
if (delegate == null) {
@@ -699,7 +699,7 @@ public class Paint_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void native_setStyle(int native_object, int style) {
+ /*package*/ static void native_setStyle(long native_object, int style) {
// get the delegate from the native int.
Paint_Delegate delegate = sManager.getDelegate(native_object);
if (delegate == null) {
@@ -710,7 +710,7 @@ public class Paint_Delegate {
}
@LayoutlibDelegate
- /*package*/ static int native_getStrokeCap(int native_object) {
+ /*package*/ static int native_getStrokeCap(long native_object) {
// get the delegate from the native int.
Paint_Delegate delegate = sManager.getDelegate(native_object);
if (delegate == null) {
@@ -721,7 +721,7 @@ public class Paint_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void native_setStrokeCap(int native_object, int cap) {
+ /*package*/ static void native_setStrokeCap(long native_object, int cap) {
// get the delegate from the native int.
Paint_Delegate delegate = sManager.getDelegate(native_object);
if (delegate == null) {
@@ -732,7 +732,7 @@ public class Paint_Delegate {
}
@LayoutlibDelegate
- /*package*/ static int native_getStrokeJoin(int native_object) {
+ /*package*/ static int native_getStrokeJoin(long native_object) {
// get the delegate from the native int.
Paint_Delegate delegate = sManager.getDelegate(native_object);
if (delegate == null) {
@@ -743,7 +743,7 @@ public class Paint_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void native_setStrokeJoin(int native_object, int join) {
+ /*package*/ static void native_setStrokeJoin(long native_object, int join) {
// get the delegate from the native int.
Paint_Delegate delegate = sManager.getDelegate(native_object);
if (delegate == null) {
@@ -754,7 +754,7 @@ public class Paint_Delegate {
}
@LayoutlibDelegate
- /*package*/ static boolean native_getFillPath(int native_object, int src, int dst) {
+ /*package*/ static boolean native_getFillPath(long native_object, long src, long dst) {
Paint_Delegate paint = sManager.getDelegate(native_object);
if (paint == null) {
return false;
@@ -780,7 +780,7 @@ public class Paint_Delegate {
}
@LayoutlibDelegate
- /*package*/ static int native_setShader(int native_object, int shader) {
+ /*package*/ static long native_setShader(long native_object, long shader) {
// get the delegate from the native int.
Paint_Delegate delegate = sManager.getDelegate(native_object);
if (delegate == null) {
@@ -793,7 +793,7 @@ public class Paint_Delegate {
}
@LayoutlibDelegate
- /*package*/ static int native_setColorFilter(int native_object, int filter) {
+ /*package*/ static long native_setColorFilter(long native_object, long filter) {
// get the delegate from the native int.
Paint_Delegate delegate = sManager.getDelegate(native_object);
if (delegate == null) {
@@ -812,7 +812,7 @@ public class Paint_Delegate {
}
@LayoutlibDelegate
- /*package*/ static int native_setXfermode(int native_object, int xfermode) {
+ /*package*/ static long native_setXfermode(long native_object, long xfermode) {
// get the delegate from the native int.
Paint_Delegate delegate = sManager.getDelegate(native_object);
if (delegate == null) {
@@ -825,7 +825,7 @@ public class Paint_Delegate {
}
@LayoutlibDelegate
- /*package*/ static int native_setPathEffect(int native_object, int effect) {
+ /*package*/ static long native_setPathEffect(long native_object, long effect) {
// get the delegate from the native int.
Paint_Delegate delegate = sManager.getDelegate(native_object);
if (delegate == null) {
@@ -838,7 +838,7 @@ public class Paint_Delegate {
}
@LayoutlibDelegate
- /*package*/ static int native_setMaskFilter(int native_object, int maskfilter) {
+ /*package*/ static long native_setMaskFilter(long native_object, long maskfilter) {
// get the delegate from the native int.
Paint_Delegate delegate = sManager.getDelegate(native_object);
if (delegate == null) {
@@ -857,7 +857,7 @@ public class Paint_Delegate {
}
@LayoutlibDelegate
- /*package*/ static int native_setTypeface(int native_object, int typeface) {
+ /*package*/ static long native_setTypeface(long native_object, long typeface) {
// get the delegate from the native int.
Paint_Delegate delegate = sManager.getDelegate(native_object);
if (delegate == null) {
@@ -870,7 +870,7 @@ public class Paint_Delegate {
}
@LayoutlibDelegate
- /*package*/ static int native_setRasterizer(int native_object, int rasterizer) {
+ /*package*/ static long native_setRasterizer(long native_object, long rasterizer) {
// get the delegate from the native int.
Paint_Delegate delegate = sManager.getDelegate(native_object);
if (delegate == null) {
@@ -889,7 +889,7 @@ public class Paint_Delegate {
}
@LayoutlibDelegate
- /*package*/ static int native_getTextAlign(int native_object) {
+ /*package*/ static int native_getTextAlign(long native_object) {
// get the delegate from the native int.
Paint_Delegate delegate = sManager.getDelegate(native_object);
if (delegate == null) {
@@ -900,7 +900,7 @@ public class Paint_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void native_setTextAlign(int native_object, int align) {
+ /*package*/ static void native_setTextAlign(long native_object, int align) {
// get the delegate from the native int.
Paint_Delegate delegate = sManager.getDelegate(native_object);
if (delegate == null) {
@@ -911,7 +911,7 @@ public class Paint_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void native_setTextLocale(int native_object, String locale) {
+ /*package*/ static void native_setTextLocale(long native_object, String locale) {
// get the delegate from the native int.
Paint_Delegate delegate = sManager.getDelegate(native_object);
if (delegate == null) {
@@ -922,7 +922,7 @@ public class Paint_Delegate {
}
@LayoutlibDelegate
- /*package*/ static int native_getTextWidths(int native_object, char[] text, int index,
+ /*package*/ static int native_getTextWidths(long native_object, char[] text, int index,
int count, int bidiFlags, float[] widths) {
// get the delegate from the native int.
Paint_Delegate delegate = sManager.getDelegate(native_object);
@@ -964,21 +964,21 @@ public class Paint_Delegate {
}
@LayoutlibDelegate
- /*package*/ static int native_getTextWidths(int native_object, String text, int start,
+ /*package*/ static int native_getTextWidths(long native_object, String text, int start,
int end, int bidiFlags, float[] widths) {
return native_getTextWidths(native_object, text.toCharArray(), start, end - start,
bidiFlags, widths);
}
@LayoutlibDelegate
- /* package */static int native_getTextGlyphs(int native_object, String text, int start,
+ /* package */static int native_getTextGlyphs(long native_object, String text, int start,
int end, int contextStart, int contextEnd, int flags, char[] glyphs) {
// FIXME
return 0;
}
@LayoutlibDelegate
- /*package*/ static float native_getTextRunAdvances(int native_object,
+ /*package*/ static float native_getTextRunAdvances(long native_object,
char[] text, int index, int count, int contextIndex, int contextCount,
int flags, float[] advances, int advancesIndex) {
@@ -999,7 +999,7 @@ public class Paint_Delegate {
}
@LayoutlibDelegate
- /*package*/ static float native_getTextRunAdvances(int native_object,
+ /*package*/ static float native_getTextRunAdvances(long native_object,
String text, int start, int end, int contextStart, int contextEnd,
int flags, float[] advances, int advancesIndex) {
// FIXME: support contextStart and contextEnd
@@ -1012,7 +1012,7 @@ public class Paint_Delegate {
}
@LayoutlibDelegate
- /*package*/ static int native_getTextRunCursor(Paint thisPaint, int native_object, char[] text,
+ /*package*/ static int native_getTextRunCursor(Paint thisPaint, long native_object, char[] text,
int contextStart, int contextLength, int flags, int offset, int cursorOpt) {
// FIXME
Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
@@ -1021,7 +1021,7 @@ public class Paint_Delegate {
}
@LayoutlibDelegate
- /*package*/ static int native_getTextRunCursor(Paint thisPaint, int native_object, String text,
+ /*package*/ static int native_getTextRunCursor(Paint thisPaint, long native_object, String text,
int contextStart, int contextEnd, int flags, int offset, int cursorOpt) {
// FIXME
Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
@@ -1030,30 +1030,30 @@ public class Paint_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void native_getTextPath(int native_object, int bidiFlags,
- char[] text, int index, int count, float x, float y, int path) {
+ /*package*/ static void native_getTextPath(long native_object, int bidiFlags,
+ char[] text, int index, int count, float x, float y, long path) {
// FIXME
Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
"Paint.getTextPath is not supported.", null, null /*data*/);
}
@LayoutlibDelegate
- /*package*/ static void native_getTextPath(int native_object, int bidiFlags,
- String text, int start, int end, float x, float y, int path) {
+ /*package*/ static void native_getTextPath(long native_object, int bidiFlags,
+ String text, int start, int end, float x, float y, long path) {
// FIXME
Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
"Paint.getTextPath is not supported.", null, null /*data*/);
}
@LayoutlibDelegate
- /*package*/ static void nativeGetStringBounds(int nativePaint, String text, int start,
+ /*package*/ static void nativeGetStringBounds(long nativePaint, String text, int start,
int end, int bidiFlags, Rect bounds) {
nativeGetCharArrayBounds(nativePaint, text.toCharArray(), start, end - start, bidiFlags,
bounds);
}
@LayoutlibDelegate
- /*package*/ static void nativeGetCharArrayBounds(int nativePaint, char[] text, int index,
+ /*package*/ static void nativeGetCharArrayBounds(long nativePaint, char[] text, int index,
int count, int bidiFlags, Rect bounds) {
// get the delegate from the native int.
@@ -1065,7 +1065,7 @@ public class Paint_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void finalizer(int nativePaint) {
+ /*package*/ static void finalizer(long nativePaint) {
sManager.removeJavaReferenceFor(nativePaint);
}
diff --git a/tools/layoutlib/bridge/src/android/graphics/PathDashPathEffect_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/PathDashPathEffect_Delegate.java
index c448f0e..fd9ba62 100644
--- a/tools/layoutlib/bridge/src/android/graphics/PathDashPathEffect_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/PathDashPathEffect_Delegate.java
@@ -62,7 +62,7 @@ public class PathDashPathEffect_Delegate extends PathEffect_Delegate {
// ---- native methods ----
@LayoutlibDelegate
- /*package*/ static int nativeCreate(int native_path, float advance, float phase,
+ /*package*/ static long nativeCreate(long native_path, float advance, float phase,
int native_style) {
PathDashPathEffect_Delegate newDelegate = new PathDashPathEffect_Delegate();
return sManager.addNewDelegate(newDelegate);
diff --git a/tools/layoutlib/bridge/src/android/graphics/PathEffect_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/PathEffect_Delegate.java
index bd2b6de..000481e 100644
--- a/tools/layoutlib/bridge/src/android/graphics/PathEffect_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/PathEffect_Delegate.java
@@ -48,7 +48,7 @@ public abstract class PathEffect_Delegate {
// ---- Public Helper methods ----
- public static PathEffect_Delegate getDelegate(int nativeShader) {
+ public static PathEffect_Delegate getDelegate(long nativeShader) {
return sManager.getDelegate(nativeShader);
}
@@ -60,7 +60,7 @@ public abstract class PathEffect_Delegate {
// ---- native methods ----
@LayoutlibDelegate
- /*package*/ static void nativeDestructor(int native_patheffect) {
+ /*package*/ static void nativeDestructor(long native_patheffect) {
sManager.removeJavaReferenceFor(native_patheffect);
}
diff --git a/tools/layoutlib/bridge/src/android/graphics/Path_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/Path_Delegate.java
index 9d80be9..b42966b 100644
--- a/tools/layoutlib/bridge/src/android/graphics/Path_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/Path_Delegate.java
@@ -63,7 +63,7 @@ public final class Path_Delegate {
// ---- Public Helper methods ----
- public static Path_Delegate getDelegate(int nPath) {
+ public static Path_Delegate getDelegate(long nPath) {
return sManager.getDelegate(nPath);
}
@@ -88,7 +88,7 @@ public final class Path_Delegate {
// ---- native methods ----
@LayoutlibDelegate
- /*package*/ static int init1() {
+ /*package*/ static long init1() {
// create the delegate
Path_Delegate newDelegate = new Path_Delegate();
@@ -96,7 +96,7 @@ public final class Path_Delegate {
}
@LayoutlibDelegate
- /*package*/ static int init2(int nPath) {
+ /*package*/ static long init2(long nPath) {
// create the delegate
Path_Delegate newDelegate = new Path_Delegate();
@@ -110,7 +110,7 @@ public final class Path_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void native_reset(int nPath) {
+ /*package*/ static void native_reset(long nPath) {
Path_Delegate pathDelegate = sManager.getDelegate(nPath);
if (pathDelegate == null) {
return;
@@ -120,14 +120,14 @@ public final class Path_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void native_rewind(int nPath) {
+ /*package*/ static void native_rewind(long nPath) {
// call out to reset since there's nothing to optimize in
// terms of data structs.
native_reset(nPath);
}
@LayoutlibDelegate
- /*package*/ static void native_set(int native_dst, int native_src) {
+ /*package*/ static void native_set(long native_dst, long native_src) {
Path_Delegate pathDstDelegate = sManager.getDelegate(native_dst);
if (pathDstDelegate == null) {
return;
@@ -142,7 +142,7 @@ public final class Path_Delegate {
}
@LayoutlibDelegate
- /*package*/ static int native_getFillType(int nPath) {
+ /*package*/ static int native_getFillType(long nPath) {
Path_Delegate pathDelegate = sManager.getDelegate(nPath);
if (pathDelegate == null) {
return 0;
@@ -152,7 +152,7 @@ public final class Path_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void native_setFillType(int nPath, int ft) {
+ /*package*/ static void native_setFillType(long nPath, int ft) {
Path_Delegate pathDelegate = sManager.getDelegate(nPath);
if (pathDelegate == null) {
return;
@@ -162,7 +162,7 @@ public final class Path_Delegate {
}
@LayoutlibDelegate
- /*package*/ static boolean native_isEmpty(int nPath) {
+ /*package*/ static boolean native_isEmpty(long nPath) {
Path_Delegate pathDelegate = sManager.getDelegate(nPath);
if (pathDelegate == null) {
return true;
@@ -172,7 +172,7 @@ public final class Path_Delegate {
}
@LayoutlibDelegate
- /*package*/ static boolean native_isRect(int nPath, RectF rect) {
+ /*package*/ static boolean native_isRect(long nPath, RectF rect) {
Path_Delegate pathDelegate = sManager.getDelegate(nPath);
if (pathDelegate == null) {
return false;
@@ -192,7 +192,7 @@ public final class Path_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void native_computeBounds(int nPath, RectF bounds) {
+ /*package*/ static void native_computeBounds(long nPath, RectF bounds) {
Path_Delegate pathDelegate = sManager.getDelegate(nPath);
if (pathDelegate == null) {
return;
@@ -202,13 +202,13 @@ public final class Path_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void native_incReserve(int nPath, int extraPtCount) {
+ /*package*/ static void native_incReserve(long nPath, int extraPtCount) {
// since we use a java2D path, there's no way to pre-allocate new points,
// so we do nothing.
}
@LayoutlibDelegate
- /*package*/ static void native_moveTo(int nPath, float x, float y) {
+ /*package*/ static void native_moveTo(long nPath, float x, float y) {
Path_Delegate pathDelegate = sManager.getDelegate(nPath);
if (pathDelegate == null) {
return;
@@ -218,7 +218,7 @@ public final class Path_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void native_rMoveTo(int nPath, float dx, float dy) {
+ /*package*/ static void native_rMoveTo(long nPath, float dx, float dy) {
Path_Delegate pathDelegate = sManager.getDelegate(nPath);
if (pathDelegate == null) {
return;
@@ -228,7 +228,7 @@ public final class Path_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void native_lineTo(int nPath, float x, float y) {
+ /*package*/ static void native_lineTo(long nPath, float x, float y) {
Path_Delegate pathDelegate = sManager.getDelegate(nPath);
if (pathDelegate == null) {
return;
@@ -238,7 +238,7 @@ public final class Path_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void native_rLineTo(int nPath, float dx, float dy) {
+ /*package*/ static void native_rLineTo(long nPath, float dx, float dy) {
Path_Delegate pathDelegate = sManager.getDelegate(nPath);
if (pathDelegate == null) {
return;
@@ -248,7 +248,7 @@ public final class Path_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void native_quadTo(int nPath, float x1, float y1, float x2, float y2) {
+ /*package*/ static void native_quadTo(long nPath, float x1, float y1, float x2, float y2) {
Path_Delegate pathDelegate = sManager.getDelegate(nPath);
if (pathDelegate == null) {
return;
@@ -258,7 +258,7 @@ public final class Path_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void native_rQuadTo(int nPath, float dx1, float dy1, float dx2, float dy2) {
+ /*package*/ static void native_rQuadTo(long nPath, float dx1, float dy1, float dx2, float dy2) {
Path_Delegate pathDelegate = sManager.getDelegate(nPath);
if (pathDelegate == null) {
return;
@@ -268,7 +268,7 @@ public final class Path_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void native_cubicTo(int nPath, float x1, float y1,
+ /*package*/ static void native_cubicTo(long nPath, float x1, float y1,
float x2, float y2, float x3, float y3) {
Path_Delegate pathDelegate = sManager.getDelegate(nPath);
if (pathDelegate == null) {
@@ -279,7 +279,7 @@ public final class Path_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void native_rCubicTo(int nPath, float x1, float y1,
+ /*package*/ static void native_rCubicTo(long nPath, float x1, float y1,
float x2, float y2, float x3, float y3) {
Path_Delegate pathDelegate = sManager.getDelegate(nPath);
if (pathDelegate == null) {
@@ -290,7 +290,7 @@ public final class Path_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void native_arcTo(int nPath, RectF oval,
+ /*package*/ static void native_arcTo(long nPath, RectF oval,
float startAngle, float sweepAngle, boolean forceMoveTo) {
Path_Delegate pathDelegate = sManager.getDelegate(nPath);
if (pathDelegate == null) {
@@ -301,7 +301,7 @@ public final class Path_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void native_close(int nPath) {
+ /*package*/ static void native_close(long nPath) {
Path_Delegate pathDelegate = sManager.getDelegate(nPath);
if (pathDelegate == null) {
return;
@@ -311,7 +311,7 @@ public final class Path_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void native_addRect(int nPath, RectF rect, int dir) {
+ /*package*/ static void native_addRect(long nPath, RectF rect, int dir) {
Path_Delegate pathDelegate = sManager.getDelegate(nPath);
if (pathDelegate == null) {
return;
@@ -321,7 +321,7 @@ public final class Path_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void native_addRect(int nPath,
+ /*package*/ static void native_addRect(long nPath,
float left, float top, float right, float bottom, int dir) {
Path_Delegate pathDelegate = sManager.getDelegate(nPath);
if (pathDelegate == null) {
@@ -332,7 +332,7 @@ public final class Path_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void native_addOval(int nPath, RectF oval, int dir) {
+ /*package*/ static void native_addOval(long nPath, RectF oval, int dir) {
Path_Delegate pathDelegate = sManager.getDelegate(nPath);
if (pathDelegate == null) {
return;
@@ -343,7 +343,7 @@ public final class Path_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void native_addCircle(int nPath, float x, float y, float radius, int dir) {
+ /*package*/ static void native_addCircle(long nPath, float x, float y, float radius, int dir) {
Path_Delegate pathDelegate = sManager.getDelegate(nPath);
if (pathDelegate == null) {
return;
@@ -355,7 +355,7 @@ public final class Path_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void native_addArc(int nPath, RectF oval,
+ /*package*/ static void native_addArc(long nPath, RectF oval,
float startAngle, float sweepAngle) {
Path_Delegate pathDelegate = sManager.getDelegate(nPath);
if (pathDelegate == null) {
@@ -370,7 +370,7 @@ public final class Path_Delegate {
@LayoutlibDelegate
/*package*/ static void native_addRoundRect(
- int nPath, RectF rect, float rx, float ry, int dir) {
+ long nPath, RectF rect, float rx, float ry, int dir) {
Path_Delegate pathDelegate = sManager.getDelegate(nPath);
if (pathDelegate == null) {
@@ -382,7 +382,7 @@ public final class Path_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void native_addRoundRect(int nPath, RectF rect, float[] radii, int dir) {
+ /*package*/ static void native_addRoundRect(long nPath, RectF rect, float[] radii, int dir) {
// Java2D doesn't support different rounded corners in each corner, so just use the
// first value.
native_addRoundRect(nPath, rect, radii[0], radii[1], dir);
@@ -401,17 +401,17 @@ public final class Path_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void native_addPath(int nPath, int src, float dx, float dy) {
+ /*package*/ static void native_addPath(long nPath, long src, float dx, float dy) {
addPath(nPath, src, AffineTransform.getTranslateInstance(dx, dy));
}
@LayoutlibDelegate
- /*package*/ static void native_addPath(int nPath, int src) {
+ /*package*/ static void native_addPath(long nPath, long src) {
addPath(nPath, src, null /*transform*/);
}
@LayoutlibDelegate
- /*package*/ static void native_addPath(int nPath, int src, int matrix) {
+ /*package*/ static void native_addPath(long nPath, long src, long matrix) {
Matrix_Delegate matrixDelegate = Matrix_Delegate.getDelegate(matrix);
if (matrixDelegate == null) {
return;
@@ -421,7 +421,7 @@ public final class Path_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void native_offset(int nPath, float dx, float dy, int dst_path) {
+ /*package*/ static void native_offset(long nPath, float dx, float dy, long dst_path) {
Path_Delegate pathDelegate = sManager.getDelegate(nPath);
if (pathDelegate == null) {
return;
@@ -434,12 +434,12 @@ public final class Path_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void native_offset(int nPath, float dx, float dy) {
+ /*package*/ static void native_offset(long nPath, float dx, float dy) {
native_offset(nPath, dx, dy, 0);
}
@LayoutlibDelegate
- /*package*/ static void native_setLastPoint(int nPath, float dx, float dy) {
+ /*package*/ static void native_setLastPoint(long nPath, float dx, float dy) {
Path_Delegate pathDelegate = sManager.getDelegate(nPath);
if (pathDelegate == null) {
return;
@@ -450,8 +450,8 @@ public final class Path_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void native_transform(int nPath, int matrix,
- int dst_path) {
+ /*package*/ static void native_transform(long nPath, long matrix,
+ long dst_path) {
Path_Delegate pathDelegate = sManager.getDelegate(nPath);
if (pathDelegate == null) {
return;
@@ -469,18 +469,18 @@ public final class Path_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void native_transform(int nPath, int matrix) {
+ /*package*/ static void native_transform(long nPath, long matrix) {
native_transform(nPath, matrix, 0);
}
@LayoutlibDelegate
- /*package*/ static boolean native_op(int nPath1, int nPath2, int op, int result) {
+ /*package*/ static boolean native_op(long nPath1, long nPath2, int op, long result) {
Bridge.getLog().error(LayoutLog.TAG_UNSUPPORTED, "Path.op() not supported", null);
return false;
}
@LayoutlibDelegate
- /*package*/ static void finalizer(int nPath) {
+ /*package*/ static void finalizer(long nPath) {
sManager.removeJavaReferenceFor(nPath);
}
@@ -528,7 +528,7 @@ public final class Path_Delegate {
return null;
}
- private static void addPath(int destPath, int srcPath, AffineTransform transform) {
+ private static void addPath(long destPath, long srcPath, AffineTransform transform) {
Path_Delegate destPathDelegate = sManager.getDelegate(destPath);
if (destPathDelegate == null) {
return;
diff --git a/tools/layoutlib/bridge/src/android/graphics/PixelXorXfermode_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/PixelXorXfermode_Delegate.java
index 4ab044b..f27144f 100644
--- a/tools/layoutlib/bridge/src/android/graphics/PixelXorXfermode_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/PixelXorXfermode_Delegate.java
@@ -61,7 +61,7 @@ public class PixelXorXfermode_Delegate extends Xfermode_Delegate {
// ---- native methods ----
@LayoutlibDelegate
- /*package*/ static int nativeCreate(int opColor) {
+ /*package*/ static long nativeCreate(int opColor) {
PixelXorXfermode_Delegate newDelegate = new PixelXorXfermode_Delegate();
return sManager.addNewDelegate(newDelegate);
}
diff --git a/tools/layoutlib/bridge/src/android/graphics/PorterDuffColorFilter_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/PorterDuffColorFilter_Delegate.java
index c45dbaa..6049919 100644
--- a/tools/layoutlib/bridge/src/android/graphics/PorterDuffColorFilter_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/PorterDuffColorFilter_Delegate.java
@@ -55,13 +55,13 @@ public class PorterDuffColorFilter_Delegate extends ColorFilter_Delegate {
// ---- native methods ----
@LayoutlibDelegate
- /*package*/ static int native_CreatePorterDuffFilter(int srcColor, int porterDuffMode) {
+ /*package*/ static long native_CreatePorterDuffFilter(int srcColor, int porterDuffMode) {
PorterDuffColorFilter_Delegate newDelegate = new PorterDuffColorFilter_Delegate();
return sManager.addNewDelegate(newDelegate);
}
@LayoutlibDelegate
- /*package*/ static int nCreatePorterDuffFilter(int nativeFilter, int srcColor,
+ /*package*/ static long nCreatePorterDuffFilter(long nativeFilter, int srcColor,
int porterDuffMode) {
// pass
return 0;
diff --git a/tools/layoutlib/bridge/src/android/graphics/PorterDuffXfermode_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/PorterDuffXfermode_Delegate.java
index 4301c1a..a89fd57 100644
--- a/tools/layoutlib/bridge/src/android/graphics/PorterDuffXfermode_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/PorterDuffXfermode_Delegate.java
@@ -127,7 +127,7 @@ public class PorterDuffXfermode_Delegate extends Xfermode_Delegate {
// ---- native methods ----
@LayoutlibDelegate
- /*package*/ static int nativeCreateXfermode(int mode) {
+ /*package*/ static long nativeCreateXfermode(int mode) {
PorterDuffXfermode_Delegate newDelegate = new PorterDuffXfermode_Delegate(mode);
return sManager.addNewDelegate(newDelegate);
}
diff --git a/tools/layoutlib/bridge/src/android/graphics/RadialGradient_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/RadialGradient_Delegate.java
index 3fe45fa..4f16dcf 100644
--- a/tools/layoutlib/bridge/src/android/graphics/RadialGradient_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/RadialGradient_Delegate.java
@@ -54,7 +54,7 @@ public class RadialGradient_Delegate extends Gradient_Delegate {
// ---- native methods ----
@LayoutlibDelegate
- /*package*/ static int nativeCreate1(float x, float y, float radius,
+ /*package*/ static long nativeCreate1(float x, float y, float radius,
int colors[], float positions[], int tileMode) {
RadialGradient_Delegate newDelegate = new RadialGradient_Delegate(x, y, radius,
colors, positions, Shader_Delegate.getTileMode(tileMode));
@@ -62,21 +62,21 @@ public class RadialGradient_Delegate extends Gradient_Delegate {
}
@LayoutlibDelegate
- /*package*/ static int nativeCreate2(float x, float y, float radius,
+ /*package*/ static long nativeCreate2(float x, float y, float radius,
int color0, int color1, int tileMode) {
return nativeCreate1(x, y, radius, new int[] { color0, color1 }, null /*positions*/,
tileMode);
}
@LayoutlibDelegate
- /*package*/ static int nativePostCreate1(int native_shader, float x, float y, float radius,
+ /*package*/ static long nativePostCreate1(long native_shader, float x, float y, float radius,
int colors[], float positions[], int tileMode) {
// nothing to be done here.
return 0;
}
@LayoutlibDelegate
- /*package*/ static int nativePostCreate2(int native_shader, float x, float y, float radius,
+ /*package*/ static long nativePostCreate2(long native_shader, float x, float y, float radius,
int color0, int color1, int tileMode) {
// nothing to be done here.
return 0;
diff --git a/tools/layoutlib/bridge/src/android/graphics/Rasterizer_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/Rasterizer_Delegate.java
index 2812b6b..a742840 100644
--- a/tools/layoutlib/bridge/src/android/graphics/Rasterizer_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/Rasterizer_Delegate.java
@@ -46,7 +46,7 @@ public abstract class Rasterizer_Delegate {
// ---- Public Helper methods ----
- public static Rasterizer_Delegate getDelegate(int nativeShader) {
+ public static Rasterizer_Delegate getDelegate(long nativeShader) {
return sManager.getDelegate(nativeShader);
}
@@ -56,7 +56,7 @@ public abstract class Rasterizer_Delegate {
// ---- native methods ----
@LayoutlibDelegate
- /*package*/ static void finalizer(int native_instance) {
+ /*package*/ static void finalizer(long native_instance) {
sManager.removeJavaReferenceFor(native_instance);
}
diff --git a/tools/layoutlib/bridge/src/android/graphics/Region_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/Region_Delegate.java
index 57af6e9..d2aae92 100644
--- a/tools/layoutlib/bridge/src/android/graphics/Region_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/Region_Delegate.java
@@ -57,7 +57,7 @@ public class Region_Delegate {
// ---- Public Helper methods ----
- public static Region_Delegate getDelegate(int nativeShader) {
+ public static Region_Delegate getDelegate(long nativeShader) {
return sManager.getDelegate(nativeShader);
}
@@ -264,18 +264,18 @@ public class Region_Delegate {
}
@LayoutlibDelegate
- /*package*/ static int nativeConstructor() {
+ /*package*/ static long nativeConstructor() {
Region_Delegate newDelegate = new Region_Delegate();
return sManager.addNewDelegate(newDelegate);
}
@LayoutlibDelegate
- /*package*/ static void nativeDestructor(int native_region) {
+ /*package*/ static void nativeDestructor(long native_region) {
sManager.removeJavaReferenceFor(native_region);
}
@LayoutlibDelegate
- /*package*/ static void nativeSetRegion(int native_dst, int native_src) {
+ /*package*/ static void nativeSetRegion(long native_dst, long native_src) {
Region_Delegate dstRegion = sManager.getDelegate(native_dst);
if (dstRegion == null) {
return;
@@ -293,7 +293,7 @@ public class Region_Delegate {
}
@LayoutlibDelegate
- /*package*/ static boolean nativeSetRect(int native_dst,
+ /*package*/ static boolean nativeSetRect(long native_dst,
int left, int top, int right, int bottom) {
Region_Delegate dstRegion = sManager.getDelegate(native_dst);
if (dstRegion == null) {
@@ -305,7 +305,7 @@ public class Region_Delegate {
}
@LayoutlibDelegate
- /*package*/ static boolean nativeSetPath(int native_dst, int native_path, int native_clip) {
+ /*package*/ static boolean nativeSetPath(long native_dst, long native_path, long native_clip) {
Region_Delegate dstRegion = sManager.getDelegate(native_dst);
if (dstRegion == null) {
return true;
@@ -327,7 +327,7 @@ public class Region_Delegate {
}
@LayoutlibDelegate
- /*package*/ static boolean nativeGetBounds(int native_region, Rect rect) {
+ /*package*/ static boolean nativeGetBounds(long native_region, Rect rect) {
Region_Delegate region = sManager.getDelegate(native_region);
if (region == null) {
return true;
@@ -347,7 +347,7 @@ public class Region_Delegate {
}
@LayoutlibDelegate
- /*package*/ static boolean nativeGetBoundaryPath(int native_region, int native_path) {
+ /*package*/ static boolean nativeGetBoundaryPath(long native_region, long native_path) {
Region_Delegate region = sManager.getDelegate(native_region);
if (region == null) {
return false;
@@ -368,7 +368,7 @@ public class Region_Delegate {
}
@LayoutlibDelegate
- /*package*/ static boolean nativeOp(int native_dst,
+ /*package*/ static boolean nativeOp(long native_dst,
int left, int top, int right, int bottom, int op) {
Region_Delegate region = sManager.getDelegate(native_dst);
if (region == null) {
@@ -387,7 +387,7 @@ public class Region_Delegate {
}
@LayoutlibDelegate
- /*package*/ static boolean nativeOp(int native_dst, Rect rect, int native_region, int op) {
+ /*package*/ static boolean nativeOp(long native_dst, Rect rect, long native_region, int op) {
Region_Delegate region = sManager.getDelegate(native_dst);
if (region == null) {
return false;
@@ -405,8 +405,8 @@ public class Region_Delegate {
}
@LayoutlibDelegate
- /*package*/ static boolean nativeOp(int native_dst,
- int native_region1, int native_region2, int op) {
+ /*package*/ static boolean nativeOp(long native_dst,
+ long native_region1, long native_region2, int op) {
Region_Delegate dstRegion = sManager.getDelegate(native_dst);
if (dstRegion == null) {
return true;
@@ -434,7 +434,7 @@ public class Region_Delegate {
}
@LayoutlibDelegate
- /*package*/ static int nativeCreateFromParcel(Parcel p) {
+ /*package*/ static long nativeCreateFromParcel(Parcel p) {
// This is only called by Region.CREATOR (Parcelable.Creator<Region>), which is only
// used during aidl call so really this should not be called.
Bridge.getLog().error(LayoutLog.TAG_UNSUPPORTED,
@@ -444,7 +444,7 @@ public class Region_Delegate {
}
@LayoutlibDelegate
- /*package*/ static boolean nativeWriteToParcel(int native_region,
+ /*package*/ static boolean nativeWriteToParcel(long native_region,
Parcel p) {
// This is only called when sending a region through aidl, so really this should not
// be called.
@@ -455,7 +455,7 @@ public class Region_Delegate {
}
@LayoutlibDelegate
- /*package*/ static boolean nativeEquals(int native_r1, int native_r2) {
+ /*package*/ static boolean nativeEquals(long native_r1, long native_r2) {
Region_Delegate region1 = sManager.getDelegate(native_r1);
if (region1 == null) {
return false;
@@ -470,7 +470,7 @@ public class Region_Delegate {
}
@LayoutlibDelegate
- /*package*/ static String nativeToString(int native_region) {
+ /*package*/ static String nativeToString(long native_region) {
Region_Delegate region = sManager.getDelegate(native_region);
if (region == null) {
return "not found";
diff --git a/tools/layoutlib/bridge/src/android/graphics/Shader_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/Shader_Delegate.java
index 368c0384..70a0a43 100644
--- a/tools/layoutlib/bridge/src/android/graphics/Shader_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/Shader_Delegate.java
@@ -49,7 +49,7 @@ public abstract class Shader_Delegate {
// ---- Public Helper methods ----
- public static Shader_Delegate getDelegate(int nativeShader) {
+ public static Shader_Delegate getDelegate(long nativeShader) {
return sManager.getDelegate(nativeShader);
}
@@ -76,13 +76,13 @@ public abstract class Shader_Delegate {
// ---- native methods ----
@LayoutlibDelegate
- /*package*/ static void nativeDestructor(int native_shader, int native_skiaShader) {
+ /*package*/ static void nativeDestructor(long native_shader, long native_skiaShader) {
sManager.removeJavaReferenceFor(native_shader);
}
@LayoutlibDelegate
- /*package*/ static void nativeSetLocalMatrix(int native_shader, int native_skiaShader,
- int matrix_instance) {
+ /*package*/ static void nativeSetLocalMatrix(long native_shader, long native_skiaShader,
+ long matrix_instance) {
// get the delegate from the native int.
Shader_Delegate shaderDelegate = sManager.getDelegate(native_shader);
if (shaderDelegate == null) {
diff --git a/tools/layoutlib/bridge/src/android/graphics/SumPathEffect_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/SumPathEffect_Delegate.java
index 410df0c..6d2e9b4 100644
--- a/tools/layoutlib/bridge/src/android/graphics/SumPathEffect_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/SumPathEffect_Delegate.java
@@ -62,7 +62,7 @@ public class SumPathEffect_Delegate extends PathEffect_Delegate {
// ---- native methods ----
@LayoutlibDelegate
- /*package*/ static int nativeCreate(int first, int second) {
+ /*package*/ static long nativeCreate(long first, long second) {
SumPathEffect_Delegate newDelegate = new SumPathEffect_Delegate();
return sManager.addNewDelegate(newDelegate);
}
diff --git a/tools/layoutlib/bridge/src/android/graphics/SweepGradient_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/SweepGradient_Delegate.java
index 13ae12e..f2b3e8d 100644
--- a/tools/layoutlib/bridge/src/android/graphics/SweepGradient_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/SweepGradient_Delegate.java
@@ -52,25 +52,25 @@ public class SweepGradient_Delegate extends Gradient_Delegate {
// ---- native methods ----
@LayoutlibDelegate
- /*package*/ static int nativeCreate1(float x, float y, int colors[], float positions[]) {
+ /*package*/ static long nativeCreate1(float x, float y, int colors[], float positions[]) {
SweepGradient_Delegate newDelegate = new SweepGradient_Delegate(x, y, colors, positions);
return sManager.addNewDelegate(newDelegate);
}
@LayoutlibDelegate
- /*package*/ static int nativeCreate2(float x, float y, int color0, int color1) {
+ /*package*/ static long nativeCreate2(float x, float y, int color0, int color1) {
return nativeCreate1(x, y, new int[] { color0, color1 }, null /*positions*/);
}
@LayoutlibDelegate
- /*package*/ static int nativePostCreate1(int native_shader, float cx, float cy,
+ /*package*/ static long nativePostCreate1(long native_shader, float cx, float cy,
int[] colors, float[] positions) {
// nothing to be done here.
return 0;
}
@LayoutlibDelegate
- /*package*/ static int nativePostCreate2(int native_shader, float cx, float cy,
+ /*package*/ static long nativePostCreate2(long native_shader, float cx, float cy,
int color0, int color1) {
// nothing to be done here.
return 0;
diff --git a/tools/layoutlib/bridge/src/android/graphics/Typeface_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/Typeface_Delegate.java
index b50e98b..60cd157 100644
--- a/tools/layoutlib/bridge/src/android/graphics/Typeface_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/Typeface_Delegate.java
@@ -75,7 +75,7 @@ public final class Typeface_Delegate {
sPostInitDelegate.clear();
}
- public static Typeface_Delegate getDelegate(int nativeTypeface) {
+ public static Typeface_Delegate getDelegate(long nativeTypeface) {
return sManager.getDelegate(nativeTypeface);
}
@@ -83,7 +83,7 @@ public final class Typeface_Delegate {
return getFonts(typeface.native_instance);
}
- public static List<Font> getFonts(int native_int) {
+ public static List<Font> getFonts(long native_int) {
Typeface_Delegate delegate = sManager.getDelegate(native_int);
if (delegate == null) {
return null;
@@ -99,7 +99,7 @@ public final class Typeface_Delegate {
// ---- native methods ----
@LayoutlibDelegate
- /*package*/ static synchronized int nativeCreate(String familyName, int style) {
+ /*package*/ static synchronized long nativeCreate(String familyName, int style) {
if (familyName == null) {
familyName = DEFAULT_FAMILY;
}
@@ -121,7 +121,7 @@ public final class Typeface_Delegate {
}
@LayoutlibDelegate
- /*package*/ static synchronized int nativeCreateFromTypeface(int native_instance, int style) {
+ /*package*/ static synchronized long nativeCreateFromTypeface(long native_instance, int style) {
Typeface_Delegate delegate = sManager.getDelegate(native_instance);
if (delegate == null) {
return 0;
@@ -141,14 +141,14 @@ public final class Typeface_Delegate {
}
@LayoutlibDelegate
- /*package*/ static synchronized int nativeCreateFromAsset(AssetManager mgr, String path) {
+ /*package*/ static synchronized long nativeCreateFromAsset(AssetManager mgr, String path) {
Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
"Typeface.createFromAsset() is not supported.", null /*throwable*/, null /*data*/);
return 0;
}
@LayoutlibDelegate
- /*package*/ static synchronized int nativeCreateFromFile(String path) {
+ /*package*/ static synchronized long nativeCreateFromFile(String path) {
if (path.startsWith(SYSTEM_FONTS) ) {
String relativePath = path.substring(SYSTEM_FONTS.length());
File f = new File(sFontLoader.getOsFontsLocation(), relativePath);
@@ -177,12 +177,12 @@ public final class Typeface_Delegate {
}
@LayoutlibDelegate
- /*package*/ static void nativeUnref(int native_instance) {
+ /*package*/ static void nativeUnref(long native_instance) {
sManager.removeJavaReferenceFor(native_instance);
}
@LayoutlibDelegate
- /*package*/ static int nativeGetStyle(int native_instance) {
+ /*package*/ static int nativeGetStyle(long native_instance) {
Typeface_Delegate delegate = sManager.getDelegate(native_instance);
if (delegate == null) {
return 0;
diff --git a/tools/layoutlib/bridge/src/android/graphics/Xfermode_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/Xfermode_Delegate.java
index 962d69c..94a6d76 100644
--- a/tools/layoutlib/bridge/src/android/graphics/Xfermode_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/Xfermode_Delegate.java
@@ -48,7 +48,7 @@ public abstract class Xfermode_Delegate {
// ---- Public Helper methods ----
- public static Xfermode_Delegate getDelegate(int native_instance) {
+ public static Xfermode_Delegate getDelegate(long native_instance) {
return sManager.getDelegate(native_instance);
}
@@ -60,7 +60,7 @@ public abstract class Xfermode_Delegate {
// ---- native methods ----
@LayoutlibDelegate
- /*package*/ static void finalizer(int native_instance) {
+ /*package*/ static void finalizer(long native_instance) {
sManager.removeJavaReferenceFor(native_instance);
}
diff --git a/tools/layoutlib/bridge/src/android/view/IWindowManagerImpl.java b/tools/layoutlib/bridge/src/android/view/IWindowManagerImpl.java
index dd2cbc1..4511413 100644
--- a/tools/layoutlib/bridge/src/android/view/IWindowManagerImpl.java
+++ b/tools/layoutlib/bridge/src/android/view/IWindowManagerImpl.java
@@ -428,11 +428,6 @@ public class IWindowManagerImpl implements IWindowManager {
}
@Override
- public boolean waitForWindowDrawn(IBinder token, IRemoteCallback callback) {
- return false;
- }
-
- @Override
public IBinder asBinder() {
// TODO Auto-generated method stub
return null;
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java
index 625f108..29e1f76 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java
@@ -58,6 +58,7 @@ import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.graphics.Bitmap;
import android.graphics.drawable.Drawable;
+import android.hardware.display.DisplayManager;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
@@ -101,6 +102,7 @@ public final class BridgeContext extends Context {
private final ApplicationInfo mApplicationInfo;
private final IProjectCallback mProjectCallback;
private final WindowManager mWindowManager;
+ private final DisplayManager mDisplayManager;
private Resources.Theme mTheme;
@@ -149,6 +151,7 @@ public final class BridgeContext extends Context {
}
mWindowManager = new WindowManagerImpl(mMetrics);
+ mDisplayManager = new DisplayManager(this);
}
/**
@@ -455,6 +458,10 @@ public final class BridgeContext extends Context {
return new PowerManager(this, new BridgePowerManager(), new Handler());
}
+ if (DISPLAY_SERVICE.equals(service)) {
+ return mDisplayManager;
+ }
+
throw new UnsupportedOperationException("Unsupported Service: " + service);
}
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgePowerManager.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgePowerManager.java
index 281337c..95221fb 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgePowerManager.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgePowerManager.java
@@ -28,7 +28,7 @@ import android.os.WorkSource;
public class BridgePowerManager implements IPowerManager {
@Override
- public boolean isScreenOn() throws RemoteException {
+ public boolean isInteractive() throws RemoteException {
return true;
}
@@ -56,7 +56,7 @@ public class BridgePowerManager implements IPowerManager {
}
@Override
- public void goToSleep(long arg0, int arg1) throws RemoteException {
+ public void goToSleep(long arg0, int arg1, int arg2) throws RemoteException {
// pass for now.
}
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeWindow.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeWindow.java
index df576d2..d32f6ee 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeWindow.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeWindow.java
@@ -58,11 +58,6 @@ public final class BridgeWindow implements IWindow {
}
@Override
- public void dispatchScreenState(boolean on) throws RemoteException {
- // pass for now.
- }
-
- @Override
public void windowFocusChanged(boolean arg0, boolean arg1) throws RemoteException {
// pass for now.
}
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/DelegateManager.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/DelegateManager.java
index ae1217d..261cc98 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/DelegateManager.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/DelegateManager.java
@@ -94,7 +94,7 @@ public final class DelegateManager<T> {
* @param native_object the native int.
* @return the delegate or null if not found.
*/
- public T getDelegate(int native_object) {
+ public T getDelegate(long native_object) {
if (native_object > 0) {
T delegate = mDelegates.get(native_object);
@@ -116,8 +116,8 @@ public final class DelegateManager<T> {
* @param newDelegate the delegate to add
* @return a unique native int to identify the delegate
*/
- public int addNewDelegate(T newDelegate) {
- int native_object = ++mDelegateCounter;
+ public long addNewDelegate(T newDelegate) {
+ long native_object = ++mDelegateCounter;
mDelegates.put(native_object, newDelegate);
assert !mJavaReferences.contains(newDelegate);
mJavaReferences.add(newDelegate);
@@ -133,7 +133,7 @@ public final class DelegateManager<T> {
* Removes the main reference on the given delegate.
* @param native_object the native integer representing the delegate.
*/
- public void removeJavaReferenceFor(int native_object) {
+ public void removeJavaReferenceFor(long native_object) {
T delegate = getDelegate(native_object);
if (Debug.DEBUG) {
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/util/SparseWeakArray.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/util/SparseWeakArray.java
index 4d0c9ce..53e1640 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/util/SparseWeakArray.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/util/SparseWeakArray.java
@@ -30,13 +30,14 @@ import java.lang.ref.WeakReference;
*
* The code is taken from {@link SparseArray} directly and adapted to use weak references.
*
- * Because our usage means that we never actually call {@link #remove(int)} or {@link #delete(int)},
- * we must manually check if there are reclaimed references to trigger an internal compact step
- * (which is normally only triggered when an item is manually removed).
+ * Because our usage means that we never actually call {@link #remove(long)} or
+ * {@link #delete(long)}, we must manually check if there are reclaimed references to
+ * trigger an internal compact step (which is normally only triggered when an item is manually
+ * removed).
*
- * SparseArrays map integers to Objects. Unlike a normal array of Objects,
+ * SparseArrays map integral values to Objects. Unlike a normal array of Objects,
* there can be gaps in the indices. It is intended to be more efficient
- * than using a HashMap to map Integers to Objects.
+ * than using a HashMap to map Integers (or Longs) to Objects.
*/
@SuppressWarnings("unchecked")
public class SparseWeakArray<E> {
@@ -58,9 +59,9 @@ public class SparseWeakArray<E> {
* number of mappings.
*/
public SparseWeakArray(int initialCapacity) {
- initialCapacity = ArrayUtils.idealIntArraySize(initialCapacity);
+ initialCapacity = ArrayUtils.idealLongArraySize(initialCapacity);
- mKeys = new int[initialCapacity];
+ mKeys = new long[initialCapacity];
mValues = new WeakReference[initialCapacity];
mSize = 0;
}
@@ -69,7 +70,7 @@ public class SparseWeakArray<E> {
* Gets the Object mapped from the specified key, or <code>null</code>
* if no such mapping has been made.
*/
- public E get(int key) {
+ public E get(long key) {
return get(key, null);
}
@@ -77,7 +78,7 @@ public class SparseWeakArray<E> {
* Gets the Object mapped from the specified key, or the specified Object
* if no such mapping has been made.
*/
- public E get(int key, E valueIfKeyNotFound) {
+ public E get(long key, E valueIfKeyNotFound) {
int i = binarySearch(mKeys, 0, mSize, key);
if (i < 0 || mValues[i] == DELETED || mValues[i].get() == null) {
@@ -90,7 +91,7 @@ public class SparseWeakArray<E> {
/**
* Removes the mapping from the specified key, if there was any.
*/
- public void delete(int key) {
+ public void delete(long key) {
int i = binarySearch(mKeys, 0, mSize, key);
if (i >= 0) {
@@ -102,9 +103,9 @@ public class SparseWeakArray<E> {
}
/**
- * Alias for {@link #delete(int)}.
+ * Alias for {@link #delete(long)}.
*/
- public void remove(int key) {
+ public void remove(long key) {
delete(key);
}
@@ -121,7 +122,7 @@ public class SparseWeakArray<E> {
private void gc() {
int n = mSize;
int o = 0;
- int[] keys = mKeys;
+ long[] keys = mKeys;
WeakReference<?>[] values = mValues;
for (int i = 0; i < n; i++) {
@@ -142,9 +143,9 @@ public class SparseWeakArray<E> {
mGarbage = false;
mSize = o;
- int newSize = ArrayUtils.idealIntArraySize(mSize);
+ int newSize = ArrayUtils.idealLongArraySize(mSize);
if (newSize < mKeys.length) {
- int[] nkeys = new int[newSize];
+ long[] nkeys = new long[newSize];
WeakReference<?>[] nvalues = new WeakReference[newSize];
System.arraycopy(mKeys, 0, nkeys, 0, newSize);
@@ -160,7 +161,7 @@ public class SparseWeakArray<E> {
* replacing the previous mapping from the specified key if there
* was one.
*/
- public void put(int key, E value) {
+ public void put(long key, E value) {
int i = binarySearch(mKeys, 0, mSize, key);
if (i >= 0) {
@@ -182,9 +183,9 @@ public class SparseWeakArray<E> {
}
if (mSize >= mKeys.length) {
- int n = ArrayUtils.idealIntArraySize(mSize + 1);
+ int n = ArrayUtils.idealLongArraySize(mSize + 1);
- int[] nkeys = new int[n];
+ long[] nkeys = new long[n];
WeakReference<?>[] nvalues = new WeakReference[n];
// Log.e("SparseArray", "grow " + mKeys.length + " to " + n);
@@ -224,7 +225,7 @@ public class SparseWeakArray<E> {
* the key from the <code>index</code>th key-value mapping that this
* SparseArray stores.
*/
- public int keyAt(int index) {
+ public long keyAt(int index) {
if (mGarbage) {
gc();
}
@@ -263,7 +264,7 @@ public class SparseWeakArray<E> {
* specified key, or a negative number if the specified
* key is not mapped.
*/
- public int indexOfKey(int key) {
+ public int indexOfKey(long key) {
if (mGarbage) {
gc();
}
@@ -310,7 +311,7 @@ public class SparseWeakArray<E> {
* Puts a key/value pair into the array, optimizing for the case where
* the key is greater than all existing keys in the array.
*/
- public void append(int key, E value) {
+ public void append(long key, E value) {
if (mSize != 0 && key <= mKeys[mSize - 1]) {
put(key, value);
return;
@@ -322,9 +323,9 @@ public class SparseWeakArray<E> {
int pos = mSize;
if (pos >= mKeys.length) {
- int n = ArrayUtils.idealIntArraySize(pos + 1);
+ int n = ArrayUtils.idealLongArraySize(pos + 1);
- int[] nkeys = new int[n];
+ long[] nkeys = new long[n];
WeakReference<?>[] nvalues = new WeakReference[n];
// Log.e("SparseArray", "grow " + mKeys.length + " to " + n);
@@ -350,7 +351,7 @@ public class SparseWeakArray<E> {
return false;
}
- private static int binarySearch(int[] a, int start, int len, int key) {
+ private static int binarySearch(long[] a, int start, int len, long key) {
int high = start + len, low = start - 1, guess;
while (high - low > 1) {
@@ -370,7 +371,7 @@ public class SparseWeakArray<E> {
return ~high;
}
- private int[] mKeys;
+ private long[] mKeys;
private WeakReference<?>[] mValues;
private int mSize;
}
diff --git a/tools/layoutlib/bridge/src/libcore/icu/ICU_Delegate.java b/tools/layoutlib/bridge/src/libcore/icu/ICU_Delegate.java
index ad4103b..f54beed 100644
--- a/tools/layoutlib/bridge/src/libcore/icu/ICU_Delegate.java
+++ b/tools/layoutlib/bridge/src/libcore/icu/ICU_Delegate.java
@@ -137,6 +137,11 @@ public class ICU_Delegate {
}
@LayoutlibDelegate
+ /*package*/ static String getDisplayScriptNative(String variantCode, String locale) {
+ return "";
+ }
+
+ @LayoutlibDelegate
/*package*/ static String getISO3CountryNative(String locale) {
return "";
}
@@ -167,6 +172,16 @@ public class ICU_Delegate {
}
@LayoutlibDelegate
+ /*package*/ static String localeForLanguageTag(String languageTag, boolean strict) {
+ return "";
+ }
+
+ @LayoutlibDelegate
+ /*package*/ static String languageTagForLocale(String locale) {
+ return "";
+ }
+
+ @LayoutlibDelegate
/*package*/ static boolean initLocaleDataNative(String locale, LocaleData result) {
// Used by Calendar.
diff --git a/tools/layoutlib/create/README.txt b/tools/layoutlib/create/README.txt
index ef2b185..32625ae 100644
--- a/tools/layoutlib/create/README.txt
+++ b/tools/layoutlib/create/README.txt
@@ -4,46 +4,45 @@
- Description -
---------------
-Layoutlib_create generates a JAR library used by the Eclipse graphical layout editor
-to perform layout.
+Layoutlib_create generates a JAR library used by the Eclipse graphical layout editor to perform
+layout.
- Usage -
---------
- ./layoutlib_create path/to/android.jar destination.jar
+ ./layoutlib_create destination.jar path/to/android1.jar path/to/android2.jar
- Design Overview -
-------------------
-Layoutlib_create uses the "android.jar" containing all the Java code used by Android
-as generated by the Android build, right before the classes are converted to a DEX format.
+Layoutlib_create uses a few jars from the framework containing the Java code used by Android as
+generated by the Android build, right before the classes are converted to a DEX format.
-The Android JAR can't be used directly in Eclipse:
-- it contains references to native code (which we want to avoid in Eclipse),
-- some classes need to be overridden, for example all the drawing code that is
- replaced by Java 2D calls in Eclipse.
-- some of the classes that need to be changed are final and/or we need access
- to their private internal state.
+These jars can't be used directly in Eclipse as:
+- they contains references to native code (which we want to avoid in Eclipse),
+- some classes need to be overridden, for example all the drawing code that is replaced by Java 2D
+ calls in Eclipse.
+- some of the classes that need to be changed are final and/or we need access to their private
+ internal state.
Consequently this tool:
- parses the input JAR,
- modifies some of the classes directly using some bytecode manipulation,
- filters some packages and removes those we don't want in the output JAR,
- injects some new classes,
-- generates a modified JAR file that is suitable for the Android plugin
- for Eclipse to perform rendering.
+- generates a modified JAR file that is suitable for the Android plugin for Eclipse to perform
+ rendering.
The ASM library is used to do the bytecode modification using its visitor pattern API.
-The layoutlib_create is *NOT* generic. There is no configuration file. Instead all the
-configuration is done in the main() method and the CreateInfo structure is expected to
-change with the Android platform as new classes are added, changed or removed.
+The layoutlib_create is *NOT* generic. There is no configuration file. Instead all the configuration
+is done in the main() method and the CreateInfo structure is expected to change with the Android
+platform as new classes are added, changed or removed.
-The resulting JAR is used by layoutlib_bridge (a.k.a. "the bridge"), also part of the
-platform, that provides all the necessary missing implementation for rendering graphics
-in Eclipse.
+The resulting JAR is used by layoutlib_bridge (a.k.a. "the bridge"), also part of the platform, that
+provides all the necessary missing implementation for rendering graphics in Eclipse.
@@ -58,97 +57,100 @@ The tool works in two phases:
- Analyzer
----------
-The goal of the analyzer is to create a graph of all the classes from the input JAR
-with their dependencies and then only keep the ones we want.
+The goal of the analyzer is to create a graph of all the classes from the input JAR with their
+dependencies and then only keep the ones we want.
-To do that, the analyzer is created with a list of base classes to keep -- everything
-that derives from these is kept. Currently the one such class is android.view.View:
-since we want to render layouts, anything that is sort of a view needs to be kept.
+To do that, the analyzer is created with a list of base classes to keep -- everything that derives
+from these is kept. Currently the one such class is android.view.View: since we want to render
+layouts, anything that is sort of a view needs to be kept.
-The analyzer is also given a list of class names to keep in the output.
-This is done using shell-like glob patterns that filter on the fully-qualified
-class names, for example "android.*.R**" ("*" does not matches dots whilst "**" does,
-and "." and "$" are interpreted as-is).
-In practice we almost but not quite request the inclusion of full packages.
+The analyzer is also given a list of class names to keep in the output. This is done using
+shell-like glob patterns that filter on the fully-qualified class names, for example "android.*.R**"
+("*" does not matches dots whilst "**" does, and "." and "$" are interpreted as-is). In practice we
+almost but not quite request the inclusion of full packages.
-The analyzer is also given a list of classes to exclude. A fake implementation of these
-classes is injected by the Generator.
+The analyzer is also given a list of classes to exclude. A fake implementation of these classes is
+injected by the Generator.
-With this information, the analyzer parses the input zip to find all the classes.
-All classes deriving from the requested bases classes are kept.
-All classes which name matched the glob pattern are kept.
-The analysis then finds all the dependencies of the classes that are to be kept
-using an ASM visitor on the class, the field types, the method types and annotations types.
-Classes that belong to the current JRE are excluded.
+With this information, the analyzer parses the input zip to find all the classes. All classes
+deriving from the requested bases classes are kept. All classes whose name match the glob pattern
+are kept. The analysis then finds all the dependencies of the classes that are to be kept using an
+ASM visitor on the class, the field types, the method types and annotations types. Classes that
+belong to the current JRE are excluded.
-The output of the analyzer is a set of ASM ClassReader instances which are then
-fed to the generator.
+The output of the analyzer is a set of ASM ClassReader instances which are then fed to the
+generator.
- Generator
-----------
-The generator is constructed from a CreateInfo struct that acts as a config file
-and lists:
-- the classes to inject in the output JAR -- these classes are directly implemented
- in layoutlib_create and will be used to interface with the renderer in Eclipse.
+The generator is constructed from a CreateInfo struct that acts as a config file and lists:
+- the classes to inject in the output JAR -- these classes are directly implemented in
+ layoutlib_create and will be used to interface with the renderer in Eclipse.
- specific methods to override (see method stubs details below).
- specific methods for which to delegate calls.
- specific methods to remove based on their return type.
- specific classes to rename.
- specific classes to refactor.
-Each of these are specific strategies we use to be able to modify the Android code
-to fit within the Eclipse renderer. These strategies are explained beow.
+Each of these are specific strategies we use to be able to modify the Android code to fit within the
+Eclipse renderer. These strategies are explained beow.
-The core method of the generator is transform(): it takes an input ASM ClassReader
-and modifies it to produce a byte array suitable for the final JAR file.
+The core method of the generator is transform(): it takes an input ASM ClassReader and modifies it
+to produce a byte array suitable for the final JAR file.
The first step of the transformation is to implement the method delegates.
-The TransformClassAdapter is then used to process the potentially renamed class.
-All protected or private classes are market as public.
-All classes are made non-final.
-Interfaces are left as-is.
+The TransformClassAdapter is then used to process the potentially renamed class. All protected or
+private classes are market as public. All classes are made non-final. Interfaces are left as-is.
-If a method has a return type that must be erased, the whole method is skipped.
-Methods are also changed from protected/private to public.
-The code of the methods is then kept as-is, except for native methods which are
-replaced by a stub. Methods that are to be overridden are also replaced by a stub.
+If a method has a return type that must be erased, the whole method is skipped. Methods are also
+changed from protected/private to public. The code of the methods is then kept as-is, except for
+native methods which are replaced by a stub. Methods that are to be overridden are also replaced by
+a stub.
Finally fields are also visited and changed from protected/private to public.
-The next step of the transformation is changing the name of the class in case
-we requested the class to be renamed. This uses the RenameClassAdapter to also rename
-all inner classes and references in methods and types. Note that other classes are
-not transformed and keep referencing the original name.
-
-The class is then fed to RefactorClassAdapter which is like RenameClassAdapter but
-updates the references in all classes. This is used to update the references of classes
-in the java package that were added in the Dalvik VM but are not a part of the standard
-JVM. The existing classes are modified to update all references to these non-standard
-classes. An alternate implementation of these (com.android.tools.layoutlib.java.*) is
-injected.
-
-The ClassAdapters are chained together to achieve the desired output. (Look at section
-2.2.7 Transformation chains in the asm user guide, link in the References.) The order of
-execution of these is:
+The next step of the transformation is changing the name of the class in case we requested the class
+to be renamed. This uses the RenameClassAdapter to also rename all inner classes and references in
+methods and types. Note that other classes are not transformed and keep referencing the original
+name.
+
+The class is then fed to RefactorClassAdapter which is like RenameClassAdapter but updates the
+references in all classes. This is used to update the references of classes in the java package that
+were added in the Dalvik VM but are not a part of the Desktop VM. The existing classes are
+modified to update all references to these non-desktop classes. An alternate implementation of
+these (com.android.tools.layoutlib.java.*) is injected.
+
+RenameClassAdapter and RefactorClassAdapter both inherit from AbstractClassAdapter which changes the
+class version (version of the JDK used to compile the class) to 50 (corresponding to Java 6), if the
+class was originally compiled with Java 7 (version 51). This is because we don't currently generate
+the StackMapTable correctly and Java 7 VM enforces that classes with version greater than 51 have
+valid StackMapTable. As a side benefit of this, we can continue to support Java 6 because Java 7 on
+Mac has horrible font rendering support.
+
+ReplaceMethodCallsAdapter replaces calls to certain methods. Currently, it only rewrites calls to
+java.lang.System.arraycopy([CI[CII)V, which is not part of the Desktop VM to call the more general
+method java.lang.System.arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V.
+
+The ClassAdapters are chained together to achieve the desired output. (Look at section 2.2.7
+Transformation chains in the asm user guide, link in the References.) The order of execution of
+these is:
ClassReader -> [DelegateClassAdapter] -> TransformClassAdapter -> [RenameClassAdapter] ->
-RefactorClassAdapter -> ClassWriter
+RefactorClassAdapter -> [ReplaceMethodCallsAdapter] -> ClassWriter
- Method stubs
--------------
-As indicated above, all native and overridden methods are replaced by a stub.
-We don't have the code to replace with in layoutlib_create.
-Instead the StubMethodAdapter replaces the code of the method by a call to
-OverrideMethod.invokeX(). When using the final JAR, the bridge can register
+As indicated above, all native and overridden methods are replaced by a stub. We don't have the
+code to replace with in layoutlib_create. Instead the StubMethodAdapter replaces the code of the
+method by a call to OverrideMethod.invokeX(). When using the final JAR, the bridge can register
listeners from these overridden method calls based on the method signatures.
-The listeners are currently pretty basic: we only pass the signature of the
-method being called, its caller object and a flag indicating whether the
-method was native. We do not currently provide the parameters. The listener
-can however specify the return value of the overridden method.
+The listeners are currently pretty basic: we only pass the signature of the method being called, its
+caller object and a flag indicating whether the method was native. We do not currently provide the
+parameters. The listener can however specify the return value of the overridden method.
This strategy is now obsolete and replaced by the method delegates.
@@ -156,97 +158,89 @@ This strategy is now obsolete and replaced by the method delegates.
- Strategies
------------
-We currently have 6 strategies to deal with overriding the rendering code
-and make it run in Eclipse. Most of these strategies are implemented hand-in-hand
-by the bridge (which runs in Eclipse) and the generator.
+We currently have 6 strategies to deal with overriding the rendering code and make it run in
+Eclipse. Most of these strategies are implemented hand-in-hand by the bridge (which runs in Eclipse)
+and the generator.
1- Class Injection
This is the easiest: we currently inject the following classes:
-- OverrideMethod and its associated MethodListener and MethodAdapter are used
- to intercept calls to some specific methods that are stubbed out and change
- their return value.
-- CreateInfo class, which configured the generator. Not used yet, but could
- in theory help us track what the generator changed.
-- AutoCloseable and Objects are part of Java 7. To enable us to still run on Java 6, new
- classes are injected. The implementation for these classes has been taken from
- Android's libcore (platform/libcore/luni/src/main/java/java/...).
-- Charsets, IntegralToString and UnsafeByteSequence are not part of the standard JAVA VM.
- They are added to the Dalvik VM for performance reasons. An implementation that is very
- close to the original (which is at platform/libcore/luni/src/main/java/...) is injected.
- Since these classees were in part of the java package, where we can't inject classes,
- all references to these have been updated (See strategy 4- Refactoring Classes).
+- OverrideMethod and its associated MethodListener and MethodAdapter are used to intercept calls to
+ some specific methods that are stubbed out and change their return value.
+- CreateInfo class, which configured the generator. Not used yet, but could in theory help us track
+ what the generator changed.
+- AutoCloseable and Objects are part of Java 7. To enable us to still run on Java 6, new classes are
+ injected. The implementation for these classes has been taken from Android's libcore
+ (platform/libcore/luni/src/main/java/java/...).
+- Charsets, IntegralToString and UnsafeByteSequence are not part of the Desktop VM. They are
+ added to the Dalvik VM for performance reasons. An implementation that is very close to the
+ original (which is at platform/libcore/luni/src/main/java/...) is injected. Since these classees
+ were in part of the java package, where we can't inject classes, all references to these have been
+ updated (See strategy 4- Refactoring Classes).
2- Overriding methods
-As explained earlier, the creator doesn't have any replacement code for
-methods to override. Instead it removes the original code and replaces it
-by a call to a specific OveriddeMethod.invokeX(). The bridge then registers
-a listener on the method signature and can provide an implementation.
+As explained earlier, the creator doesn't have any replacement code for methods to override. Instead
+it removes the original code and replaces it by a call to a specific OveriddeMethod.invokeX(). The
+bridge then registers a listener on the method signature and can provide an implementation.
-This strategy is now obsolete and replaced by the method delegates.
-See strategy 5 below.
+This strategy is now obsolete and replaced by the method delegates (See strategy 6- Method
+Delegates).
3- Renaming classes
-This simply changes the name of a class in its definition, as well as all its
-references in internal inner classes and methods.
-Calls from other classes are not modified -- they keep referencing the original
-class name. This allows the bridge to literally replace an implementation.
+This simply changes the name of a class in its definition, as well as all its references in internal
+inner classes and methods. Calls from other classes are not modified -- they keep referencing the
+original class name. This allows the bridge to literally replace an implementation.
-An example will make this easier: android.graphics.Paint is the main drawing
-class that we need to replace. To do so, the generator renames Paint to _original_Paint.
-Later the bridge provides its own replacement version of Paint which will be used
-by the rest of the Android stack. The replacement version of Paint can still use
-(either by inheritance or delegation) all the original non-native code of _original_Paint
-if it so desires.
+An example will make this easier: android.graphics.Paint is the main drawing class that we need to
+replace. To do so, the generator renames Paint to _original_Paint. Later the bridge provides its own
+replacement version of Paint which will be used by the rest of the Android stack. The replacement
+version of Paint can still use (either by inheritance or delegation) all the original non-native
+code of _original_Paint if it so desires.
-Some of the Android classes are basically wrappers over native objects and since
-we don't have the native code in Eclipse, we need to provide a full alternate
-implementation. Sub-classing doesn't work as some native methods are static and
-we don't control object creation.
+Some of the Android classes are basically wrappers over native objects and since we don't have the
+native code in Eclipse, we need to provide a full alternate implementation. Sub-classing doesn't
+work as some native methods are static and we don't control object creation.
This won't rename/replace the inner static methods of a given class.
4- Refactoring classes
-This is very similar to the Renaming classes except that it also updates the reference in
-all classes. This is done for classes which are added to the Dalvik VM for performance
-reasons but are not present in the Standard Java VM. An implementation for these classes
-is also injected.
+This is very similar to the Renaming classes except that it also updates the reference in all
+classes. This is done for classes which are added to the Dalvik VM for performance reasons but are
+not present in the Desktop VM. An implementation for these classes is also injected.
5- Method erasure based on return type
-This is mostly an implementation detail of the bridge: in the Paint class
-mentioned above, some inner static classes are used to pass around
-attributes (e.g. FontMetrics, or the Style enum) and all the original implementation
-is native.
+This is mostly an implementation detail of the bridge: in the Paint class mentioned above, some
+inner static classes are used to pass around attributes (e.g. FontMetrics, or the Style enum) and
+all the original implementation is native.
-In this case we have a strategy that tells the generator that anything returning, for
-example, the inner class Paint$Style in the Paint class should be discarded and the
-bridge will provide its own implementation.
+In this case we have a strategy that tells the generator that anything returning, for example, the
+inner class Paint$Style in the Paint class should be discarded and the bridge will provide its own
+implementation.
6- Method Delegates
-This strategy is used to override method implementations.
-Given a method SomeClass.MethodName(), 1 or 2 methods are generated:
-a- A copy of the original method named SomeClass.MethodName_Original().
- The content is the original method as-is from the reader.
- This step is omitted if the method is native, since it has no Java implementation.
-b- A brand new implementation of SomeClass.MethodName() which calls to a
- non-existing static method named SomeClass_Delegate.MethodName().
- The implementation of this 'delegate' method is done in layoutlib_brigde.
-
-The delegate method is a static method.
-If the original method is non-static, the delegate method receives the original 'this'
-as its first argument. If the original method is an inner non-static method, it also
-receives the inner 'this' as the second argument.
+This strategy is used to override method implementations. Given a method SomeClass.MethodName(), 1
+or 2 methods are generated:
+a- A copy of the original method named SomeClass.MethodName_Original(). The content is the original
+method as-is from the reader. This step is omitted if the method is native, since it has no Java
+implementation.
+b- A brand new implementation of SomeClass.MethodName() which calls to a non-existing static method
+named SomeClass_Delegate.MethodName(). The implementation of this 'delegate' method is done in
+layoutlib_brigde.
+
+The delegate method is a static method. If the original method is non-static, the delegate method
+receives the original 'this' as its first argument. If the original method is an inner non-static
+method, it also receives the inner 'this' as the second argument.
diff --git a/tools/layoutlib/create/src/com/android/tools/layoutlib/create/AsmAnalyzer.java b/tools/layoutlib/create/src/com/android/tools/layoutlib/create/AsmAnalyzer.java
index 3e75c9e..8373e30 100644
--- a/tools/layoutlib/create/src/com/android/tools/layoutlib/create/AsmAnalyzer.java
+++ b/tools/layoutlib/create/src/com/android/tools/layoutlib/create/AsmAnalyzer.java
@@ -32,6 +32,7 @@ import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Enumeration;
+import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
@@ -63,7 +64,8 @@ public class AsmAnalyzer {
private final Set<String> mExcludedClasses;
/** Glob patterns of files to keep as is. */
private final String[] mIncludeFileGlobs;
- /** Copy these files into the output as is. */
+ /** Internal names of classes that contain method calls that need to be rewritten. */
+ private final Set<String> mReplaceMethodCallClasses = new HashSet<String>();
/**
* Creates a new analyzer.
@@ -109,6 +111,7 @@ public class AsmAnalyzer {
mGen.setKeep(found);
mGen.setDeps(deps);
mGen.setCopyFiles(filesFound);
+ mGen.setRewriteMethodCallClasses(mReplaceMethodCallClasses);
}
}
@@ -118,7 +121,7 @@ public class AsmAnalyzer {
*
* @param classes The map of class name => ASM ClassReader. Class names are
* in the form "android.view.View".
- * @param fileFound The map of file name => InputStream. The file name is
+ * @param filesFound The map of file name => InputStream. The file name is
* in the form "android/data/dataFile".
*/
void parseZip(List<String> jarPathList, Map<String, ClassReader> classes,
@@ -143,8 +146,8 @@ public class AsmAnalyzer {
String className = classReaderToClassName(cr);
classes.put(className, cr);
} else {
- for (int i = 0; i < includeFilePatterns.length; ++i) {
- if (includeFilePatterns[i].matcher(entry.getName()).matches()) {
+ for (Pattern includeFilePattern : includeFilePatterns) {
+ if (includeFilePattern.matcher(entry.getName()).matches()) {
filesFound.put(entry.getName(), zip.getInputStream(entry));
break;
}
@@ -321,6 +324,7 @@ public class AsmAnalyzer {
deps, new_deps);
for (ClassReader cr : inOutKeepClasses.values()) {
+ visitor.setClassName(cr.getClassName());
cr.accept(visitor, 0 /* flags */);
}
@@ -367,6 +371,8 @@ public class AsmAnalyzer {
/** New classes to keep as-is found by this visitor. */
private final Map<String, ClassReader> mOutKeep;
+ private String mClassName;
+
/**
* Creates a new visitor that will find all the dependencies for the visited class.
* Types which are already in the zipClasses, keepClasses or inDeps are not marked.
@@ -390,6 +396,10 @@ public class AsmAnalyzer {
mOutDeps = outDeps;
}
+ private void setClassName(String className) {
+ mClassName = className;
+ }
+
/**
* Considers the given class name as a dependency.
* If it does, add to the mOutDeps map.
@@ -429,7 +439,7 @@ public class AsmAnalyzer {
// - android classes are added to dependencies
// - non-android classes are added to the list of classes to keep as-is (they don't need
// to be stubbed).
- if (className.indexOf("android") >= 0) { // TODO make configurable
+ if (className.contains("android")) { // TODO make configurable
mOutDeps.put(className, cr);
} else {
mOutKeep.put(className, cr);
@@ -594,7 +604,7 @@ public class AsmAnalyzer {
// type and exceptions do not use generic types.
considerSignature(signature);
- return new MyMethodVisitor();
+ return new MyMethodVisitor(mClassName);
}
@Override
@@ -614,8 +624,11 @@ public class AsmAnalyzer {
private class MyMethodVisitor extends MethodVisitor {
- public MyMethodVisitor() {
+ private String mOwnerClass;
+
+ public MyMethodVisitor(String ownerClass) {
super(Opcodes.ASM4);
+ mOwnerClass = ownerClass;
}
@@ -709,6 +722,13 @@ public class AsmAnalyzer {
considerName(owner);
// desc is the method's descriptor (see Type).
considerDesc(desc);
+
+
+ // Check if method is java.lang.System.arrayCopy([CI[CII)V
+ if (owner.equals("java/lang/System") && name.equals("arraycopy")
+ && desc.equals("([CI[CII)V")) {
+ mReplaceMethodCallClasses.add(mOwnerClass);
+ }
}
// instruction multianewarray, whatever that is
diff --git a/tools/layoutlib/create/src/com/android/tools/layoutlib/create/AsmGenerator.java b/tools/layoutlib/create/src/com/android/tools/layoutlib/create/AsmGenerator.java
index 207d8ae..c96a143 100644
--- a/tools/layoutlib/create/src/com/android/tools/layoutlib/create/AsmGenerator.java
+++ b/tools/layoutlib/create/src/com/android/tools/layoutlib/create/AsmGenerator.java
@@ -21,7 +21,6 @@ import org.objectweb.asm.ClassVisitor;
import org.objectweb.asm.ClassWriter;
import java.io.ByteArrayOutputStream;
-import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
@@ -55,6 +54,8 @@ public class AsmGenerator {
private Map<String, ClassReader> mDeps;
/** All files that are to be copied as-is. */
private Map<String, InputStream> mCopyFiles;
+ /** All classes where certain method calls need to be rewritten. */
+ private Set<String> mReplaceMethodCallsClasses;
/** Counter of number of classes renamed during transform. */
private int mRenameCount;
/** FQCN Names of the classes to rename: map old-FQCN => new-FQCN */
@@ -133,7 +134,7 @@ public class AsmGenerator {
assert i + 1 < n;
String oldFqcn = binaryToInternalClassName(refactorClasses[i]);
String newFqcn = binaryToInternalClassName(refactorClasses[i + 1]);
- mRefactorClasses.put(oldFqcn, newFqcn);;
+ mRefactorClasses.put(oldFqcn, newFqcn);
}
// create the map of renamed class -> return type of method to delete.
@@ -203,23 +204,12 @@ public class AsmGenerator {
mCopyFiles = copyFiles;
}
- /** Gets the map of classes to output as-is, except if they have native methods */
- public Map<String, ClassReader> getKeep() {
- return mKeep;
- }
-
- /** Gets the map of dependencies that must be completely stubbed */
- public Map<String, ClassReader> getDeps() {
- return mDeps;
- }
-
- /** Gets the map of files to output as-is. */
- public Map<String, InputStream> getCopyFiles() {
- return mCopyFiles;
+ public void setRewriteMethodCallClasses(Set<String> rewriteMethodCallClasses) {
+ mReplaceMethodCallsClasses = rewriteMethodCallClasses;
}
/** Generates the final JAR */
- public void generate() throws FileNotFoundException, IOException {
+ public void generate() throws IOException {
TreeMap<String, byte[]> all = new TreeMap<String, byte[]>();
for (Class<?> clazz : mInjectClasses) {
@@ -329,14 +319,14 @@ public class AsmGenerator {
String newName = transformName(className);
// transformName returns its input argument if there's no need to rename the class
- if (newName != className) {
+ if (!newName.equals(className)) {
mRenameCount++;
// This class is being renamed, so remove it from the list of classes not renamed.
mClassesNotRenamed.remove(className);
}
mLog.debug("Transform %s%s%s%s", className,
- newName == className ? "" : " (renamed to " + newName + ")",
+ newName.equals(className) ? "" : " (renamed to " + newName + ")",
hasNativeMethods ? " -- has natives" : "",
stubNativesOnly ? " -- stub natives only" : "");
@@ -344,8 +334,14 @@ public class AsmGenerator {
// original class reader.
ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS);
- ClassVisitor cv = new RefactorClassAdapter(cw, mRefactorClasses);
- if (newName != className) {
+ ClassVisitor cv = cw;
+
+ if (mReplaceMethodCallsClasses.contains(className)) {
+ cv = new ReplaceMethodCallsAdapter(cv);
+ }
+
+ cv = new RefactorClassAdapter(cv, mRefactorClasses);
+ if (!newName.equals(className)) {
cv = new RenameClassAdapter(cv, className, newName);
}
diff --git a/tools/layoutlib/create/src/com/android/tools/layoutlib/create/Main.java b/tools/layoutlib/create/src/com/android/tools/layoutlib/create/Main.java
index 2e952fc..ad10656 100644
--- a/tools/layoutlib/create/src/com/android/tools/layoutlib/create/Main.java
+++ b/tools/layoutlib/create/src/com/android/tools/layoutlib/create/Main.java
@@ -193,8 +193,7 @@ public class Main {
private static boolean processArgs(Log log, String[] args,
ArrayList<String> osJarPath, String[] osDestJar) {
boolean needs_dest = true;
- for (int i = 0; i < args.length; i++) {
- String s = args[i];
+ for (String s : args) {
if (s.equals("-v")) {
log.setVerbose(true);
} else if (s.equals("-p")) {
@@ -212,7 +211,7 @@ public class Main {
osJarPath.add(s);
}
} else {
- log.error("Unknow argument: %s", s);
+ log.error("Unknown argument: %s", s);
return false;
}
}
diff --git a/tools/layoutlib/create/src/com/android/tools/layoutlib/create/ReplaceMethodCallsAdapter.java b/tools/layoutlib/create/src/com/android/tools/layoutlib/create/ReplaceMethodCallsAdapter.java
new file mode 100644
index 0000000..e57eba1
--- /dev/null
+++ b/tools/layoutlib/create/src/com/android/tools/layoutlib/create/ReplaceMethodCallsAdapter.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.tools.layoutlib.create;
+
+import org.objectweb.asm.ClassVisitor;
+import org.objectweb.asm.MethodVisitor;
+import org.objectweb.asm.Opcodes;
+
+/**
+ * Replaces calls to certain methods that do not exist in the Desktop VM.
+ */
+public class ReplaceMethodCallsAdapter extends ClassVisitor {
+ public ReplaceMethodCallsAdapter(ClassVisitor cv) {
+ super(Opcodes.ASM4, cv);
+ }
+
+ @Override
+ public MethodVisitor visitMethod(int access, String name, String desc, String signature,
+ String[] exceptions) {
+ return new MyMethodVisitor(super.visitMethod(access, name, desc, signature, exceptions));
+ }
+
+ private class MyMethodVisitor extends MethodVisitor {
+
+ public MyMethodVisitor(MethodVisitor mv) {
+ super(Opcodes.ASM4, mv);
+ }
+
+ @Override
+ public void visitMethodInsn(int opcode, String owner, String name, String desc) {
+ // Check if method is java.lang.System.arrayCopy([CI[CII)V
+ if (owner.equals("java/lang/System") && name.equals("arraycopy")
+ && desc.equals("([CI[CII)V")) {
+ desc = "(Ljava/lang/Object;ILjava/lang/Object;II)V";
+ }
+ super.visitMethodInsn(opcode, owner, name, desc);
+ }
+ }
+}