Merge "Avoid warnings about synthesized IDs." into jb-mr2-dev

This commit is contained in:
Jeff Sharkey
2013-03-15 21:47:58 +00:00
committed by Android (Google) Code Review
2 changed files with 15 additions and 2 deletions

View File

@@ -1738,6 +1738,15 @@ public class Resources {
return mAssets.getResourceIdentifier(name, defType, defPackage);
}
/**
* Return true if given resource identifier includes a package.
*
* @hide
*/
public static boolean resourceHasPackage(int resid) {
return (resid >>> 24) != 0;
}
/**
* Return the full name for a given resource identifier. This name is
* a single string of the form "package:type/entry".

View File

@@ -5038,7 +5038,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
}
if ((mAttachInfo.mAccessibilityFetchFlags
& AccessibilityNodeInfo.FLAG_REPORT_VIEW_IDS) != 0) {
& AccessibilityNodeInfo.FLAG_REPORT_VIEW_IDS) != 0
&& Resources.resourceHasPackage(mID)) {
try {
String viewId = getResources().getResourceName(mID);
info.setViewIdResourceName(viewId);
@@ -11553,7 +11554,10 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
final int scrollY = mScrollY;
final int inside = (viewFlags & SCROLLBARS_OUTSIDE_MASK) == 0 ? ~0 : 0;
int left, top, right, bottom;
int left;
int top;
int right;
int bottom;
if (drawHorizontalScrollBar) {
int size = scrollBar.getSize(false);