summaryrefslogtreecommitdiff
path: root/core/java/android/widget/RemoteViews.java
diff options
context:
space:
mode:
authorGilles Debunne <debunne@google.com>2010-06-16 18:32:00 -0700
committerGilles Debunne <debunne@google.com>2010-06-16 18:38:13 -0700
commit3030193dc179b3010f2dd3bffe9c1dec54da38fc (patch)
treee9c52a7df9fb0fd7710423aff21f87cd464e3cc7 /core/java/android/widget/RemoteViews.java
parent2f7a247c921ad1b86b7ba79cdb0431233827ad57 (diff)
Removed warnings in LayoutInflater.
These changes are similar to those of CL 49296. They do not include the generic fixes done on GenericInflater.java, which had issues and broke the build. Added a asSubClass method in LayoutInflater which will (correctly) throw a ClassCastException when the inflated class is not a View subclass. Performance testing on these changes showed a 10% performance improvement, which is still to be explained. Change-Id: Id4d3b45f0945baccdbbda15fcce095e855b23c9a
Diffstat (limited to 'core/java/android/widget/RemoteViews.java')
-rw-r--r--core/java/android/widget/RemoteViews.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/core/java/android/widget/RemoteViews.java b/core/java/android/widget/RemoteViews.java
index 7a70c808293b..f1b05e24c4b8 100644
--- a/core/java/android/widget/RemoteViews.java
+++ b/core/java/android/widget/RemoteViews.java
@@ -60,12 +60,12 @@ public class RemoteViews implements Parcelable, Filter {
* The package name of the package containing the layout
* resource. (Added to the parcel)
*/
- private String mPackage;
+ private final String mPackage;
/**
* The resource ID of the layout file. (Added to the parcel)
*/
- private int mLayoutId;
+ private final int mLayoutId;
/**
* An array of actions to perform on the view tree once it has been
@@ -569,6 +569,7 @@ public class RemoteViews implements Parcelable, Filter {
}
}
+ @Override
public RemoteViews clone() {
final RemoteViews that = new RemoteViews(mPackage, mLayoutId);
if (mActions != null) {
@@ -989,7 +990,7 @@ public class RemoteViews implements Parcelable, Filter {
*
* @see android.view.LayoutInflater.Filter#onLoadClass(java.lang.Class)
*/
- public boolean onLoadClass(Class clazz) {
+ public boolean onLoadClass(Class<?> clazz) {
return clazz.isAnnotationPresent(RemoteView.class);
}