diff options
3 files changed, 15 insertions, 5 deletions
diff --git a/tools/layoutlib/bridge/src/android/graphics/Bitmap_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/Bitmap_Delegate.java index 89d7e23..7016136 100644 --- a/tools/layoutlib/bridge/src/android/graphics/Bitmap_Delegate.java +++ b/tools/layoutlib/bridge/src/android/graphics/Bitmap_Delegate.java @@ -518,7 +518,8 @@ public final class Bitmap_Delegate { } @LayoutlibDelegate - /*package*/ static void nativeSetHasAlpha(long 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); if (delegate == null) { diff --git a/tools/layoutlib/bridge/src/android/graphics/Region_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/Region_Delegate.java index ea23649..d2aae92 100644 --- a/tools/layoutlib/bridge/src/android/graphics/Region_Delegate.java +++ b/tools/layoutlib/bridge/src/android/graphics/Region_Delegate.java @@ -275,21 +275,21 @@ public class Region_Delegate { } @LayoutlibDelegate - /*package*/ static boolean nativeSetRegion(long native_dst, long native_src) { + /*package*/ static void nativeSetRegion(long native_dst, long native_src) { Region_Delegate dstRegion = sManager.getDelegate(native_dst); if (dstRegion == null) { - return true; + return; } Region_Delegate srcRegion = sManager.getDelegate(native_src); if (srcRegion == null) { - return true; + return; } dstRegion.mArea.reset(); dstRegion.mArea.add(srcRegion.mArea); - return true; + return; } @LayoutlibDelegate diff --git a/tools/layoutlib/bridge/tests/src/com/android/layoutlib/bridge/TestDelegates.java b/tools/layoutlib/bridge/tests/src/com/android/layoutlib/bridge/TestDelegates.java index d3218db..7c0bc84 100644 --- a/tools/layoutlib/bridge/tests/src/com/android/layoutlib/bridge/TestDelegates.java +++ b/tools/layoutlib/bridge/tests/src/com/android/layoutlib/bridge/TestDelegates.java @@ -129,6 +129,15 @@ public class TestDelegates extends TestCase { originalClass.getName()), delegateMethod.getAnnotation(LayoutlibDelegate.class)); + // check the return type of the methods match. + assertTrue( + String.format("Delegate method %1$s.%2$s does not match the corresponding " + + "framework method which returns %3$s", + delegateClass.getName(), + getMethodName(delegateMethod), + originalMethod.getReturnType().getName()), + delegateMethod.getReturnType() == originalMethod.getReturnType()); + // check that the method is static assertTrue( String.format( |