am 92b7c67e: Merge "LayoutLib fixes for API 20 [DO NOT MERGE]" into klp-modular-dev

* commit '92b7c67e719fa125a5af368eb9e00f724c88601d':
  LayoutLib fixes for API 20 [DO NOT MERGE]
This commit is contained in:
Deepanshu Gupta
2014-06-12 20:04:12 +00:00
committed by Android Git Automerger
6 changed files with 32 additions and 15 deletions

View File

@@ -344,7 +344,7 @@ public final class Canvas_Delegate {
} }
@LayoutlibDelegate @LayoutlibDelegate
/*package*/ static long native_saveLayer(long nativeCanvas, RectF bounds, /*package*/ static int native_saveLayer(long nativeCanvas, RectF bounds,
long paint, int layerFlags) { long paint, int layerFlags) {
// get the delegate from the native int. // get the delegate from the native int.
Canvas_Delegate canvasDelegate = sManager.getDelegate(nativeCanvas); Canvas_Delegate canvasDelegate = sManager.getDelegate(nativeCanvas);
@@ -361,7 +361,7 @@ public final class Canvas_Delegate {
} }
@LayoutlibDelegate @LayoutlibDelegate
/*package*/ static long native_saveLayer(long nativeCanvas, float l, /*package*/ static int native_saveLayer(long nativeCanvas, float l,
float t, float r, float b, float t, float r, float b,
long paint, int layerFlags) { long paint, int layerFlags) {
// get the delegate from the native int. // get the delegate from the native int.
@@ -380,7 +380,7 @@ public final class Canvas_Delegate {
} }
@LayoutlibDelegate @LayoutlibDelegate
/*package*/ static long native_saveLayerAlpha(long nativeCanvas, /*package*/ static int native_saveLayerAlpha(long nativeCanvas,
RectF bounds, int alpha, RectF bounds, int alpha,
int layerFlags) { int layerFlags) {
// get the delegate from the native int. // get the delegate from the native int.
@@ -393,7 +393,7 @@ public final class Canvas_Delegate {
} }
@LayoutlibDelegate @LayoutlibDelegate
/*package*/ static long native_saveLayerAlpha(long nativeCanvas, float l, /*package*/ static int native_saveLayerAlpha(long nativeCanvas, float l,
float t, float r, float b, float t, float r, float b,
int alpha, int layerFlags) { int alpha, int layerFlags) {
// get the delegate from the native int. // get the delegate from the native int.

View File

@@ -61,7 +61,7 @@ public class LightingColorFilter_Delegate extends ColorFilter_Delegate {
} }
@LayoutlibDelegate @LayoutlibDelegate
/*package*/ static int nCreateLightingFilter(long nativeFilter, int mul, int add) { /*package*/ static long nCreateLightingFilter(long nativeFilter, int mul, int add) {
// pass // pass
return 0; return 0;
} }

View File

@@ -688,7 +688,7 @@ public class Paint_Delegate {
} }
@LayoutlibDelegate @LayoutlibDelegate
/*package*/ static long native_getStyle(long native_object) { /*package*/ static int native_getStyle(long native_object) {
// get the delegate from the native int. // get the delegate from the native int.
Paint_Delegate delegate = sManager.getDelegate(native_object); Paint_Delegate delegate = sManager.getDelegate(native_object);
if (delegate == null) { if (delegate == null) {
@@ -710,7 +710,7 @@ public class Paint_Delegate {
} }
@LayoutlibDelegate @LayoutlibDelegate
/*package*/ static long native_getStrokeCap(long native_object) { /*package*/ static int native_getStrokeCap(long native_object) {
// get the delegate from the native int. // get the delegate from the native int.
Paint_Delegate delegate = sManager.getDelegate(native_object); Paint_Delegate delegate = sManager.getDelegate(native_object);
if (delegate == null) { if (delegate == null) {
@@ -732,7 +732,7 @@ public class Paint_Delegate {
} }
@LayoutlibDelegate @LayoutlibDelegate
/*package*/ static long native_getStrokeJoin(long native_object) { /*package*/ static int native_getStrokeJoin(long native_object) {
// get the delegate from the native int. // get the delegate from the native int.
Paint_Delegate delegate = sManager.getDelegate(native_object); Paint_Delegate delegate = sManager.getDelegate(native_object);
if (delegate == null) { if (delegate == null) {
@@ -889,7 +889,7 @@ public class Paint_Delegate {
} }
@LayoutlibDelegate @LayoutlibDelegate
/*package*/ static long native_getTextAlign(long native_object) { /*package*/ static int native_getTextAlign(long native_object) {
// get the delegate from the native int. // get the delegate from the native int.
Paint_Delegate delegate = sManager.getDelegate(native_object); Paint_Delegate delegate = sManager.getDelegate(native_object);
if (delegate == null) { if (delegate == null) {
@@ -922,7 +922,7 @@ public class Paint_Delegate {
} }
@LayoutlibDelegate @LayoutlibDelegate
/*package*/ static long native_getTextWidths(long native_object, char[] text, int index, /*package*/ static int native_getTextWidths(long native_object, char[] text, int index,
int count, int bidiFlags, float[] widths) { int count, int bidiFlags, float[] widths) {
// get the delegate from the native int. // get the delegate from the native int.
Paint_Delegate delegate = sManager.getDelegate(native_object); Paint_Delegate delegate = sManager.getDelegate(native_object);
@@ -964,14 +964,14 @@ public class Paint_Delegate {
} }
@LayoutlibDelegate @LayoutlibDelegate
/*package*/ static long native_getTextWidths(long native_object, String text, int start, /*package*/ static int native_getTextWidths(long native_object, String text, int start,
int end, int bidiFlags, float[] widths) { int end, int bidiFlags, float[] widths) {
return native_getTextWidths(native_object, text.toCharArray(), start, end - start, return native_getTextWidths(native_object, text.toCharArray(), start, end - start,
bidiFlags, widths); bidiFlags, widths);
} }
@LayoutlibDelegate @LayoutlibDelegate
/* package */static long native_getTextGlyphs(long native_object, String text, int start, /* package */static int native_getTextGlyphs(long native_object, String text, int start,
int end, int contextStart, int contextEnd, int flags, char[] glyphs) { int end, int contextStart, int contextEnd, int flags, char[] glyphs) {
// FIXME // FIXME
return 0; return 0;
@@ -1012,7 +1012,7 @@ public class Paint_Delegate {
} }
@LayoutlibDelegate @LayoutlibDelegate
/*package*/ static long native_getTextRunCursor(Paint thisPaint, long native_object, char[] text, /*package*/ static int native_getTextRunCursor(Paint thisPaint, long native_object, char[] text,
int contextStart, int contextLength, int flags, int offset, int cursorOpt) { int contextStart, int contextLength, int flags, int offset, int cursorOpt) {
// FIXME // FIXME
Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED, Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
@@ -1021,7 +1021,7 @@ public class Paint_Delegate {
} }
@LayoutlibDelegate @LayoutlibDelegate
/*package*/ static long native_getTextRunCursor(Paint thisPaint, long native_object, String text, /*package*/ static int native_getTextRunCursor(Paint thisPaint, long native_object, String text,
int contextStart, int contextEnd, int flags, int offset, int cursorOpt) { int contextStart, int contextEnd, int flags, int offset, int cursorOpt) {
// FIXME // FIXME
Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED, Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,

View File

@@ -142,7 +142,7 @@ public final class Path_Delegate {
} }
@LayoutlibDelegate @LayoutlibDelegate
/*package*/ static long native_getFillType(long nPath) { /*package*/ static int native_getFillType(long nPath) {
Path_Delegate pathDelegate = sManager.getDelegate(nPath); Path_Delegate pathDelegate = sManager.getDelegate(nPath);
if (pathDelegate == null) { if (pathDelegate == null) {
return 0; return 0;

View File

@@ -58,6 +58,7 @@ import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory; import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.graphics.Bitmap; import android.graphics.Bitmap;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.hardware.display.DisplayManager;
import android.net.Uri; import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
@@ -101,6 +102,7 @@ public final class BridgeContext extends Context {
private final ApplicationInfo mApplicationInfo; private final ApplicationInfo mApplicationInfo;
private final IProjectCallback mProjectCallback; private final IProjectCallback mProjectCallback;
private final WindowManager mWindowManager; private final WindowManager mWindowManager;
private final DisplayManager mDisplayManager;
private Resources.Theme mTheme; private Resources.Theme mTheme;
@@ -149,6 +151,7 @@ public final class BridgeContext extends Context {
} }
mWindowManager = new WindowManagerImpl(mMetrics); mWindowManager = new WindowManagerImpl(mMetrics);
mDisplayManager = new DisplayManager(this);
} }
/** /**
@@ -455,6 +458,10 @@ public final class BridgeContext extends Context {
return new PowerManager(this, new BridgePowerManager(), new Handler()); return new PowerManager(this, new BridgePowerManager(), new Handler());
} }
if (DISPLAY_SERVICE.equals(service)) {
return mDisplayManager;
}
throw new UnsupportedOperationException("Unsupported Service: " + service); throw new UnsupportedOperationException("Unsupported Service: " + service);
} }

View File

@@ -172,6 +172,16 @@ public class ICU_Delegate {
} }
@LayoutlibDelegate
/*package*/ static String localeForLanguageTag(String languageTag, boolean strict) {
return "";
}
@LayoutlibDelegate
/*package*/ static String languageTagForLocale(String locale) {
return "";
}
@LayoutlibDelegate @LayoutlibDelegate
/*package*/ static String localeForLanguageTag(String languageTag, boolean strict) { /*package*/ static String localeForLanguageTag(String languageTag, boolean strict) {
return ""; return "";