diff options
author | Xavier Ducrohet <xav@android.com> | 2011-02-09 17:17:49 -0800 |
---|---|---|
committer | Xavier Ducrohet <xav@android.com> | 2011-02-09 17:29:29 -0800 |
commit | 9a4fe29c8d92014d2d9a848e9116b8cc9d0842f9 (patch) | |
tree | 97d83ce52c0a5cffaa82be0bae9919f112acd7c9 /tools/layoutlib/bridge/src/android/view | |
parent | e18457fbef2ef8b74fb6d7a023b5a6fe4a707bed (diff) | |
download | frameworks_base-9a4fe29c8d92014d2d9a848e9116b8cc9d0842f9.zip frameworks_base-9a4fe29c8d92014d2d9a848e9116b8cc9d0842f9.tar.gz frameworks_base-9a4fe29c8d92014d2d9a848e9116b8cc9d0842f9.tar.bz2 |
LayoutLib: Annotate the custom delegate methods.
Every method implementing a delegate needed by the
layoutlib_create bytecode modification must now be
annotated with LayoutlibDelegate.
The methods in the original source code that are delegated
are already automatically annotated. Now with the implementations
being annotated we can do bi-directional tests and find not
only missing implementations but also dead obsolete code.
This will be useful when backporting to earlier versions of
Android, or when native (non public) method disappear. In fact,
the new test detected one such method in Shader.
Change-Id: I491708b68ac2736ca5669aa86cd5e930a00f9db3
Diffstat (limited to 'tools/layoutlib/bridge/src/android/view')
-rw-r--r-- | tools/layoutlib/bridge/src/android/view/LayoutInflater_Delegate.java | 2 | ||||
-rw-r--r-- | tools/layoutlib/bridge/src/android/view/View_Delegate.java | 3 |
2 files changed, 5 insertions, 0 deletions
diff --git a/tools/layoutlib/bridge/src/android/view/LayoutInflater_Delegate.java b/tools/layoutlib/bridge/src/android/view/LayoutInflater_Delegate.java index 3946a2f..0f3cf57 100644 --- a/tools/layoutlib/bridge/src/android/view/LayoutInflater_Delegate.java +++ b/tools/layoutlib/bridge/src/android/view/LayoutInflater_Delegate.java @@ -17,6 +17,7 @@ package android.view; import com.android.layoutlib.bridge.android.BridgeInflater; +import com.android.tools.layoutlib.annotations.LayoutlibDelegate; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; @@ -38,6 +39,7 @@ public class LayoutInflater_Delegate { * Recursive method used to descend down the xml hierarchy and instantiate * views, instantiate their children, and then call onFinishInflate(). */ + @LayoutlibDelegate /*package*/ static void rInflate(LayoutInflater thisInflater, XmlPullParser parser, View parent, final AttributeSet attrs, boolean finishInflate) throws XmlPullParserException, IOException { diff --git a/tools/layoutlib/bridge/src/android/view/View_Delegate.java b/tools/layoutlib/bridge/src/android/view/View_Delegate.java index ee6694c..8215f7c 100644 --- a/tools/layoutlib/bridge/src/android/view/View_Delegate.java +++ b/tools/layoutlib/bridge/src/android/view/View_Delegate.java @@ -16,6 +16,8 @@ package android.view; +import com.android.tools.layoutlib.annotations.LayoutlibDelegate; + /** * Delegate used to provide new implementation of a select few methods of {@link View} * @@ -25,6 +27,7 @@ package android.view; */ public class View_Delegate { + @LayoutlibDelegate /*package*/ static boolean isInEditMode(View thisView) { return true; } |