summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDeepanshu Gupta <deepanshu@google.com>2015-01-05 23:33:06 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-01-05 23:33:06 +0000
commite69e4f8b4db142f024e170cf6faabb36095799b7 (patch)
tree97c58b3086fdf036779046e40f9535864f621e4d
parent8c686ddd540f3a15cdba4893f104c0e8e9af5716 (diff)
parentf9bb0b5e133b0c364c3f87623f0fdff0fedc5226 (diff)
downloadframeworks_base-e69e4f8b4db142f024e170cf6faabb36095799b7.zip
frameworks_base-e69e4f8b4db142f024e170cf6faabb36095799b7.tar.gz
frameworks_base-e69e4f8b4db142f024e170cf6faabb36095799b7.tar.bz2
am f9bb0b5e: Merge "Fix DatePicker rendering." into lmp-dev
* commit 'f9bb0b5e133b0c364c3f87623f0fdff0fedc5226': Fix DatePicker rendering.
-rw-r--r--tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java28
1 files changed, 18 insertions, 10 deletions
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 c41ebb9..8523f1a 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
@@ -73,6 +73,7 @@ import android.view.DisplayAdjustments;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
+import android.view.accessibility.AccessibilityManager;
import android.view.textservice.TextServicesManager;
import java.io.File;
@@ -476,6 +477,10 @@ public final class BridgeContext extends Context {
return mDisplayManager;
}
+ if (ACCESSIBILITY_SERVICE.equals(service)) {
+ return AccessibilityManager.getInstance(this);
+ }
+
throw new UnsupportedOperationException("Unsupported Service: " + service);
}
@@ -491,19 +496,22 @@ public final class BridgeContext extends Context {
@Override
public final BridgeTypedArray obtainStyledAttributes(int resid, int[] attrs)
throws Resources.NotFoundException {
+ StyleResourceValue style = null;
// get the StyleResourceValue based on the resId;
- StyleResourceValue style = getStyleByDynamicId(resid);
-
- if (style == null) {
- // In some cases, style may not be a dynamic id, so we do a full search.
- ResourceReference ref = resolveId(resid);
- if (ref != null) {
- style = mRenderResources.getStyle(ref.getName(), ref.isFramework());
+ if (resid != 0) {
+ style = getStyleByDynamicId(resid);
+
+ if (style == null) {
+ // In some cases, style may not be a dynamic id, so we do a full search.
+ ResourceReference ref = resolveId(resid);
+ if (ref != null) {
+ style = mRenderResources.getStyle(ref.getName(), ref.isFramework());
+ }
}
- }
- if (style == null) {
- throw new Resources.NotFoundException();
+ if (style == null) {
+ throw new Resources.NotFoundException();
+ }
}
if (mTypedArrayCache == null) {