Merge "Replace left/right with start/end for Gravity / LayoutParams / Padding"
diff --git a/api/current.txt b/api/current.txt
index 31bb0b8e..6b6b127 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -607,12 +607,16 @@
field public static final int layout_above = 16843140; // 0x1010184
field public static final int layout_alignBaseline = 16843142; // 0x1010186
field public static final int layout_alignBottom = 16843146; // 0x101018a
+ field public static final int layout_alignEnd = 16843706; // 0x10103ba
field public static final int layout_alignLeft = 16843143; // 0x1010187
field public static final int layout_alignParentBottom = 16843150; // 0x101018e
+ field public static final int layout_alignParentEnd = 16843708; // 0x10103bc
field public static final int layout_alignParentLeft = 16843147; // 0x101018b
field public static final int layout_alignParentRight = 16843149; // 0x101018d
+ field public static final int layout_alignParentStart = 16843707; // 0x10103bb
field public static final int layout_alignParentTop = 16843148; // 0x101018c
field public static final int layout_alignRight = 16843145; // 0x1010189
+ field public static final int layout_alignStart = 16843705; // 0x10103b9
field public static final int layout_alignTop = 16843144; // 0x1010188
field public static final int layout_alignWithParentIfMissing = 16843154; // 0x1010192
field public static final int layout_below = 16843141; // 0x1010185
@@ -634,8 +638,10 @@
field public static final int layout_rowSpan = 16843644; // 0x101037c
field public static final int layout_scale = 16843155; // 0x1010193
field public static final int layout_span = 16843085; // 0x101014d
+ field public static final int layout_toEndOf = 16843704; // 0x10103b8
field public static final int layout_toLeftOf = 16843138; // 0x1010182
field public static final int layout_toRightOf = 16843139; // 0x1010183
+ field public static final int layout_toStartOf = 16843703; // 0x10103b7
field public static final int layout_weight = 16843137; // 0x1010181
field public static final int layout_width = 16842996; // 0x10100f4
field public static final int layout_x = 16843135; // 0x101017f
@@ -10504,6 +10510,7 @@
method public float getAccuracy();
method public double getAltitude();
method public float getBearing();
+ method public long getElapsedRealtimeNano();
method public android.os.Bundle getExtras();
method public double getLatitude();
method public double getLongitude();
@@ -10523,6 +10530,7 @@
method public void setAccuracy(float);
method public void setAltitude(double);
method public void setBearing(float);
+ method public void setElapsedRealtimeNano(long);
method public void setExtras(android.os.Bundle);
method public void setLatitude(double);
method public void setLongitude(double);
@@ -13765,6 +13773,174 @@
package android.opengl {
+ public class EGL14 {
+ ctor public EGL14();
+ method public static boolean eglBindAPI(int);
+ method public static boolean eglBindTexImage(android.opengl.EGLDisplay, android.opengl.EGLSurface, int);
+ method public static boolean eglChooseConfig(android.opengl.EGLDisplay, int[], int, android.opengl.EGLConfig[], int, int, int[], int);
+ method public static boolean eglCopyBuffers(android.opengl.EGLDisplay, android.opengl.EGLSurface, int);
+ method public static android.opengl.EGLContext eglCreateContext(android.opengl.EGLDisplay, android.opengl.EGLConfig, android.opengl.EGLContext, int[], int);
+ method public static android.opengl.EGLSurface eglCreatePbufferFromClientBuffer(android.opengl.EGLDisplay, int, int, android.opengl.EGLConfig, int[], int);
+ method public static android.opengl.EGLSurface eglCreatePbufferSurface(android.opengl.EGLDisplay, android.opengl.EGLConfig, int[], int);
+ method public static android.opengl.EGLSurface eglCreatePixmapSurface(android.opengl.EGLDisplay, android.opengl.EGLConfig, int, int[], int);
+ method public static android.opengl.EGLSurface eglCreateWindowSurface(android.opengl.EGLDisplay, android.opengl.EGLConfig, java.lang.Object, int[], int);
+ method public static boolean eglDestroyContext(android.opengl.EGLDisplay, android.opengl.EGLContext);
+ method public static boolean eglDestroySurface(android.opengl.EGLDisplay, android.opengl.EGLSurface);
+ method public static boolean eglGetConfigAttrib(android.opengl.EGLDisplay, android.opengl.EGLConfig, int, int[], int);
+ method public static boolean eglGetConfigs(android.opengl.EGLDisplay, android.opengl.EGLConfig[], int, int, int[], int);
+ method public static android.opengl.EGLContext eglGetCurrentContext();
+ method public static android.opengl.EGLDisplay eglGetCurrentDisplay();
+ method public static android.opengl.EGLSurface eglGetCurrentSurface(int);
+ method public static android.opengl.EGLDisplay eglGetDisplay(int);
+ method public static int eglGetError();
+ method public static boolean eglInitialize(android.opengl.EGLDisplay, int[], int, int[], int);
+ method public static boolean eglMakeCurrent(android.opengl.EGLDisplay, android.opengl.EGLSurface, android.opengl.EGLSurface, android.opengl.EGLContext);
+ method public static int eglQueryAPI();
+ method public static boolean eglQueryContext(android.opengl.EGLDisplay, android.opengl.EGLContext, int, int[], int);
+ method public static java.lang.String eglQueryString(android.opengl.EGLDisplay, int);
+ method public static boolean eglQuerySurface(android.opengl.EGLDisplay, android.opengl.EGLSurface, int, int[], int);
+ method public static boolean eglReleaseTexImage(android.opengl.EGLDisplay, android.opengl.EGLSurface, int);
+ method public static boolean eglReleaseThread();
+ method public static boolean eglSurfaceAttrib(android.opengl.EGLDisplay, android.opengl.EGLSurface, int, int);
+ method public static boolean eglSwapBuffers(android.opengl.EGLDisplay, android.opengl.EGLSurface);
+ method public static boolean eglSwapInterval(android.opengl.EGLDisplay, int);
+ method public static boolean eglTerminate(android.opengl.EGLDisplay);
+ method public static boolean eglWaitClient();
+ method public static boolean eglWaitGL();
+ method public static boolean eglWaitNative(int);
+ field public static final int EGL_ALPHA_MASK_SIZE = 12350; // 0x303e
+ field public static final int EGL_ALPHA_SIZE = 12321; // 0x3021
+ field public static final int EGL_BACK_BUFFER = 12420; // 0x3084
+ field public static final int EGL_BAD_ACCESS = 12290; // 0x3002
+ field public static final int EGL_BAD_ALLOC = 12291; // 0x3003
+ field public static final int EGL_BAD_ATTRIBUTE = 12292; // 0x3004
+ field public static final int EGL_BAD_CONFIG = 12293; // 0x3005
+ field public static final int EGL_BAD_CONTEXT = 12294; // 0x3006
+ field public static final int EGL_BAD_CURRENT_SURFACE = 12295; // 0x3007
+ field public static final int EGL_BAD_DISPLAY = 12296; // 0x3008
+ field public static final int EGL_BAD_MATCH = 12297; // 0x3009
+ field public static final int EGL_BAD_NATIVE_PIXMAP = 12298; // 0x300a
+ field public static final int EGL_BAD_NATIVE_WINDOW = 12299; // 0x300b
+ field public static final int EGL_BAD_PARAMETER = 12300; // 0x300c
+ field public static final int EGL_BAD_SURFACE = 12301; // 0x300d
+ field public static final int EGL_BIND_TO_TEXTURE_RGB = 12345; // 0x3039
+ field public static final int EGL_BIND_TO_TEXTURE_RGBA = 12346; // 0x303a
+ field public static final int EGL_BLUE_SIZE = 12322; // 0x3022
+ field public static final int EGL_BUFFER_DESTROYED = 12437; // 0x3095
+ field public static final int EGL_BUFFER_PRESERVED = 12436; // 0x3094
+ field public static final int EGL_BUFFER_SIZE = 12320; // 0x3020
+ field public static final int EGL_CLIENT_APIS = 12429; // 0x308d
+ field public static final int EGL_COLOR_BUFFER_TYPE = 12351; // 0x303f
+ field public static final int EGL_CONFIG_CAVEAT = 12327; // 0x3027
+ field public static final int EGL_CONFIG_ID = 12328; // 0x3028
+ field public static final int EGL_CONFORMANT = 12354; // 0x3042
+ field public static final int EGL_CONTEXT_CLIENT_TYPE = 12439; // 0x3097
+ field public static final int EGL_CONTEXT_CLIENT_VERSION = 12440; // 0x3098
+ field public static final int EGL_CONTEXT_LOST = 12302; // 0x300e
+ field public static final int EGL_CORE_NATIVE_ENGINE = 12379; // 0x305b
+ field public static final int EGL_DEFAULT_DISPLAY = 0; // 0x0
+ field public static final int EGL_DEPTH_SIZE = 12325; // 0x3025
+ field public static final int EGL_DISPLAY_SCALING = 10000; // 0x2710
+ field public static final int EGL_DRAW = 12377; // 0x3059
+ field public static final int EGL_EXTENSIONS = 12373; // 0x3055
+ field public static final int EGL_FALSE = 0; // 0x0
+ field public static final int EGL_GREEN_SIZE = 12323; // 0x3023
+ field public static final int EGL_HEIGHT = 12374; // 0x3056
+ field public static final int EGL_HORIZONTAL_RESOLUTION = 12432; // 0x3090
+ field public static final int EGL_LARGEST_PBUFFER = 12376; // 0x3058
+ field public static final int EGL_LEVEL = 12329; // 0x3029
+ field public static final int EGL_LUMINANCE_BUFFER = 12431; // 0x308f
+ field public static final int EGL_LUMINANCE_SIZE = 12349; // 0x303d
+ field public static final int EGL_MATCH_NATIVE_PIXMAP = 12353; // 0x3041
+ field public static final int EGL_MAX_PBUFFER_HEIGHT = 12330; // 0x302a
+ field public static final int EGL_MAX_PBUFFER_PIXELS = 12331; // 0x302b
+ field public static final int EGL_MAX_PBUFFER_WIDTH = 12332; // 0x302c
+ field public static final int EGL_MAX_SWAP_INTERVAL = 12348; // 0x303c
+ field public static final int EGL_MIN_SWAP_INTERVAL = 12347; // 0x303b
+ field public static final int EGL_MIPMAP_LEVEL = 12419; // 0x3083
+ field public static final int EGL_MIPMAP_TEXTURE = 12418; // 0x3082
+ field public static final int EGL_MULTISAMPLE_RESOLVE = 12441; // 0x3099
+ field public static final int EGL_MULTISAMPLE_RESOLVE_BOX = 12443; // 0x309b
+ field public static final int EGL_MULTISAMPLE_RESOLVE_BOX_BIT = 512; // 0x200
+ field public static final int EGL_MULTISAMPLE_RESOLVE_DEFAULT = 12442; // 0x309a
+ field public static final int EGL_NATIVE_RENDERABLE = 12333; // 0x302d
+ field public static final int EGL_NATIVE_VISUAL_ID = 12334; // 0x302e
+ field public static final int EGL_NATIVE_VISUAL_TYPE = 12335; // 0x302f
+ field public static final int EGL_NONE = 12344; // 0x3038
+ field public static final int EGL_NON_CONFORMANT_CONFIG = 12369; // 0x3051
+ field public static final int EGL_NOT_INITIALIZED = 12289; // 0x3001
+ field public static android.opengl.EGLContext EGL_NO_CONTEXT;
+ field public static android.opengl.EGLDisplay EGL_NO_DISPLAY;
+ field public static android.opengl.EGLSurface EGL_NO_SURFACE;
+ field public static final int EGL_NO_TEXTURE = 12380; // 0x305c
+ field public static final int EGL_OPENGL_API = 12450; // 0x30a2
+ field public static final int EGL_OPENGL_BIT = 8; // 0x8
+ field public static final int EGL_OPENGL_ES2_BIT = 4; // 0x4
+ field public static final int EGL_OPENGL_ES_API = 12448; // 0x30a0
+ field public static final int EGL_OPENGL_ES_BIT = 1; // 0x1
+ field public static final int EGL_OPENVG_API = 12449; // 0x30a1
+ field public static final int EGL_OPENVG_BIT = 2; // 0x2
+ field public static final int EGL_OPENVG_IMAGE = 12438; // 0x3096
+ field public static final int EGL_PBUFFER_BIT = 1; // 0x1
+ field public static final int EGL_PIXEL_ASPECT_RATIO = 12434; // 0x3092
+ field public static final int EGL_PIXMAP_BIT = 2; // 0x2
+ field public static final int EGL_READ = 12378; // 0x305a
+ field public static final int EGL_RED_SIZE = 12324; // 0x3024
+ field public static final int EGL_RENDERABLE_TYPE = 12352; // 0x3040
+ field public static final int EGL_RENDER_BUFFER = 12422; // 0x3086
+ field public static final int EGL_RGB_BUFFER = 12430; // 0x308e
+ field public static final int EGL_SAMPLES = 12337; // 0x3031
+ field public static final int EGL_SAMPLE_BUFFERS = 12338; // 0x3032
+ field public static final int EGL_SINGLE_BUFFER = 12421; // 0x3085
+ field public static final int EGL_SLOW_CONFIG = 12368; // 0x3050
+ field public static final int EGL_STENCIL_SIZE = 12326; // 0x3026
+ field public static final int EGL_SUCCESS = 12288; // 0x3000
+ field public static final int EGL_SURFACE_TYPE = 12339; // 0x3033
+ field public static final int EGL_SWAP_BEHAVIOR = 12435; // 0x3093
+ field public static final int EGL_SWAP_BEHAVIOR_PRESERVED_BIT = 1024; // 0x400
+ field public static final int EGL_TEXTURE_2D = 12383; // 0x305f
+ field public static final int EGL_TEXTURE_FORMAT = 12416; // 0x3080
+ field public static final int EGL_TEXTURE_RGB = 12381; // 0x305d
+ field public static final int EGL_TEXTURE_RGBA = 12382; // 0x305e
+ field public static final int EGL_TEXTURE_TARGET = 12417; // 0x3081
+ field public static final int EGL_TRANSPARENT_BLUE_VALUE = 12341; // 0x3035
+ field public static final int EGL_TRANSPARENT_GREEN_VALUE = 12342; // 0x3036
+ field public static final int EGL_TRANSPARENT_RED_VALUE = 12343; // 0x3037
+ field public static final int EGL_TRANSPARENT_RGB = 12370; // 0x3052
+ field public static final int EGL_TRANSPARENT_TYPE = 12340; // 0x3034
+ field public static final int EGL_TRUE = 1; // 0x1
+ field public static final int EGL_VENDOR = 12371; // 0x3053
+ field public static final int EGL_VERSION = 12372; // 0x3054
+ field public static final int EGL_VERTICAL_RESOLUTION = 12433; // 0x3091
+ field public static final int EGL_VG_ALPHA_FORMAT = 12424; // 0x3088
+ field public static final int EGL_VG_ALPHA_FORMAT_NONPRE = 12427; // 0x308b
+ field public static final int EGL_VG_ALPHA_FORMAT_PRE = 12428; // 0x308c
+ field public static final int EGL_VG_ALPHA_FORMAT_PRE_BIT = 64; // 0x40
+ field public static final int EGL_VG_COLORSPACE = 12423; // 0x3087
+ field public static final int EGL_VG_COLORSPACE_LINEAR = 12426; // 0x308a
+ field public static final int EGL_VG_COLORSPACE_LINEAR_BIT = 32; // 0x20
+ field public static final int EGL_VG_COLORSPACE_sRGB = 12425; // 0x3089
+ field public static final int EGL_WIDTH = 12375; // 0x3057
+ field public static final int EGL_WINDOW_BIT = 4; // 0x4
+ }
+
+ public class EGLConfig extends android.opengl.EGLObjectHandle {
+ }
+
+ public class EGLContext extends android.opengl.EGLObjectHandle {
+ }
+
+ public class EGLDisplay extends android.opengl.EGLObjectHandle {
+ }
+
+ public abstract class EGLObjectHandle {
+ ctor protected EGLObjectHandle(int);
+ method public int getHandle();
+ }
+
+ public class EGLSurface extends android.opengl.EGLObjectHandle {
+ }
+
public class ETC1 {
ctor public ETC1();
method public static void decodeBlock(java.nio.Buffer, java.nio.Buffer);
@@ -14672,8 +14848,12 @@
method public static void glGenerateMipmap(int);
method public static void glGetActiveAttrib(int, int, int, int[], int, int[], int, int[], int, byte[], int);
method public static void glGetActiveAttrib(int, int, int, java.nio.IntBuffer, java.nio.IntBuffer, java.nio.IntBuffer, byte);
+ method public static java.lang.String glGetActiveAttrib(int, int, int[], int, int[], int);
+ method public static java.lang.String glGetActiveAttrib(int, int, java.nio.IntBuffer, java.nio.IntBuffer);
method public static void glGetActiveUniform(int, int, int, int[], int, int[], int, int[], int, byte[], int);
method public static void glGetActiveUniform(int, int, int, java.nio.IntBuffer, java.nio.IntBuffer, java.nio.IntBuffer, byte);
+ method public static java.lang.String glGetActiveUniform(int, int, int[], int, int[], int);
+ method public static java.lang.String glGetActiveUniform(int, int, java.nio.IntBuffer, java.nio.IntBuffer);
method public static void glGetAttachedShaders(int, int, int[], int, int[], int);
method public static void glGetAttachedShaders(int, int, java.nio.IntBuffer, java.nio.IntBuffer);
method public static int glGetAttribLocation(int, java.lang.String);
@@ -14698,6 +14878,7 @@
method public static void glGetShaderPrecisionFormat(int, int, java.nio.IntBuffer, java.nio.IntBuffer);
method public static void glGetShaderSource(int, int, int[], int, byte[], int);
method public static void glGetShaderSource(int, int, java.nio.IntBuffer, byte);
+ method public static java.lang.String glGetShaderSource(int);
method public static void glGetShaderiv(int, int, int[], int);
method public static void glGetShaderiv(int, int, java.nio.IntBuffer);
method public static java.lang.String glGetString(int);
@@ -16174,6 +16355,7 @@
public final class SystemClock {
method public static long currentThreadTimeMillis();
method public static long elapsedRealtime();
+ method public static long elapsedRealtimeNano();
method public static boolean setCurrentTimeMillis(long);
method public static void sleep(long);
method public static long uptimeMillis();
@@ -22655,6 +22837,17 @@
method public void set(T, V);
}
+ public class PropertyValueModel extends android.util.ValueModel {
+ method public T get();
+ method public H getHost();
+ method public android.util.Property<H, T> getProperty();
+ method public java.lang.Class<T> getType();
+ method public static android.util.PropertyValueModel<H, T> of(H, android.util.Property<H, T>);
+ method public static android.util.PropertyValueModel<H, T> of(H, java.lang.Class<T>, java.lang.String);
+ method public static android.util.PropertyValueModel of(java.lang.Object, java.lang.String);
+ method public void set(T);
+ }
+
public class SparseArray implements java.lang.Cloneable {
ctor public SparseArray();
ctor public SparseArray(int);
@@ -22803,6 +22996,14 @@
field public int type;
}
+ public abstract class ValueModel {
+ ctor protected ValueModel();
+ method public abstract T get();
+ method public abstract java.lang.Class<T> getType();
+ method public abstract void set(T);
+ field public static final android.util.ValueModel EMPTY;
+ }
+
public class Xml {
method public static android.util.AttributeSet asAttributeSet(org.xmlpull.v1.XmlPullParser);
method public static android.util.Xml.Encoding findEncodingByName(java.lang.String) throws java.io.UnsupportedEncodingException;
@@ -24901,9 +25102,12 @@
ctor public ViewGroup.MarginLayoutParams(int, int);
ctor public ViewGroup.MarginLayoutParams(android.view.ViewGroup.MarginLayoutParams);
ctor public ViewGroup.MarginLayoutParams(android.view.ViewGroup.LayoutParams);
+ method public int getLayoutDirection();
method public int getMarginEnd();
method public int getMarginStart();
+ method protected boolean isLayoutRtl();
method public boolean isMarginRelative();
+ method public void setLayoutDirection(int);
method public void setMargins(int, int, int, int);
field public int bottomMargin;
field public int endMargin;
@@ -26444,6 +26648,7 @@
method public boolean getLightTouchEnabled();
method public boolean getLoadWithOverviewMode();
method public synchronized boolean getLoadsImagesAutomatically();
+ method public boolean getMediaPlaybackRequiresUserGesture();
method public synchronized int getMinimumFontSize();
method public synchronized int getMinimumLogicalFontSize();
method public deprecated boolean getNavDump();
@@ -26493,6 +26698,7 @@
method public void setLightTouchEnabled(boolean);
method public void setLoadWithOverviewMode(boolean);
method public synchronized void setLoadsImagesAutomatically(boolean);
+ method public void setMediaPlaybackRequiresUserGesture(boolean);
method public synchronized void setMinimumFontSize(int);
method public synchronized void setMinimumLogicalFontSize(int);
method public deprecated void setNavDump(boolean);
@@ -27222,10 +27428,12 @@
method public abstract void onSelectedDayChange(android.widget.CalendarView, int, int, int);
}
- public class CheckBox extends android.widget.CompoundButton {
+ public class CheckBox extends android.widget.CompoundButton implements android.widget.ValueEditor {
ctor public CheckBox(android.content.Context);
ctor public CheckBox(android.content.Context, android.util.AttributeSet);
ctor public CheckBox(android.content.Context, android.util.AttributeSet, int);
+ method public android.util.ValueModel<java.lang.Boolean> getValueModel();
+ method public void setValueModel(android.util.ValueModel<java.lang.Boolean>);
}
public abstract interface Checkable {
@@ -27398,14 +27606,16 @@
method public void setSize(int, int);
}
- public class EditText extends android.widget.TextView {
+ public class EditText extends android.widget.TextView implements android.widget.ValueEditor {
ctor public EditText(android.content.Context);
ctor public EditText(android.content.Context, android.util.AttributeSet);
ctor public EditText(android.content.Context, android.util.AttributeSet, int);
method public void extendSelection(int);
+ method public android.util.ValueModel<java.lang.CharSequence> getValueModel();
method public void selectAll();
method public void setSelection(int, int);
method public void setSelection(int);
+ method public void setValueModel(android.util.ValueModel<java.lang.CharSequence>);
}
public abstract interface ExpandableListAdapter {
@@ -28198,19 +28408,25 @@
field public static final int ABOVE = 2; // 0x2
field public static final int ALIGN_BASELINE = 4; // 0x4
field public static final int ALIGN_BOTTOM = 8; // 0x8
+ field public static final int ALIGN_END = 19; // 0x13
field public static final int ALIGN_LEFT = 5; // 0x5
field public static final int ALIGN_PARENT_BOTTOM = 12; // 0xc
+ field public static final int ALIGN_PARENT_END = 21; // 0x15
field public static final int ALIGN_PARENT_LEFT = 9; // 0x9
field public static final int ALIGN_PARENT_RIGHT = 11; // 0xb
+ field public static final int ALIGN_PARENT_START = 20; // 0x14
field public static final int ALIGN_PARENT_TOP = 10; // 0xa
field public static final int ALIGN_RIGHT = 7; // 0x7
+ field public static final int ALIGN_START = 18; // 0x12
field public static final int ALIGN_TOP = 6; // 0x6
field public static final int BELOW = 3; // 0x3
field public static final int CENTER_HORIZONTAL = 14; // 0xe
field public static final int CENTER_IN_PARENT = 13; // 0xd
field public static final int CENTER_VERTICAL = 15; // 0xf
+ field public static final int END_OF = 17; // 0x11
field public static final int LEFT_OF = 0; // 0x0
field public static final int RIGHT_OF = 1; // 0x1
+ field public static final int START_OF = 16; // 0x10
field public static final int TRUE = -1; // 0xffffffff
}
@@ -28422,11 +28638,13 @@
method public abstract java.lang.Object[] getSections();
}
- public class SeekBar extends android.widget.AbsSeekBar {
+ public class SeekBar extends android.widget.AbsSeekBar implements android.widget.ValueEditor {
ctor public SeekBar(android.content.Context);
ctor public SeekBar(android.content.Context, android.util.AttributeSet);
ctor public SeekBar(android.content.Context, android.util.AttributeSet, int);
+ method public android.util.ValueModel<java.lang.Integer> getValueModel();
method public void setOnSeekBarChangeListener(android.widget.SeekBar.OnSeekBarChangeListener);
+ method public void setValueModel(android.util.ValueModel<java.lang.Integer>);
}
public static abstract interface SeekBar.OnSeekBarChangeListener {
@@ -28998,6 +29216,11 @@
method public android.widget.TextView getText2();
}
+ public abstract interface ValueEditor {
+ method public abstract android.util.ValueModel<T> getValueModel();
+ method public abstract void setValueModel(android.util.ValueModel<T>);
+ }
+
public class VideoView extends android.view.SurfaceView implements android.widget.MediaController.MediaPlayerControl {
ctor public VideoView(android.content.Context);
ctor public VideoView(android.content.Context, android.util.AttributeSet);
diff --git a/cmds/installd/commands.c b/cmds/installd/commands.c
index f5f6f3b..5878619 100644
--- a/cmds/installd/commands.c
+++ b/cmds/installd/commands.c
@@ -79,7 +79,7 @@
#ifdef HAVE_SELINUX
if (selinux_android_setfilecon(libdir, pkgname, AID_SYSTEM) < 0) {
- LOGE("cannot setfilecon dir '%s': %s\n", libdir, strerror(errno));
+ ALOGE("cannot setfilecon dir '%s': %s\n", libdir, strerror(errno));
unlink(libdir);
unlink(pkgdir);
return -errno;
@@ -95,7 +95,7 @@
#ifdef HAVE_SELINUX
if (selinux_android_setfilecon(pkgdir, pkgname, uid) < 0) {
- LOGE("cannot setfilecon dir '%s': %s\n", pkgdir, strerror(errno));
+ ALOGE("cannot setfilecon dir '%s': %s\n", pkgdir, strerror(errno));
unlink(libdir);
unlink(pkgdir);
return -errno;
@@ -202,7 +202,7 @@
#ifdef HAVE_SELINUX
if (selinux_android_setfilecon(pkgdir, pkgname, uid) < 0) {
- LOGE("cannot setfilecon dir '%s': %s\n", pkgdir, strerror(errno));
+ ALOGE("cannot setfilecon dir '%s': %s\n", pkgdir, strerror(errno));
unlink(pkgdir);
return -errno;
}
@@ -404,7 +404,7 @@
#ifdef HAVE_SELINUX
if (selinux_android_setfilecon(pkgpath, pkgname, s.st_uid) < 0) {
- LOGE("cannot setfilecon dir '%s': %s\n", pkgpath, strerror(errno));
+ ALOGE("cannot setfilecon dir '%s': %s\n", pkgpath, strerror(errno));
return -1;
}
#endif
diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java
index f20fd33..809acac 100644
--- a/core/java/android/app/Activity.java
+++ b/core/java/android/app/Activity.java
@@ -2708,7 +2708,12 @@
// metadata is available.
Intent upIntent = getParentActivityIntent();
if (upIntent != null) {
- if (shouldUpRecreateTask(upIntent)) {
+ if (mActivityInfo.taskAffinity == null) {
+ // Activities with a null affinity are special; they really shouldn't
+ // specify a parent activity intent in the first place. Just finish
+ // the current activity and call it a day.
+ finish();
+ } else if (shouldUpRecreateTask(upIntent)) {
TaskStackBuilder b = TaskStackBuilder.create(this);
onCreateNavigateUpTaskStack(b);
onPrepareNavigateUpTaskStack(b);
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java
index 7242029..7011bc1 100644
--- a/core/java/android/app/ActivityThread.java
+++ b/core/java/android/app/ActivityThread.java
@@ -70,6 +70,7 @@
import android.util.LogPrinter;
import android.util.PrintWriterPrinter;
import android.util.Slog;
+import android.view.CompatibilityInfoHolder;
import android.view.Display;
import android.view.HardwareRenderer;
import android.view.View;
@@ -1527,7 +1528,9 @@
dm = new DisplayMetrics();
mDisplayMetrics.put(ci, dm);
}
- Display d = WindowManagerImpl.getDefault(ci).getDefaultDisplay();
+ CompatibilityInfoHolder cih = new CompatibilityInfoHolder();
+ cih.set(ci);
+ Display d = WindowManagerImpl.getDefault().makeCompatible(cih).getDefaultDisplay();
d.getMetrics(dm);
//Slog.i("foo", "New metrics: w=" + metrics.widthPixels + " h="
// + metrics.heightPixels + " den=" + metrics.density
diff --git a/core/java/android/app/ContextImpl.java b/core/java/android/app/ContextImpl.java
index 4a75c05..9364a57 100644
--- a/core/java/android/app/ContextImpl.java
+++ b/core/java/android/app/ContextImpl.java
@@ -489,7 +489,8 @@
registerService(WINDOW_SERVICE, new ServiceFetcher() {
public Object getService(ContextImpl ctx) {
- return WindowManagerImpl.getDefault(ctx.mPackageInfo.mCompatibilityInfo);
+ return WindowManagerImpl.getDefault().makeCompatible(
+ ctx.mPackageInfo.mCompatibilityInfo);
}});
}
diff --git a/core/java/android/app/FragmentManager.java b/core/java/android/app/FragmentManager.java
index b0cc37b..1bf7785 100644
--- a/core/java/android/app/FragmentManager.java
+++ b/core/java/android/app/FragmentManager.java
@@ -22,6 +22,8 @@
import android.content.res.Configuration;
import android.content.res.TypedArray;
import android.os.Bundle;
+// TODO(cmautner): remove after fixing 6829431.
+import android.os.Debug;
import android.os.Handler;
import android.os.Looper;
import android.os.Parcel;
@@ -383,7 +385,8 @@
* Container for fragments associated with an activity.
*/
final class FragmentManagerImpl extends FragmentManager {
- static boolean DEBUG = false;
+ // TODO(cmautner): restore to false after fixing 6829431.
+ static boolean DEBUG = true;
static final String TAG = "FragmentManager";
static final String TARGET_REQUEST_CODE_STATE_TAG = "android:target_req_state";
@@ -732,6 +735,10 @@
void moveToState(Fragment f, int newState, int transit, int transitionStyle,
boolean keepActive) {
+ // TODO(cmautner): remove after fixing 6829431.
+ if (DEBUG) Log.v(TAG, "moveToState: " + f
+ + " oldState=" + f.mState + " newState=" + newState
+ + " mRemoving=" + f.mRemoving + " Callers=" + Debug.getCallers(5));
// Fragments that are not currently added will sit in the onCreate() state.
if (!f.mAdded && newState > Fragment.CREATED) {
newState = Fragment.CREATED;
diff --git a/core/java/android/inputmethodservice/InputMethodService.java b/core/java/android/inputmethodservice/InputMethodService.java
index 46153e7..c2cb1ff 100644
--- a/core/java/android/inputmethodservice/InputMethodService.java
+++ b/core/java/android/inputmethodservice/InputMethodService.java
@@ -1674,9 +1674,6 @@
/**
* Show the input method. This is a call back to the
* IMF to handle showing the input method.
- * Close this input method's soft input area, removing it from the display.
- * The input method will continue running, but the user can no longer use
- * it to generate input by touching the screen.
* @param flags Provides additional operating flags. Currently may be
* 0 or have the {@link InputMethodManager#SHOW_FORCED
* InputMethodManager.} bit set.
diff --git a/core/java/android/os/PowerManager.java b/core/java/android/os/PowerManager.java
index 318c0ae..b6e606c 100644
--- a/core/java/android/os/PowerManager.java
+++ b/core/java/android/os/PowerManager.java
@@ -542,14 +542,18 @@
private void acquireLocked() {
if (!mRefCounted || mCount++ == 0) {
+ // Do this even if the wake lock is already thought to be held (mHeld == true)
+ // because non-reference counted wake locks are not always properly released.
+ // For example, the keyguard's wake lock might be forcibly released by the
+ // power manager without the keyguard knowing. A subsequent call to acquire
+ // should immediately acquire the wake lock once again despite never having
+ // been explicitly released by the keyguard.
mHandler.removeCallbacks(mReleaser);
- if (!mHeld) {
- try {
- mService.acquireWakeLock(mFlags, mToken, mTag, mWorkSource);
- } catch (RemoteException e) {
- }
- mHeld = true;
+ try {
+ mService.acquireWakeLock(mFlags, mToken, mTag, mWorkSource);
+ } catch (RemoteException e) {
}
+ mHeld = true;
}
}
diff --git a/core/java/android/os/SystemClock.java b/core/java/android/os/SystemClock.java
index 7291739..a54c25b 100644
--- a/core/java/android/os/SystemClock.java
+++ b/core/java/android/os/SystemClock.java
@@ -46,15 +46,16 @@
* such as {@link Thread#sleep(long) Thread.sleep(millls)},
* {@link Object#wait(long) Object.wait(millis)}, and
* {@link System#nanoTime System.nanoTime()}. This clock is guaranteed
- * to be monotonic, and is the recommended basis for the general purpose
- * interval timing of user interface events, performance measurements,
- * and anything else that does not need to measure elapsed time during
- * device sleep. Most methods that accept a timestamp value expect the
- * {@link #uptimeMillis} clock.
+ * to be monotonic, and is suitable for interval timing when the
+ * interval does not span device sleep. Most methods that accept a
+ * timestamp value currently expect the {@link #uptimeMillis} clock.
*
- * <li> <p> {@link #elapsedRealtime} is counted in milliseconds since the
- * system was booted, including deep sleep. This clock should be used
- * when measuring time intervals that may span periods of system sleep.
+ * <li> <p> {@link #elapsedRealtime} and {@link #elapsedRealtimeNano}
+ * return the time since the system was booted, and include deep sleep.
+ * This clock is guaranteed to be monotonic, and continues to tick even
+ * when the CPU is in power saving modes, so is the recommend basis
+ * for general purpose interval timing.
+ *
* </ul>
*
* There are several mechanisms for controlling the timing of events:
@@ -150,7 +151,14 @@
* @return elapsed milliseconds since boot.
*/
native public static long elapsedRealtime();
-
+
+ /**
+ * Returns nanoseconds since boot, including time spent in sleep.
+ *
+ * @return elapsed nanoseconds since boot.
+ */
+ public static native long elapsedRealtimeNano();
+
/**
* Returns milliseconds running in the current thread.
*
diff --git a/core/java/android/util/PropertyValueModel.java b/core/java/android/util/PropertyValueModel.java
new file mode 100755
index 0000000..eb9c47d
--- /dev/null
+++ b/core/java/android/util/PropertyValueModel.java
@@ -0,0 +1,143 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.util;
+
+/**
+ * A value model for a {@link Property property} of a host object. This class can be used for
+ * both reflective and non-reflective property implementations.
+ *
+ * @param <H> the host type, where the host is the object that holds this property
+ * @param <T> the value type
+ *
+ * @see Property
+ * @see ValueModel
+ */
+public class PropertyValueModel<H, T> extends ValueModel<T> {
+ private final H mHost;
+ private final Property<H, T> mProperty;
+
+ private PropertyValueModel(H host, Property<H, T> property) {
+ mProperty = property;
+ mHost = host;
+ }
+
+ /**
+ * Returns the host.
+ *
+ * @return the host
+ */
+ public H getHost() {
+ return mHost;
+ }
+
+ /**
+ * Returns the property.
+ *
+ * @return the property
+ */
+ public Property<H, T> getProperty() {
+ return mProperty;
+ }
+
+ @Override
+ public Class<T> getType() {
+ return mProperty.getType();
+ }
+
+ @Override
+ public T get() {
+ return mProperty.get(mHost);
+ }
+
+ @Override
+ public void set(T value) {
+ mProperty.set(mHost, value);
+ }
+
+ /**
+ * Return an appropriate PropertyValueModel for this host and property.
+ *
+ * @param host the host
+ * @param property the property
+ * @return the value model
+ */
+ public static <H, T> PropertyValueModel<H, T> of(H host, Property<H, T> property) {
+ return new PropertyValueModel<H, T>(host, property);
+ }
+
+ /**
+ * Return a PropertyValueModel for this {@code host} and a
+ * reflective property, constructed from this {@code propertyType} and {@code propertyName}.
+ *
+ * @param host
+ * @param propertyType the property type
+ * @param propertyName the property name
+ * @return a value model with this host and a reflective property with this type and name
+ *
+ * @see Property#of
+ */
+ public static <H, T> PropertyValueModel<H, T> of(H host, Class<T> propertyType,
+ String propertyName) {
+ return of(host, Property.of((Class<H>) host.getClass(), propertyType, propertyName));
+ }
+
+ private static Class getNullaryMethodReturnType(Class c, String name) {
+ try {
+ return c.getMethod(name).getReturnType();
+ } catch (NoSuchMethodException e) {
+ return null;
+ }
+ }
+
+ private static Class getFieldType(Class c, String name) {
+ try {
+ return c.getField(name).getType();
+ } catch (NoSuchFieldException e) {
+ return null;
+ }
+ }
+
+ private static String capitalize(String name) {
+ if (name.isEmpty()) {
+ return name;
+ }
+ return Character.toUpperCase(name.charAt(0)) + name.substring(1);
+ }
+
+ /**
+ * Return a PropertyValueModel for this {@code host} and and {@code propertyName}.
+ *
+ * @param host the host
+ * @param propertyName the property name
+ * @return a value model with this host and a reflective property with this name
+ */
+ public static PropertyValueModel of(Object host, String propertyName) {
+ Class clazz = host.getClass();
+ String suffix = capitalize(propertyName);
+ Class propertyType = getNullaryMethodReturnType(clazz, "get" + suffix);
+ if (propertyType == null) {
+ propertyType = getNullaryMethodReturnType(clazz, "is" + suffix);
+ }
+ if (propertyType == null) {
+ propertyType = getFieldType(clazz, propertyName);
+ }
+ if (propertyType == null) {
+ throw new NoSuchPropertyException(propertyName);
+ }
+ return of(host, propertyType, propertyName);
+ }
+}
diff --git a/core/java/android/util/TimeUtils.java b/core/java/android/util/TimeUtils.java
index c4ebec4..7d33ff4a 100644
--- a/core/java/android/util/TimeUtils.java
+++ b/core/java/android/util/TimeUtils.java
@@ -18,8 +18,10 @@
import android.content.res.Resources;
import android.content.res.XmlResourceParser;
+import android.text.format.DateUtils;
-import libcore.util.ZoneInfoDB;
+import com.android.internal.util.XmlUtils;
+
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
@@ -28,10 +30,10 @@
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collection;
-import java.util.TimeZone;
import java.util.Date;
+import java.util.TimeZone;
-import com.android.internal.util.XmlUtils;
+import libcore.util.ZoneInfoDB;
/**
* A class containing utility methods related to time zones.
@@ -245,6 +247,8 @@
private static final Object sFormatSync = new Object();
private static char[] sFormatStr = new char[HUNDRED_DAY_FIELD_LEN+5];
+ private static final long LARGEST_DURATION = (1000 * DateUtils.DAY_IN_MILLIS) - 1;
+
static private int accumField(int amt, int suffix, boolean always, int zeropad) {
if (amt > 99 || (always && zeropad >= 3)) {
return 3+suffix;
@@ -307,6 +311,10 @@
duration = -duration;
}
+ if (duration > LARGEST_DURATION) {
+ duration = LARGEST_DURATION;
+ }
+
int millis = (int)(duration%1000);
int seconds = (int) Math.floor(duration / 1000);
int days = 0, hours = 0, minutes = 0;
diff --git a/core/java/android/util/ValueModel.java b/core/java/android/util/ValueModel.java
new file mode 100755
index 0000000..4789682
--- /dev/null
+++ b/core/java/android/util/ValueModel.java
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.util;
+
+/**
+ * A ValueModel is an abstraction for a 'slot' or place in memory in which a value
+ * may be stored and retrieved. A common implementation of ValueModel is a regular property of
+ * an object, whose value may be retrieved by calling the appropriate <em>getter</em>
+ * method and set by calling the corresponding <em>setter</em> method.
+ *
+ * @param <T> the value type
+ *
+ * @see PropertyValueModel
+ */
+public abstract class ValueModel<T> {
+ /**
+ * The empty model should be used in place of {@code null} to indicate that a
+ * model has not been set. The empty model has no value and does nothing when it is set.
+ */
+ public static final ValueModel EMPTY = new ValueModel() {
+ @Override
+ public Class getType() {
+ return Object.class;
+ }
+
+ @Override
+ public Object get() {
+ return null;
+ }
+
+ @Override
+ public void set(Object value) {
+
+ }
+ };
+
+ protected ValueModel() {
+ }
+
+ /**
+ * Returns the type of this property.
+ *
+ * @return the property type
+ */
+ public abstract Class<T> getType();
+
+ /**
+ * Returns the value of this property.
+ *
+ * @return the property value
+ */
+ public abstract T get();
+
+ /**
+ * Sets the value of this property.
+ *
+ * @param value the new value for this property
+ */
+ public abstract void set(T value);
+}
\ No newline at end of file
diff --git a/core/java/android/view/Choreographer.java b/core/java/android/view/Choreographer.java
index 78dc86f..6288ce5 100644
--- a/core/java/android/view/Choreographer.java
+++ b/core/java/android/view/Choreographer.java
@@ -164,8 +164,9 @@
mHandler = new FrameHandler(looper);
mDisplayEventReceiver = USE_VSYNC ? new FrameDisplayEventReceiver(looper) : null;
mLastFrameTimeNanos = Long.MIN_VALUE;
- mFrameIntervalNanos = (long)(1000000000 /
- new Display(Display.DEFAULT_DISPLAY, null).getRefreshRate());
+
+ Display d = WindowManagerImpl.getDefault().getDefaultDisplay();
+ mFrameIntervalNanos = (long)(1000000000 / d.getRefreshRate());
mCallbackQueues = new CallbackQueue[CALLBACK_LAST + 1];
for (int i = 0; i <= CALLBACK_LAST; i++) {
diff --git a/core/java/android/view/Display.java b/core/java/android/view/Display.java
index c947312..ce49268 100644
--- a/core/java/android/view/Display.java
+++ b/core/java/android/view/Display.java
@@ -450,13 +450,5 @@
private static final Object sStaticInit = new Object();
private static boolean sInitialized = false;
private static IWindowManager sWindowManager;
-
- /**
- * Returns a display object which uses the metric's width/height instead.
- * @hide
- */
- public static Display createCompatibleDisplay(int displayId, CompatibilityInfoHolder compat) {
- return new Display(displayId, compat);
- }
}
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 043d1d4..697f38e 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -6387,7 +6387,8 @@
case IMPORTANT_FOR_ACCESSIBILITY_NO:
return false;
case IMPORTANT_FOR_ACCESSIBILITY_AUTO:
- return isActionableForAccessibility() || hasListenersForAccessibility();
+ return isActionableForAccessibility() || hasListenersForAccessibility()
+ || getAccessibilityNodeProvider() != null;
default:
throw new IllegalArgumentException("Unknow important for accessibility mode: "
+ mode);
diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java
index 4e6e2ce..147669f 100644
--- a/core/java/android/view/ViewGroup.java
+++ b/core/java/android/view/ViewGroup.java
@@ -5504,13 +5504,17 @@
/**
* The default start and end margin.
+ * @hide
*/
- static private final int DEFAULT_RELATIVE = Integer.MIN_VALUE;
+ public static final int DEFAULT_RELATIVE = Integer.MIN_VALUE;
private int initialLeftMargin;
private int initialRightMargin;
- private int layoutDirection;
+ private static int LAYOUT_DIRECTION_UNDEFINED = -1;
+
+ // Layout direction undefined by default
+ private int layoutDirection = LAYOUT_DIRECTION_UNDEFINED;
/**
* Creates a new set of layout parameters. The values are extracted from
@@ -5553,9 +5557,6 @@
initialLeftMargin = leftMargin;
initialRightMargin = rightMargin;
- // LTR by default
- layoutDirection = View.LAYOUT_DIRECTION_LTR;
-
a.recycle();
}
@@ -5585,7 +5586,7 @@
this.initialLeftMargin = source.leftMargin;
this.initialRightMargin = source.rightMargin;
- this.layoutDirection = source.layoutDirection;
+ setLayoutDirection(source.layoutDirection);
}
/**
@@ -5688,19 +5689,41 @@
* @attr ref android.R.styleable#ViewGroup_MarginLayout_layout_marginStart
* @attr ref android.R.styleable#ViewGroup_MarginLayout_layout_marginEnd
*
- * @return true if either marginStart or marginEnd has been set
+ * @return true if either marginStart or marginEnd has been set.
*/
public boolean isMarginRelative() {
return (startMargin != DEFAULT_RELATIVE) || (endMargin != DEFAULT_RELATIVE);
}
/**
+ * Set the layout direction
+ * @param layoutDirection the layout direction.
+ * Should be either {@link View#LAYOUT_DIRECTION_LTR}
+ * or {@link View#LAYOUT_DIRECTION_RTL}.
+ */
+ public void setLayoutDirection(int layoutDirection) {
+ if (layoutDirection != View.LAYOUT_DIRECTION_LTR &&
+ layoutDirection != View.LAYOUT_DIRECTION_RTL) return;
+ this.layoutDirection = layoutDirection;
+ }
+
+ /**
+ * Retuns the layout direction. Can be either {@link View#LAYOUT_DIRECTION_LTR} or
+ * {@link View#LAYOUT_DIRECTION_RTL}.
+ *
+ * @return the layout direction.
+ */
+ public int getLayoutDirection() {
+ return layoutDirection;
+ }
+
+ /**
* This will be called by {@link android.view.View#requestLayout()}. Left and Right margins
* may be overridden depending on layout direction.
*/
@Override
public void onResolveLayoutDirection(int layoutDirection) {
- this.layoutDirection = layoutDirection;
+ setLayoutDirection(layoutDirection);
if (!isMarginRelative()) return;
@@ -5717,6 +5740,10 @@
}
}
+ protected boolean isLayoutRtl() {
+ return (layoutDirection == View.LAYOUT_DIRECTION_RTL);
+ }
+
/**
* @hide
*/
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java
index fb0a8a4..d5d1b74 100644
--- a/core/java/android/view/ViewRootImpl.java
+++ b/core/java/android/view/ViewRootImpl.java
@@ -251,8 +251,6 @@
CompatibilityInfoHolder mCompatibilityInfo;
- /*package*/ int mAddNesting;
-
// These are accessed by multiple threads.
final Rect mWinFrame; // frame given by window manager.
diff --git a/core/java/android/view/Window.java b/core/java/android/view/Window.java
index ec4114e..f57f056 100644
--- a/core/java/android/view/Window.java
+++ b/core/java/android/view/Window.java
@@ -18,7 +18,6 @@
import android.app.Application;
import android.content.Context;
-import android.content.res.CompatibilityInfo;
import android.content.res.Configuration;
import android.content.res.TypedArray;
import android.graphics.PixelFormat;
@@ -27,7 +26,6 @@
import android.os.Bundle;
import android.os.IBinder;
import android.os.SystemProperties;
-import android.util.Slog;
import android.view.accessibility.AccessibilityEvent;
/**
@@ -119,6 +117,8 @@
*/
public static final int ID_ANDROID_CONTENT = com.android.internal.R.id.content;
+ private static final String PROPERTY_HARDWARE_UI = "persist.sys.ui.hw";
+
private final Context mContext;
private TypedArray mWindowStyle;
@@ -126,6 +126,7 @@
private WindowManager mWindowManager;
private IBinder mAppToken;
private String mAppName;
+ private boolean mHardwareAccelerated;
private Window mContainer;
private Window mActiveChild;
private boolean mIsActive = false;
@@ -471,80 +472,63 @@
boolean hardwareAccelerated) {
mAppToken = appToken;
mAppName = appName;
+ mHardwareAccelerated = hardwareAccelerated
+ || SystemProperties.getBoolean(PROPERTY_HARDWARE_UI, false);
if (wm == null) {
wm = WindowManagerImpl.getDefault();
}
- mWindowManager = new LocalWindowManager(wm, hardwareAccelerated);
+ mWindowManager = ((WindowManagerImpl)wm).makeLocal(this);
}
- static CompatibilityInfoHolder getCompatInfo(Context context) {
- Application app = (Application)context.getApplicationContext();
- return app != null ? app.mLoadedApk.mCompatibilityInfo : new CompatibilityInfoHolder();
+ CompatibilityInfoHolder getCompatibilityInfo() {
+ Application app = (Application)mContext.getApplicationContext();
+ return app != null ? app.mLoadedApk.mCompatibilityInfo : null;
}
- private class LocalWindowManager extends WindowManagerImpl.CompatModeWrapper {
- private static final String PROPERTY_HARDWARE_UI = "persist.sys.ui.hw";
-
- private final boolean mHardwareAccelerated;
-
- LocalWindowManager(WindowManager wm, boolean hardwareAccelerated) {
- super(wm, getCompatInfo(mContext));
- mHardwareAccelerated = hardwareAccelerated ||
- SystemProperties.getBoolean(PROPERTY_HARDWARE_UI, false);
- }
-
- public boolean isHardwareAccelerated() {
- return mHardwareAccelerated;
- }
-
- public final void addView(View view, ViewGroup.LayoutParams params) {
- // Let this throw an exception on a bad params.
- WindowManager.LayoutParams wp = (WindowManager.LayoutParams)params;
- CharSequence curTitle = wp.getTitle();
- if (wp.type >= WindowManager.LayoutParams.FIRST_SUB_WINDOW &&
- wp.type <= WindowManager.LayoutParams.LAST_SUB_WINDOW) {
- if (wp.token == null) {
- View decor = peekDecorView();
- if (decor != null) {
- wp.token = decor.getWindowToken();
- }
+ void adjustLayoutParamsForSubWindow(WindowManager.LayoutParams wp) {
+ CharSequence curTitle = wp.getTitle();
+ if (wp.type >= WindowManager.LayoutParams.FIRST_SUB_WINDOW &&
+ wp.type <= WindowManager.LayoutParams.LAST_SUB_WINDOW) {
+ if (wp.token == null) {
+ View decor = peekDecorView();
+ if (decor != null) {
+ wp.token = decor.getWindowToken();
}
- if (curTitle == null || curTitle.length() == 0) {
- String title;
- if (wp.type == WindowManager.LayoutParams.TYPE_APPLICATION_MEDIA) {
- title="Media";
- } else if (wp.type == WindowManager.LayoutParams.TYPE_APPLICATION_MEDIA_OVERLAY) {
- title="MediaOvr";
- } else if (wp.type == WindowManager.LayoutParams.TYPE_APPLICATION_PANEL) {
- title="Panel";
- } else if (wp.type == WindowManager.LayoutParams.TYPE_APPLICATION_SUB_PANEL) {
- title="SubPanel";
- } else if (wp.type == WindowManager.LayoutParams.TYPE_APPLICATION_ATTACHED_DIALOG) {
- title="AtchDlg";
- } else {
- title=Integer.toString(wp.type);
- }
- if (mAppName != null) {
- title += ":" + mAppName;
- }
- wp.setTitle(title);
- }
- } else {
- if (wp.token == null) {
- wp.token = mContainer == null ? mAppToken : mContainer.mAppToken;
- }
- if ((curTitle == null || curTitle.length() == 0)
- && mAppName != null) {
- wp.setTitle(mAppName);
- }
- }
- if (wp.packageName == null) {
- wp.packageName = mContext.getPackageName();
}
- if (mHardwareAccelerated) {
- wp.flags |= WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED;
+ if (curTitle == null || curTitle.length() == 0) {
+ String title;
+ if (wp.type == WindowManager.LayoutParams.TYPE_APPLICATION_MEDIA) {
+ title="Media";
+ } else if (wp.type == WindowManager.LayoutParams.TYPE_APPLICATION_MEDIA_OVERLAY) {
+ title="MediaOvr";
+ } else if (wp.type == WindowManager.LayoutParams.TYPE_APPLICATION_PANEL) {
+ title="Panel";
+ } else if (wp.type == WindowManager.LayoutParams.TYPE_APPLICATION_SUB_PANEL) {
+ title="SubPanel";
+ } else if (wp.type == WindowManager.LayoutParams.TYPE_APPLICATION_ATTACHED_DIALOG) {
+ title="AtchDlg";
+ } else {
+ title=Integer.toString(wp.type);
+ }
+ if (mAppName != null) {
+ title += ":" + mAppName;
+ }
+ wp.setTitle(title);
}
- super.addView(view, params);
+ } else {
+ if (wp.token == null) {
+ wp.token = mContainer == null ? mAppToken : mContainer.mAppToken;
+ }
+ if ((curTitle == null || curTitle.length() == 0)
+ && mAppName != null) {
+ wp.setTitle(mAppName);
+ }
+ }
+ if (wp.packageName == null) {
+ wp.packageName = mContext.getPackageName();
+ }
+ if (mHardwareAccelerated) {
+ wp.flags |= WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED;
}
}
diff --git a/core/java/android/view/WindowManager.java b/core/java/android/view/WindowManager.java
index 0336b2f..123d9e7 100644
--- a/core/java/android/view/WindowManager.java
+++ b/core/java/android/view/WindowManager.java
@@ -64,15 +64,7 @@
* @param view The view to be removed.
*/
public void removeViewImmediate(View view);
-
- /**
- * Return true if this window manager is configured to request hardware
- * accelerated windows. This does <em>not</em> guarantee that they will
- * actually be accelerated, since that depends on the device supporting them.
- * @hide
- */
- public boolean isHardwareAccelerated();
-
+
public static class LayoutParams extends ViewGroup.LayoutParams
implements Parcelable {
/**
diff --git a/core/java/android/view/WindowManagerImpl.java b/core/java/android/view/WindowManagerImpl.java
index dd6b537..dedee97 100644
--- a/core/java/android/view/WindowManagerImpl.java
+++ b/core/java/android/view/WindowManagerImpl.java
@@ -18,9 +18,7 @@
import android.app.ActivityManager;
import android.content.ComponentCallbacks2;
-import android.content.res.CompatibilityInfo;
import android.content.res.Configuration;
-import android.graphics.PixelFormat;
import android.opengl.ManagedEGLContext;
import android.os.IBinder;
import android.os.SystemProperties;
@@ -31,7 +29,6 @@
import java.io.FileDescriptor;
import java.io.FileOutputStream;
import java.io.PrintWriter;
-import java.util.HashMap;
final class WindowLeaked extends AndroidRuntimeException {
public WindowLeaked(String msg) {
@@ -44,7 +41,7 @@
* the ViewManager interface, allowing you to add any View subclass as a
* top-level window on the screen. Additional window manager specific layout
* parameters are defined for control over how windows are displayed.
- * It also implemens the WindowManager interface, allowing you to control the
+ * It also implements the WindowManager interface, allowing you to control the
* displays attached to the device.
*
* <p>Applications will not normally use WindowManager directly, instead relying
@@ -60,20 +57,25 @@
* @hide
*/
public class WindowManagerImpl implements WindowManager {
+ private static final String TAG = "WindowManager";
+
/**
* The user is navigating with keys (not the touch screen), so
* navigational focus should be shown.
*/
public static final int RELAYOUT_RES_IN_TOUCH_MODE = 0x1;
+
/**
* This is the first time the window is being drawn,
* so the client must call drawingFinished() when done
*/
public static final int RELAYOUT_RES_FIRST_TIME = 0x2;
+
/**
* The window manager has changed the surface from the last call.
*/
public static final int RELAYOUT_RES_SURFACE_CHANGED = 0x4;
+
/**
* The window manager is currently animating. It will call
* IWindow.doneAnimating() when done.
@@ -108,262 +110,268 @@
public static final int ADD_MULTIPLE_SINGLETON = -7;
public static final int ADD_PERMISSION_DENIED = -8;
- private View[] mViews;
- private ViewRootImpl[] mRoots;
- private WindowManager.LayoutParams[] mParams;
- private boolean mNeedsEglTerminate;
+ private static WindowManagerImpl sDefaultWindowManager;
- private Runnable mSystemPropertyUpdater = null;
+ private final WindowManagerState mState;
+ private final Window mParentWindow;
+ private final CompatibilityInfoHolder mCompatibilityInfo;
+ private final Display mDefaultDisplay;
- private final static Object sLock = new Object();
- private final static WindowManagerImpl sWindowManager = new WindowManagerImpl();
- private final static HashMap<CompatibilityInfo, WindowManager> sCompatWindowManagers
- = new HashMap<CompatibilityInfo, WindowManager>();
-
- static class CompatModeWrapper implements WindowManager {
- private final WindowManagerImpl mWindowManager;
- private final Display mDefaultDisplay;
- private final CompatibilityInfoHolder mCompatibilityInfo;
-
- CompatModeWrapper(WindowManager wm, CompatibilityInfoHolder ci) {
- mWindowManager = wm instanceof CompatModeWrapper
- ? ((CompatModeWrapper)wm).mWindowManager : (WindowManagerImpl)wm;
-
- // Use the original display if there is no compatibility mode
- // to apply, or the underlying window manager is already a
- // compatibility mode wrapper. (We assume that if it is a
- // wrapper, it is applying the same compatibility mode.)
- if (ci == null) {
- mDefaultDisplay = mWindowManager.getDefaultDisplay();
- } else {
- //mDefaultDisplay = mWindowManager.getDefaultDisplay();
- mDefaultDisplay = Display.createCompatibleDisplay(
- mWindowManager.getDefaultDisplay().getDisplayId(), ci);
- }
-
- mCompatibilityInfo = ci;
- }
-
- @Override
- public void addView(View view, android.view.ViewGroup.LayoutParams params) {
- mWindowManager.addView(view, params, mCompatibilityInfo);
- }
-
- @Override
- public void updateViewLayout(View view, android.view.ViewGroup.LayoutParams params) {
- mWindowManager.updateViewLayout(view, params);
-
- }
-
- @Override
- public void removeView(View view) {
- mWindowManager.removeView(view);
- }
-
- @Override
- public Display getDefaultDisplay() {
- return mDefaultDisplay;
- }
-
- @Override
- public void removeViewImmediate(View view) {
- mWindowManager.removeViewImmediate(view);
- }
-
- @Override
- public boolean isHardwareAccelerated() {
- return mWindowManager.isHardwareAccelerated();
- }
-
+ private WindowManagerImpl(WindowManagerState state, Window parentWindow,
+ CompatibilityInfoHolder compatibilityInfo) {
+ mState = state;
+ mParentWindow = parentWindow;
+ mCompatibilityInfo = compatibilityInfo;
+ mDefaultDisplay = mState.getDefaultDisplay(mCompatibilityInfo);
}
public static WindowManagerImpl getDefault() {
- return sWindowManager;
- }
-
- public static WindowManager getDefault(CompatibilityInfo compatInfo) {
- CompatibilityInfoHolder cih = new CompatibilityInfoHolder();
- cih.set(compatInfo);
- if (cih.getIfNeeded() == null) {
- return sWindowManager;
- }
-
- synchronized (sLock) {
- // NOTE: It would be cleaner to move the implementation of
- // WindowManagerImpl into a static inner class, and have this
- // public impl just call into that. Then we can make multiple
- // instances of WindowManagerImpl for compat mode rather than
- // having to make wrappers.
- WindowManager wm = sCompatWindowManagers.get(compatInfo);
- if (wm == null) {
- wm = new CompatModeWrapper(sWindowManager, cih);
- sCompatWindowManagers.put(compatInfo, wm);
+ synchronized (WindowManagerImpl.class) {
+ if (sDefaultWindowManager == null) {
+ sDefaultWindowManager = new WindowManagerImpl(
+ new WindowManagerState(), null, null);
}
- return wm;
+ return sDefaultWindowManager;
}
}
- public static WindowManager getDefault(CompatibilityInfoHolder compatInfo) {
- return new CompatModeWrapper(sWindowManager, compatInfo);
- }
-
- public boolean isHardwareAccelerated() {
- return false;
- }
-
- public void addView(View view) {
- addView(view, new WindowManager.LayoutParams(
- WindowManager.LayoutParams.TYPE_APPLICATION, 0, PixelFormat.OPAQUE));
+ public WindowManagerImpl makeLocal(Window parentWindow) {
+ return new WindowManagerImpl(mState, parentWindow, parentWindow.getCompatibilityInfo());
}
+ public WindowManagerImpl makeCompatible(CompatibilityInfoHolder compatInfo) {
+ if (compatInfo == mCompatibilityInfo) {
+ return this;
+ }
+ if (compatInfo == null && mParentWindow == null) {
+ return getDefault();
+ }
+ return new WindowManagerImpl(mState, mParentWindow, compatInfo);
+ }
+
+ @Override
public void addView(View view, ViewGroup.LayoutParams params) {
- addView(view, params, null, false);
+ mState.addView(view, params, mParentWindow, mCompatibilityInfo);
}
-
- public void addView(View view, ViewGroup.LayoutParams params, CompatibilityInfoHolder cih) {
- addView(view, params, cih, false);
- }
-
- private void addView(View view, ViewGroup.LayoutParams params,
- CompatibilityInfoHolder cih, boolean nest) {
- if (false) Log.v("WindowManager", "addView view=" + view);
- if (!(params instanceof WindowManager.LayoutParams)) {
- throw new IllegalArgumentException(
- "Params must be WindowManager.LayoutParams");
+ @Override
+ public void updateViewLayout(View view, ViewGroup.LayoutParams params) {
+ mState.updateViewLayout(view, params);
+ }
+
+ @Override
+ public void removeView(View view) {
+ mState.removeView(view, false);
+ }
+
+ @Override
+ public void removeViewImmediate(View view) {
+ mState.removeView(view, true);
+ }
+
+ @Override
+ public Display getDefaultDisplay() {
+ return mDefaultDisplay;
+ }
+
+ public void closeAll(IBinder token, String who, String what) {
+ mState.closeAll(token, who, what);
+ }
+
+ public void startTrimMemory(int level) {
+ mState.startTrimMemory(level);
+ }
+
+ public void endTrimMemory() {
+ mState.endTrimMemory();
+ }
+
+ public void trimLocalMemory() {
+ mState.trimLocalMemory();
+ }
+
+ public void dumpGfxInfo(FileDescriptor fd) {
+ mState.dumpGfxInfo(fd);
+ }
+
+ public void setStoppedState(IBinder token, boolean stopped) {
+ mState.setStoppedState(token, stopped);
+ }
+
+ public void reportNewConfiguration(Configuration config) {
+ mState.reportNewConfiguration(config);
+ }
+
+ static final class WindowManagerState {
+ private final Display mDefaultDisplay;
+
+ private View[] mViews;
+ private ViewRootImpl[] mRoots;
+ private WindowManager.LayoutParams[] mParams;
+ private boolean mNeedsEglTerminate;
+
+ private Runnable mSystemPropertyUpdater;
+
+ public WindowManagerState() {
+ mDefaultDisplay = new Display(Display.DEFAULT_DISPLAY, null);
}
- final WindowManager.LayoutParams wparams
- = (WindowManager.LayoutParams)params;
-
- ViewRootImpl root;
- View panelParentView = null;
-
- synchronized (this) {
- // Start watching for system property changes.
- if (mSystemPropertyUpdater == null) {
- mSystemPropertyUpdater = new Runnable() {
- @Override public void run() {
- synchronized (this) {
+ public Display getDefaultDisplay(CompatibilityInfoHolder compatInfo) {
+ if (compatInfo == null) {
+ return mDefaultDisplay;
+ }
+ return new Display(Display.DEFAULT_DISPLAY, compatInfo);
+ }
+
+ public void addView(View view, ViewGroup.LayoutParams params, Window parentWindow,
+ CompatibilityInfoHolder cih) {
+ if (!(params instanceof WindowManager.LayoutParams)) {
+ throw new IllegalArgumentException("Params must be WindowManager.LayoutParams");
+ }
+
+ final WindowManager.LayoutParams wparams = (WindowManager.LayoutParams)params;
+ if (parentWindow != null) {
+ parentWindow.adjustLayoutParamsForSubWindow(wparams);
+ }
+
+ ViewRootImpl root;
+ View panelParentView = null;
+
+ synchronized (this) {
+ // Start watching for system property changes.
+ if (mSystemPropertyUpdater == null) {
+ mSystemPropertyUpdater = new Runnable() {
+ @Override public void run() {
synchronized (this) {
- for (ViewRootImpl root : mRoots) {
- root.loadSystemProperties();
+ synchronized (this) {
+ for (ViewRootImpl root : mRoots) {
+ root.loadSystemProperties();
+ }
}
}
}
- }
- };
- SystemProperties.addChangeCallback(mSystemPropertyUpdater);
- }
+ };
+ SystemProperties.addChangeCallback(mSystemPropertyUpdater);
+ }
- // Here's an odd/questionable case: if someone tries to add a
- // view multiple times, then we simply bump up a nesting count
- // and they need to remove the view the corresponding number of
- // times to have it actually removed from the window manager.
- // This is useful specifically for the notification manager,
- // which can continually add/remove the same view as a
- // notification gets updated.
- int index = findViewLocked(view, false);
- if (index >= 0) {
- if (!nest) {
+ int index = findViewLocked(view, false);
+ if (index >= 0) {
throw new IllegalStateException("View " + view
+ " has already been added to the window manager.");
}
- root = mRoots[index];
- root.mAddNesting++;
- // Update layout parameters.
+
+ // If this is a panel window, then find the window it is being
+ // attached to for future reference.
+ if (wparams.type >= WindowManager.LayoutParams.FIRST_SUB_WINDOW &&
+ wparams.type <= WindowManager.LayoutParams.LAST_SUB_WINDOW) {
+ final int count = mViews != null ? mViews.length : 0;
+ for (int i=0; i<count; i++) {
+ if (mRoots[i].mWindow.asBinder() == wparams.token) {
+ panelParentView = mViews[i];
+ }
+ }
+ }
+
+ root = new ViewRootImpl(view.getContext());
+ if (cih == null) {
+ root.mCompatibilityInfo = new CompatibilityInfoHolder();
+ } else {
+ root.mCompatibilityInfo = cih;
+ }
+
view.setLayoutParams(wparams);
- root.setLayoutParams(wparams, true);
- return;
+
+ if (mViews == null) {
+ index = 1;
+ mViews = new View[1];
+ mRoots = new ViewRootImpl[1];
+ mParams = new WindowManager.LayoutParams[1];
+ } else {
+ index = mViews.length + 1;
+ Object[] old = mViews;
+ mViews = new View[index];
+ System.arraycopy(old, 0, mViews, 0, index-1);
+ old = mRoots;
+ mRoots = new ViewRootImpl[index];
+ System.arraycopy(old, 0, mRoots, 0, index-1);
+ old = mParams;
+ mParams = new WindowManager.LayoutParams[index];
+ System.arraycopy(old, 0, mParams, 0, index-1);
+ }
+ index--;
+
+ mViews[index] = view;
+ mRoots[index] = root;
+ mParams[index] = wparams;
}
-
- // If this is a panel window, then find the window it is being
- // attached to for future reference.
- if (wparams.type >= WindowManager.LayoutParams.FIRST_SUB_WINDOW &&
- wparams.type <= WindowManager.LayoutParams.LAST_SUB_WINDOW) {
- final int count = mViews != null ? mViews.length : 0;
+
+ // do this last because it fires off messages to start doing things
+ root.setView(view, wparams, panelParentView);
+ }
+
+ public void updateViewLayout(View view, ViewGroup.LayoutParams params) {
+ if (!(params instanceof WindowManager.LayoutParams)) {
+ throw new IllegalArgumentException("Params must be WindowManager.LayoutParams");
+ }
+
+ final WindowManager.LayoutParams wparams = (WindowManager.LayoutParams)params;
+
+ view.setLayoutParams(wparams);
+
+ synchronized (this) {
+ int index = findViewLocked(view, true);
+ ViewRootImpl root = mRoots[index];
+ mParams[index] = wparams;
+ root.setLayoutParams(wparams, false);
+ }
+ }
+
+ public void removeView(View view, boolean immediate) {
+ synchronized (this) {
+ int index = findViewLocked(view, true);
+ View curView = removeViewLocked(index, immediate);
+ if (curView == view) {
+ return;
+ }
+
+ throw new IllegalStateException("Calling with view " + view
+ + " but the ViewAncestor is attached to " + curView);
+ }
+ }
+
+ public void closeAll(IBinder token, String who, String what) {
+ synchronized (this) {
+ if (mViews == null)
+ return;
+
+ int count = mViews.length;
+ //Log.i("foo", "Closing all windows of " + token);
for (int i=0; i<count; i++) {
- if (mRoots[i].mWindow.asBinder() == wparams.token) {
- panelParentView = mViews[i];
+ //Log.i("foo", "@ " + i + " token " + mParams[i].token
+ // + " view " + mRoots[i].getView());
+ if (token == null || mParams[i].token == token) {
+ ViewRootImpl root = mRoots[i];
+
+ //Log.i("foo", "Force closing " + root);
+ if (who != null) {
+ WindowLeaked leak = new WindowLeaked(
+ what + " " + who + " has leaked window "
+ + root.getView() + " that was originally added here");
+ leak.setStackTrace(root.getLocation().getStackTrace());
+ Log.e(TAG, leak.getMessage(), leak);
+ }
+
+ removeViewLocked(i, false);
+ i--;
+ count--;
}
}
}
-
- root = new ViewRootImpl(view.getContext());
- root.mAddNesting = 1;
- if (cih == null) {
- root.mCompatibilityInfo = new CompatibilityInfoHolder();
- } else {
- root.mCompatibilityInfo = cih;
- }
-
- view.setLayoutParams(wparams);
-
- if (mViews == null) {
- index = 1;
- mViews = new View[1];
- mRoots = new ViewRootImpl[1];
- mParams = new WindowManager.LayoutParams[1];
- } else {
- index = mViews.length + 1;
- Object[] old = mViews;
- mViews = new View[index];
- System.arraycopy(old, 0, mViews, 0, index-1);
- old = mRoots;
- mRoots = new ViewRootImpl[index];
- System.arraycopy(old, 0, mRoots, 0, index-1);
- old = mParams;
- mParams = new WindowManager.LayoutParams[index];
- System.arraycopy(old, 0, mParams, 0, index-1);
- }
- index--;
-
- mViews[index] = view;
- mRoots[index] = root;
- mParams[index] = wparams;
- }
- // do this last because it fires off messages to start doing things
- root.setView(view, wparams, panelParentView);
- }
-
- public void updateViewLayout(View view, ViewGroup.LayoutParams params) {
- if (!(params instanceof WindowManager.LayoutParams)) {
- throw new IllegalArgumentException("Params must be WindowManager.LayoutParams");
}
- final WindowManager.LayoutParams wparams
- = (WindowManager.LayoutParams)params;
-
- view.setLayoutParams(wparams);
-
- synchronized (this) {
- int index = findViewLocked(view, true);
+ private View removeViewLocked(int index, boolean immediate) {
ViewRootImpl root = mRoots[index];
- mParams[index] = wparams;
- root.setLayoutParams(wparams, false);
- }
- }
-
- public void removeView(View view) {
- synchronized (this) {
- int index = findViewLocked(view, true);
- View curView = removeViewLocked(index);
- if (curView == view) {
- return;
- }
-
- throw new IllegalStateException("Calling with view " + view
- + " but the ViewAncestor is attached to " + curView);
- }
- }
-
- public void removeViewImmediate(View view) {
- synchronized (this) {
- int index = findViewLocked(view, true);
- ViewRootImpl root = mRoots[index];
- View curView = root.getView();
-
- root.mAddNesting = 0;
+ View view = root.getView();
if (view != null) {
InputMethodManager imm = InputMethodManager.getInstance(view.getContext());
@@ -371,289 +379,191 @@
imm.windowDismissed(mViews[index].getWindowToken());
}
}
+ root.die(immediate);
- root.die(true);
- finishRemoveViewLocked(curView, index);
- if (curView == view) {
- return;
+ final int count = mViews.length;
+
+ // remove it from the list
+ View[] tmpViews = new View[count-1];
+ removeItem(tmpViews, mViews, index);
+ mViews = tmpViews;
+
+ ViewRootImpl[] tmpRoots = new ViewRootImpl[count-1];
+ removeItem(tmpRoots, mRoots, index);
+ mRoots = tmpRoots;
+
+ WindowManager.LayoutParams[] tmpParams
+ = new WindowManager.LayoutParams[count-1];
+ removeItem(tmpParams, mParams, index);
+ mParams = tmpParams;
+
+ if (view != null) {
+ view.assignParent(null);
+ // func doesn't allow null... does it matter if we clear them?
+ //view.setLayoutParams(null);
}
-
- throw new IllegalStateException("Calling with view " + view
- + " but the ViewAncestor is attached to " + curView);
- }
- }
-
- View removeViewLocked(int index) {
- ViewRootImpl root = mRoots[index];
- View view = root.getView();
-
- // Don't really remove until we have matched all calls to add().
- root.mAddNesting--;
- if (root.mAddNesting > 0) {
return view;
}
- if (view != null) {
- InputMethodManager imm = InputMethodManager.getInstance(view.getContext());
- if (imm != null) {
- imm.windowDismissed(mViews[index].getWindowToken());
- }
- }
- root.die(false);
- finishRemoveViewLocked(view, index);
- return view;
- }
-
- void finishRemoveViewLocked(View view, int index) {
- final int count = mViews.length;
-
- // remove it from the list
- View[] tmpViews = new View[count-1];
- removeItem(tmpViews, mViews, index);
- mViews = tmpViews;
-
- ViewRootImpl[] tmpRoots = new ViewRootImpl[count-1];
- removeItem(tmpRoots, mRoots, index);
- mRoots = tmpRoots;
-
- WindowManager.LayoutParams[] tmpParams
- = new WindowManager.LayoutParams[count-1];
- removeItem(tmpParams, mParams, index);
- mParams = tmpParams;
-
- if (view != null) {
- view.assignParent(null);
- // func doesn't allow null... does it matter if we clear them?
- //view.setLayoutParams(null);
- }
- }
-
- public void closeAll(IBinder token, String who, String what) {
- synchronized (this) {
- if (mViews == null)
- return;
-
- int count = mViews.length;
- //Log.i("foo", "Closing all windows of " + token);
- for (int i=0; i<count; i++) {
- //Log.i("foo", "@ " + i + " token " + mParams[i].token
- // + " view " + mRoots[i].getView());
- if (token == null || mParams[i].token == token) {
- ViewRootImpl root = mRoots[i];
- root.mAddNesting = 1;
-
- //Log.i("foo", "Force closing " + root);
- if (who != null) {
- WindowLeaked leak = new WindowLeaked(
- what + " " + who + " has leaked window "
- + root.getView() + " that was originally added here");
- leak.setStackTrace(root.getLocation().getStackTrace());
- Log.e("WindowManager", leak.getMessage(), leak);
- }
-
- removeViewLocked(i);
- i--;
- count--;
+ private static void removeItem(Object[] dst, Object[] src, int index) {
+ if (dst.length > 0) {
+ if (index > 0) {
+ System.arraycopy(src, 0, dst, 0, index);
+ }
+ if (index < dst.length) {
+ System.arraycopy(src, index+1, dst, index, src.length-index-1);
}
}
}
- }
- /**
- * @param level See {@link android.content.ComponentCallbacks}
- *
- * @hide
- */
- public void startTrimMemory(int level) {
- if (HardwareRenderer.isAvailable()) {
- // On low-end gfx devices we trim when memory is moderate;
- // on high-end devices we do this when low.
- if (level >= ComponentCallbacks2.TRIM_MEMORY_COMPLETE
- || (level >= ComponentCallbacks2.TRIM_MEMORY_MODERATE
- && !ActivityManager.isHighEndGfx(getDefaultDisplay()))) {
- // Destroy all hardware surfaces and resources associated to
- // known windows
- synchronized (this) {
- if (mViews == null) return;
- int count = mViews.length;
- for (int i = 0; i < count; i++) {
- mRoots[i].terminateHardwareResources();
- }
- }
- // Force a full memory flush
- mNeedsEglTerminate = true;
- HardwareRenderer.startTrimMemory(ComponentCallbacks2.TRIM_MEMORY_COMPLETE);
- return;
- }
-
- HardwareRenderer.startTrimMemory(level);
- }
- }
-
- /**
- * @hide
- */
- public void endTrimMemory() {
- HardwareRenderer.endTrimMemory();
-
- if (mNeedsEglTerminate) {
- ManagedEGLContext.doTerminate();
- mNeedsEglTerminate = false;
- }
- }
-
- /**
- * @hide
- */
- public void trimLocalMemory() {
- synchronized (this) {
- if (mViews == null) return;
- int count = mViews.length;
- for (int i = 0; i < count; i++) {
- mRoots[i].destroyHardwareLayers();
- }
- }
- }
-
- /**
- * @hide
- */
- public void dumpGfxInfo(FileDescriptor fd) {
- FileOutputStream fout = new FileOutputStream(fd);
- PrintWriter pw = new PrintWriter(fout);
- try {
+ private int findViewLocked(View view, boolean required) {
synchronized (this) {
if (mViews != null) {
final int count = mViews.length;
-
- pw.println("Profile data in ms:");
-
for (int i = 0; i < count; i++) {
- ViewRootImpl root = mRoots[i];
- String name = getWindowName(root);
- pw.printf("\n\t%s", name);
-
- HardwareRenderer renderer = root.getView().mAttachInfo.mHardwareRenderer;
- if (renderer != null) {
- renderer.dumpGfxInfo(pw);
+ if (mViews[i] == view) {
+ return i;
}
}
+ }
+ if (required) {
+ throw new IllegalArgumentException("View not attached to window manager");
+ }
+ return -1;
+ }
+ }
- pw.println("\nView hierarchy:\n");
-
- int viewsCount = 0;
- int displayListsSize = 0;
- int[] info = new int[2];
-
- for (int i = 0; i < count; i++) {
- ViewRootImpl root = mRoots[i];
- root.dumpGfxInfo(info);
-
- String name = getWindowName(root);
- pw.printf(" %s\n %d views, %.2f kB of display lists",
- name, info[0], info[1] / 1024.0f);
- HardwareRenderer renderer = root.getView().mAttachInfo.mHardwareRenderer;
- if (renderer != null) {
- pw.printf(", %d frames rendered", renderer.getFrameCount());
+ public void startTrimMemory(int level) {
+ if (HardwareRenderer.isAvailable()) {
+ // On low-end gfx devices we trim when memory is moderate;
+ // on high-end devices we do this when low.
+ if (level >= ComponentCallbacks2.TRIM_MEMORY_COMPLETE
+ || (level >= ComponentCallbacks2.TRIM_MEMORY_MODERATE
+ && !ActivityManager.isHighEndGfx(mDefaultDisplay))) {
+ // Destroy all hardware surfaces and resources associated to
+ // known windows
+ synchronized (this) {
+ if (mViews == null) return;
+ int count = mViews.length;
+ for (int i = 0; i < count; i++) {
+ mRoots[i].terminateHardwareResources();
}
- pw.printf("\n\n");
-
- viewsCount += info[0];
- displayListsSize += info[1];
}
-
- pw.printf("\nTotal ViewRootImpl: %d\n", count);
- pw.printf("Total Views: %d\n", viewsCount);
- pw.printf("Total DisplayList: %.2f kB\n\n", displayListsSize / 1024.0f);
+ // Force a full memory flush
+ mNeedsEglTerminate = true;
+ HardwareRenderer.startTrimMemory(ComponentCallbacks2.TRIM_MEMORY_COMPLETE);
+ return;
}
+
+ HardwareRenderer.startTrimMemory(level);
}
- } finally {
- pw.flush();
- }
- }
+ }
- private static String getWindowName(ViewRootImpl root) {
- return root.mWindowAttributes.getTitle() + "/" +
- root.getClass().getName() + '@' + Integer.toHexString(root.hashCode());
- }
+ public void endTrimMemory() {
+ HardwareRenderer.endTrimMemory();
- public void setStoppedState(IBinder token, boolean stopped) {
- synchronized (this) {
- if (mViews == null)
- return;
- int count = mViews.length;
- for (int i=0; i<count; i++) {
- if (token == null || mParams[i].token == token) {
- ViewRootImpl root = mRoots[i];
- root.setStopped(stopped);
+ if (mNeedsEglTerminate) {
+ ManagedEGLContext.doTerminate();
+ mNeedsEglTerminate = false;
+ }
+ }
+
+ public void trimLocalMemory() {
+ synchronized (this) {
+ if (mViews == null) return;
+ int count = mViews.length;
+ for (int i = 0; i < count; i++) {
+ mRoots[i].destroyHardwareLayers();
}
}
}
- }
-
- public void reportNewConfiguration(Configuration config) {
- synchronized (this) {
- int count = mViews.length;
- config = new Configuration(config);
- for (int i=0; i<count; i++) {
- ViewRootImpl root = mRoots[i];
- root.requestUpdateConfiguration(config);
- }
- }
- }
- public WindowManager.LayoutParams getRootViewLayoutParameter(View view) {
- ViewParent vp = view.getParent();
- while (vp != null && !(vp instanceof ViewRootImpl)) {
- vp = vp.getParent();
- }
-
- if (vp == null) return null;
-
- ViewRootImpl vr = (ViewRootImpl)vp;
-
- int N = mRoots.length;
- for (int i = 0; i < N; ++i) {
- if (mRoots[i] == vr) {
- return mParams[i];
- }
- }
-
- return null;
- }
-
- public void closeAll() {
- closeAll(null, null, null);
- }
-
- public Display getDefaultDisplay() {
- return new Display(Display.DEFAULT_DISPLAY, null);
- }
+ public void dumpGfxInfo(FileDescriptor fd) {
+ FileOutputStream fout = new FileOutputStream(fd);
+ PrintWriter pw = new PrintWriter(fout);
+ try {
+ synchronized (this) {
+ if (mViews != null) {
+ final int count = mViews.length;
- private static void removeItem(Object[] dst, Object[] src, int index) {
- if (dst.length > 0) {
- if (index > 0) {
- System.arraycopy(src, 0, dst, 0, index);
- }
- if (index < dst.length) {
- System.arraycopy(src, index+1, dst, index, src.length-index-1);
+ pw.println("Profile data in ms:");
+
+ for (int i = 0; i < count; i++) {
+ ViewRootImpl root = mRoots[i];
+ String name = getWindowName(root);
+ pw.printf("\n\t%s", name);
+
+ HardwareRenderer renderer =
+ root.getView().mAttachInfo.mHardwareRenderer;
+ if (renderer != null) {
+ renderer.dumpGfxInfo(pw);
+ }
+ }
+
+ pw.println("\nView hierarchy:\n");
+
+ int viewsCount = 0;
+ int displayListsSize = 0;
+ int[] info = new int[2];
+
+ for (int i = 0; i < count; i++) {
+ ViewRootImpl root = mRoots[i];
+ root.dumpGfxInfo(info);
+
+ String name = getWindowName(root);
+ pw.printf(" %s\n %d views, %.2f kB of display lists",
+ name, info[0], info[1] / 1024.0f);
+ HardwareRenderer renderer =
+ root.getView().mAttachInfo.mHardwareRenderer;
+ if (renderer != null) {
+ pw.printf(", %d frames rendered", renderer.getFrameCount());
+ }
+ pw.printf("\n\n");
+
+ viewsCount += info[0];
+ displayListsSize += info[1];
+ }
+
+ pw.printf("\nTotal ViewRootImpl: %d\n", count);
+ pw.printf("Total Views: %d\n", viewsCount);
+ pw.printf("Total DisplayList: %.2f kB\n\n", displayListsSize / 1024.0f);
+ }
+ }
+ } finally {
+ pw.flush();
}
}
- }
- private int findViewLocked(View view, boolean required) {
- synchronized (this) {
- final int count = mViews != null ? mViews.length : 0;
- for (int i=0; i<count; i++) {
- if (mViews[i] == view) {
- return i;
+ private static String getWindowName(ViewRootImpl root) {
+ return root.mWindowAttributes.getTitle() + "/" +
+ root.getClass().getName() + '@' + Integer.toHexString(root.hashCode());
+ }
+
+ public void setStoppedState(IBinder token, boolean stopped) {
+ synchronized (this) {
+ if (mViews != null) {
+ int count = mViews.length;
+ for (int i=0; i < count; i++) {
+ if (token == null || mParams[i].token == token) {
+ ViewRootImpl root = mRoots[i];
+ root.setStopped(stopped);
+ }
+ }
}
}
- if (required) {
- throw new IllegalArgumentException(
- "View not attached to window manager");
+ }
+
+ public void reportNewConfiguration(Configuration config) {
+ synchronized (this) {
+ if (mViews != null) {
+ int count = mViews.length;
+ config = new Configuration(config);
+ for (int i=0; i < count; i++) {
+ ViewRootImpl root = mRoots[i];
+ root.requestUpdateConfiguration(config);
+ }
+ }
}
- return -1;
}
}
}
diff --git a/core/java/android/view/inputmethod/InputMethodManager.java b/core/java/android/view/inputmethod/InputMethodManager.java
index 8705d20..58f0b85 100644
--- a/core/java/android/view/inputmethod/InputMethodManager.java
+++ b/core/java/android/view/inputmethod/InputMethodManager.java
@@ -355,6 +355,9 @@
}
case MSG_BIND: {
final InputBindResult res = (InputBindResult)msg.obj;
+ if (DEBUG) {
+ Log.i(TAG, "handleMessage: MSG_BIND " + res.sequence + "," + res.id);
+ }
synchronized (mH) {
if (mBindSequence < 0 || mBindSequence != res.sequence) {
Log.w(TAG, "Ignoring onBind: cur seq=" + mBindSequence
@@ -371,6 +374,9 @@
}
case MSG_UNBIND: {
final int sequence = msg.arg1;
+ if (DEBUG) {
+ Log.i(TAG, "handleMessage: MSG_UNBIND " + sequence);
+ }
boolean startInput = false;
synchronized (mH) {
if (mBindSequence == sequence) {
@@ -403,6 +409,9 @@
}
case MSG_SET_ACTIVE: {
final boolean active = msg.arg1 != 0;
+ if (DEBUG) {
+ Log.i(TAG, "handleMessage: MSG_SET_ACTIVE " + active + ", was " + mActive);
+ }
synchronized (mH) {
mActive = active;
mFullscreenMode = false;
@@ -420,7 +429,16 @@
// Check focus again in case that "onWindowFocus" is called before
// handling this message.
if (mServedView != null && mServedView.hasWindowFocus()) {
- checkFocus(mHasBeenInactive);
+ // "finishComposingText" has been already called above. So we
+ // should not call mServedInputConnection.finishComposingText here.
+ // Also, please note that this handler thread could be different
+ // from a thread that created mServedView. That could happen
+ // the current activity is running in the system process.
+ // In that case, we really should not call
+ // mServedInputConnection.finishComposingText.
+ if (checkFocusNoStartInput(mHasBeenInactive, false)) {
+ startInputInner(null, 0, 0, 0);
+ }
}
}
}
@@ -1231,20 +1249,16 @@
}
}
- private void checkFocus(boolean forceNewFocus) {
- if (checkFocusNoStartInput(forceNewFocus)) {
- startInputInner(null, 0, 0, 0);
- }
- }
-
/**
* @hide
*/
public void checkFocus() {
- checkFocus(false);
+ if (checkFocusNoStartInput(false, true)) {
+ startInputInner(null, 0, 0, 0);
+ }
}
- private boolean checkFocusNoStartInput(boolean forceNewFocus) {
+ private boolean checkFocusNoStartInput(boolean forceNewFocus, boolean finishComposingText) {
// This is called a lot, so short-circuit before locking.
if (mServedView == mNextServedView && !forceNewFocus) {
return false;
@@ -1278,7 +1292,7 @@
mServedConnecting = true;
}
- if (ic != null) {
+ if (finishComposingText && ic != null) {
ic.finishComposingText();
}
@@ -1323,7 +1337,7 @@
controlFlags |= CONTROL_WINDOW_FIRST;
}
- if (checkFocusNoStartInput(forceNewFocus)) {
+ if (checkFocusNoStartInput(forceNewFocus, true)) {
// We need to restart input on the current focus view. This
// should be done in conjunction with telling the system service
// about the window gaining focus, to help make the transition
diff --git a/core/java/android/webkit/HttpAuthHandler.java b/core/java/android/webkit/HttpAuthHandler.java
index 2fbd1d0..b3571aaa 100644
--- a/core/java/android/webkit/HttpAuthHandler.java
+++ b/core/java/android/webkit/HttpAuthHandler.java
@@ -19,9 +19,11 @@
import android.os.Handler;
/**
- * HTTP authentication request that must be handled by the user interface.
- * WebView creates the object and hands it to the current {@link WebViewClient},
- * which must call either {@link #proceed(String, String)} or {@link #cancel()}.
+ * Represents a request for HTTP authentication. Instances of this class are
+ * created by the WebView and passed to
+ * {@link WebViewClient#onReceivedHttpAuthRequest}. The host application must
+ * call either {@link #proceed} or {@link #cancel} to set the WebView's
+ * response to the request.
*/
public class HttpAuthHandler extends Handler {
@@ -32,27 +34,36 @@
}
/**
- * @return True if we can use user credentials on record
- * (ie, if we did not fail trying to use them last time)
+ * Gets whether the credentials stored for the current host (i.e. the host
+ * for which {@link WebViewClient#onReceivedHttpAuthRequest} was called)
+ * are suitable for use. Credentials are not suitable if they have
+ * previously been rejected by the server for the current request.
+ *
+ * @return whether the credentials are suitable for use
+ * @see Webview#getHttpAuthUsernamePassword
*/
public boolean useHttpAuthUsernamePassword() {
return false;
}
/**
- * Cancel the authorization request.
+ * Instructs the WebView to cancel the authentication request.
*/
public void cancel() {
}
/**
- * Proceed with the authorization with the given credentials.
+ * Instructs the WebView to proceed with the authentication with the given
+ * credentials. Credentials for use with this method can be retrieved from
+ * the WebView's store using {@link WebView#getHttpAuthUsernamePassword}.
*/
public void proceed(String username, String password) {
}
/**
- * return true if the prompt dialog should be suppressed.
+ * Gets whether the prompt dialog should be suppressed.
+ *
+ * @return whether the prompt dialog should be suppressed
* @hide
*/
public boolean suppressDialog() {
diff --git a/core/java/android/webkit/JWebCoreJavaBridge.java b/core/java/android/webkit/JWebCoreJavaBridge.java
index e6eaa14..d9aeb70 100644
--- a/core/java/android/webkit/JWebCoreJavaBridge.java
+++ b/core/java/android/webkit/JWebCoreJavaBridge.java
@@ -89,6 +89,7 @@
private void fireSharedTimer() {
// clear the flag so that sharedTimerFired() can set a new timer
mHasInstantTimer = false;
+ removeMessages(TIMER_MESSAGE);
sharedTimerFired();
}
diff --git a/core/java/android/webkit/WebSettings.java b/core/java/android/webkit/WebSettings.java
index 1a868d5..7a67a14 100644
--- a/core/java/android/webkit/WebSettings.java
+++ b/core/java/android/webkit/WebSettings.java
@@ -199,6 +199,26 @@
}
/**
+ * Sets whether the WebView requires a user gesture to play media.
+ * The default is true.
+ *
+ * @param require whether the WebView requires a user gesture to play media
+ */
+ public void setMediaPlaybackRequiresUserGesture(boolean require) {
+ throw new MustOverrideException();
+ }
+
+ /**
+ * Gets whether the WebView requires a user gesture to play media.
+ *
+ * @return true if the WebView requires a user gesture to play media
+ * @see #setMediaPlaybackRequiresUserGesture
+ */
+ public boolean getMediaPlaybackRequiresUserGesture() {
+ throw new MustOverrideException();
+ }
+
+ /**
* Sets whether the WebView should use its built-in zoom mechanisms. The
* built-in zoom mechanisms comprise on-screen zoom controls, which are
* displayed over the WebView's content, and the use of a pinch gesture to
diff --git a/core/java/android/webkit/WebSettingsClassic.java b/core/java/android/webkit/WebSettingsClassic.java
index 1288613..66651f7 100644
--- a/core/java/android/webkit/WebSettingsClassic.java
+++ b/core/java/android/webkit/WebSettingsClassic.java
@@ -34,7 +34,7 @@
*/
public class WebSettingsClassic extends WebSettings {
// TODO: Keep this up to date
- private static final String PREVIOUS_VERSION = "4.0.4";
+ private static final String PREVIOUS_VERSION = "4.1.1";
// WebView associated with this WebSettings.
private WebViewClassic mWebView;
@@ -116,6 +116,7 @@
private boolean mNeedInitialFocus = true;
private boolean mNavDump = false;
private boolean mSupportZoom = true;
+ private boolean mMediaPlaybackRequiresUserGesture = true;
private boolean mBuiltInZoomControls = false;
private boolean mDisplayZoomControls = true;
private boolean mAllowFileAccess = true;
@@ -459,6 +460,25 @@
}
/**
+ * @see android.webkit.WebSettings#setMediaPlaybackRequiresUserGesture(boolean)
+ */
+ @Override
+ public void setMediaPlaybackRequiresUserGesture(boolean support) {
+ if (mMediaPlaybackRequiresUserGesture != support) {
+ mMediaPlaybackRequiresUserGesture = support;
+ postSync();
+ }
+ }
+
+ /**
+ * @see android.webkit.WebSettings#getMediaPlaybackRequiresUserGesture()
+ */
+ @Override
+ public boolean getMediaPlaybackRequiresUserGesture() {
+ return mMediaPlaybackRequiresUserGesture;
+ }
+
+ /**
* @see android.webkit.WebSettings#setBuiltInZoomControls(boolean)
*/
@Override
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java
index 7691f00..17592e8 100644
--- a/core/java/android/webkit/WebView.java
+++ b/core/java/android/webkit/WebView.java
@@ -333,16 +333,12 @@
@Deprecated
public interface PictureListener {
/**
- * Notifies the listener that the picture has changed.
+ * Used to provide notification that the WebView's picture has changed.
+ * See {@link WebView#capturePicture} for details of the picture.
*
* @param view the WebView that owns the picture
* @param picture the new picture
- * @deprecated Due to internal changes, the picture does not include
- * composited layers such as fixed position elements or
- * scrollable divs. While the PictureListener API can still
- * be used to detect changes in the WebView content, you
- * are advised against its usage until a replacement is
- * provided in a future Android release.
+ * @deprecated Deprecated due to internal changes.
*/
@Deprecated
public void onNewPicture(WebView view, Picture picture);
@@ -586,12 +582,16 @@
//-------------------------------------------------------------------------
/**
- * Saves the username and password for a particular host in this WebView's
- * internal database.
+ * Sets a username and password pair for the specified host. This data is
+ * used by the Webview to autocomplete username and password fields in web
+ * forms. Note that this is unrelated to the credentials used for HTTP
+ * authentication.
*
* @param host the host that required the credentials
* @param username the username for the given host
* @param password the password for the given host
+ * @see WebViewDatabase#clearUsernamePassword
+ * @see WebViewDatabase#hasUsernamePassword
*/
public void savePassword(String host, String username, String password) {
checkThread();
@@ -599,13 +599,17 @@
}
/**
- * Sets the HTTP authentication credentials for a given host and realm.
+ * Stores HTTP authentication credentials for a given host and realm. This
+ * method is intended to be used with
+ * {@link WebViewClient#onReceivedHttpAuthRequest}.
*
- * @param host the host for the credentials
- * @param realm the realm for the credentials
- * @param username the username for the password. If it is null, it means
- * password can't be saved.
+ * @param host the host to which the credentials apply
+ * @param realm the realm to which the credentials apply
+ * @param username the username
* @param password the password
+ * @see getHttpAuthUsernamePassword
+ * @see WebViewDatabase#hasHttpAuthUsernamePassword
+ * @see WebViewDatabase#clearHttpAuthUsernamePassword
*/
public void setHttpAuthUsernamePassword(String host, String realm,
String username, String password) {
@@ -614,13 +618,18 @@
}
/**
- * Retrieves the HTTP authentication username and password for a given
- * host and realm pair
+ * Retrieves HTTP authentication credentials for a given host and realm.
+ * This method is intended to be used with
+ * {@link WebViewClient#onReceivedHttpAuthRequest}.
*
- * @param host the host for which the credentials apply
- * @param realm the realm for which the credentials apply
- * @return String[] if found. String[0] is username, which can be null and
- * String[1] is password. Return null if it can't find anything.
+ * @param host the host to which the credentials apply
+ * @param realm the realm to which the credentials apply
+ * @return the credentials as a String array, if found. The first element
+ * is the username and the second element is the password. Null if
+ * no credentials are found.
+ * @see setHttpAuthUsernamePassword
+ * @see WebViewDatabase#hasHttpAuthUsernamePassword
+ * @see WebViewDatabase#clearHttpAuthUsernamePassword
*/
public String[] getHttpAuthUsernamePassword(String host, String realm) {
checkThread();
@@ -987,13 +996,18 @@
}
/**
- * Gets a new picture that captures the current display of this WebView.
- * This is a copy of the display, and will be unaffected if this WebView
- * later loads a different URL.
+ * Gets a new picture that captures the current contents of this WebView.
+ * The picture is of the entire document being displayed, and is not
+ * limited to the area currently displayed by this WebView. Also, the
+ * picture is a static copy and is unaffected by later changes to the
+ * content being displayed.
+ * <p>
+ * Note that due to internal changes, for API levels between
+ * {@link android.os.Build.VERSION_CODES#HONEYCOMB} and
+ * {@link android.os.Build.VERSION_CODES#ICE_CREAM_SANDWICH} inclusive, the
+ * picture does not include fixed position elements or scrollable divs.
*
- * @return a picture containing the current contents of this WebView. Note
- * this picture is of the entire document, and is not restricted to
- * the bounds of the view.
+ * @return a picture that captures the current contents of this WebView
*/
public Picture capturePicture() {
checkThread();
@@ -1253,8 +1267,10 @@
}
/**
- * Makes sure that clearing the form data removes the adapter from the
- * currently focused textfield if there is one.
+ * Removes the autocomplete popup from the currently focused form field, if
+ * present. Note this only affects the display of the autocomplete popup,
+ * it does not remove any saved form data from this WebView's store. To do
+ * that, use {@link WebViewDatabase#clearFormData}.
*/
public void clearFormData() {
checkThread();
diff --git a/core/java/android/webkit/WebViewClient.java b/core/java/android/webkit/WebViewClient.java
index 64a5918..08a046a 100644
--- a/core/java/android/webkit/WebViewClient.java
+++ b/core/java/android/webkit/WebViewClient.java
@@ -204,14 +204,16 @@
}
/**
- * Notify the host application to handle an authentication request. The
- * default behavior is to cancel the request.
+ * Notifies the host application that the WebView received an HTTP
+ * authentication request. The host application can use the supplied
+ * {@link HttpAuthHandler} to set the WebView's response to the request.
+ * The default behavior is to cancel the request.
*
- * @param view The WebView that is initiating the callback.
- * @param handler The HttpAuthHandler that will handle the user's response.
- * @param host The host requiring authentication.
- * @param realm A description to help store user credentials for future
- * visits.
+ * @param view the WebView that is initiating the callback
+ * @param handler the HttpAuthHandler used to set the WebView's response
+ * @param host the host requiring authentication
+ * @param realm the realm for which authentication is required
+ * @see Webview#getHttpAuthUsernamePassword
*/
public void onReceivedHttpAuthRequest(WebView view,
HttpAuthHandler handler, String host, String realm) {
diff --git a/core/java/android/webkit/WebViewCore.java b/core/java/android/webkit/WebViewCore.java
index 40229af..59036e7 100644
--- a/core/java/android/webkit/WebViewCore.java
+++ b/core/java/android/webkit/WebViewCore.java
@@ -2197,12 +2197,20 @@
mEventHub.sendMessage(Message.obtain(null, EventHub.WEBKIT_DRAW));
}
m_skipDrawFlag = false;
+ m_skipDrawFlagLock.notify();
}
}
private void webkitDraw() {
synchronized (m_skipDrawFlagLock) {
if (m_skipDrawFlag) {
+ try {
+ // Aggressively throttle webkit to give the UI more CPU
+ // to catch up with
+ m_skipDrawFlagLock.wait(50);
+ } catch (InterruptedException e) {}
+ }
+ if (m_skipDrawFlag) {
m_drawWasSkipped = true;
return;
}
diff --git a/core/java/android/webkit/WebViewDatabase.java b/core/java/android/webkit/WebViewDatabase.java
index 9d10d67..1987f53 100644
--- a/core/java/android/webkit/WebViewDatabase.java
+++ b/core/java/android/webkit/WebViewDatabase.java
@@ -23,7 +23,7 @@
* application has stored any of the following types of browsing data and
* to clear any such stored data for all WebViews in the application.
* <ul>
- * <li>Username/password pairs entered into web forms</li>
+ * <li>Username/password pairs for web forms</li>
* <li>HTTP authentication username/password pairs</li>
* <li>Data entered into text fields (e.g. for autocomplete suggestions)</li>
* </ul>
@@ -43,50 +43,65 @@
}
/**
- * Gets whether there are any username/password combinations
- * from web pages saved.
+ * Gets whether there are any saved username/password pairs for web forms.
+ * Note that these are unrelated to HTTP authentication credentials.
*
- * @return true if there are any username/passwords used in web
- * forms saved
+ * @return true if there are any saved username/password pairs
+ * @see WebView#savePassword
+ * @see clearUsernamePassword
*/
public boolean hasUsernamePassword() {
throw new MustOverrideException();
}
/**
- * Clears any username/password combinations saved from web forms.
+ * Clears any saved username/password pairs for web forms.
+ * Note that these are unrelated to HTTP authentication credentials.
+ *
+ * @see WebView#savePassword
+ * @see hasUsernamePassword
*/
public void clearUsernamePassword() {
throw new MustOverrideException();
}
/**
- * Gets whether there are any HTTP authentication username/password combinations saved.
+ * Gets whether there are any saved credentials for HTTP authentication.
*
- * @return true if there are any HTTP authentication username/passwords saved
+ * @return whether there are any saved credentials
+ * @see Webview#getHttpAuthUsernamePassword
+ * @see Webview#setHttpAuthUsernamePassword
+ * @see clearHttpAuthUsernamePassword
*/
public boolean hasHttpAuthUsernamePassword() {
throw new MustOverrideException();
}
/**
- * Clears any HTTP authentication username/passwords that are saved.
+ * Clears any saved credentials for HTTP authentication.
+ *
+ * @see Webview#getHttpAuthUsernamePassword
+ * @see Webview#setHttpAuthUsernamePassword
+ * @see hasHttpAuthUsernamePassword
*/
public void clearHttpAuthUsernamePassword() {
throw new MustOverrideException();
}
/**
- * Gets whether there is any previously-entered form data saved.
+ * Gets whether there is any saved data for web forms.
*
- * @return true if there is form data saved
+ * @return whether there is any saved data for web forms
+ * @see clearFormData
*/
public boolean hasFormData() {
throw new MustOverrideException();
}
/**
- * Clears any stored previously-entered form data.
+ * Clears any saved data for web forms.
+ *
+ * @see hasFormData
*/
public void clearFormData() {
throw new MustOverrideException();
diff --git a/core/java/android/webkit/WebViewFactory.java b/core/java/android/webkit/WebViewFactory.java
index 73ae910..2fc9b39 100644
--- a/core/java/android/webkit/WebViewFactory.java
+++ b/core/java/android/webkit/WebViewFactory.java
@@ -16,14 +16,23 @@
package android.webkit;
+import android.os.Build;
+import android.os.StrictMode;
+import android.os.SystemProperties;
import android.util.Log;
+import dalvik.system.PathClassLoader;
+
/**
* Top level factory, used creating all the main WebView implementation classes.
*/
class WebViewFactory {
// Default Provider factory class name.
- private static final String DEFAULT_WEB_VIEW_FACTORY = "android.webkit.WebViewClassic$Factory";
+ // TODO: When the Chromium powered WebView is ready, it should be the default factory class.
+ private static final String DEFAULT_WEBVIEW_FACTORY = "android.webkit.WebViewClassic$Factory";
+ private static final String CHROMIUM_WEBVIEW_FACTORY =
+ "com.android.webviewchromium.WebViewChromiumFactoryProvider";
+ private static final String CHROMIUM_WEBVIEW_JAR = "/system/framework/webviewchromium.jar";
private static final String LOGTAG = "WebViewFactory";
@@ -38,18 +47,45 @@
// us honest and minimize usage of WebViewClassic internals when binding the proxy.
if (sProviderInstance != null) return sProviderInstance;
- sProviderInstance = getFactoryByName(DEFAULT_WEB_VIEW_FACTORY);
+ // For debug builds, we allow a system property to specify that we should use the
+ // Chromium powered WebView. This enables us to switch between implementations
+ // at runtime. For user (release) builds, don't allow this.
+ if (Build.IS_DEBUGGABLE && SystemProperties.getBoolean("webview.use_chromium", false)) {
+ StrictMode.ThreadPolicy oldPolicy = StrictMode.allowThreadDiskReads();
+ try {
+ sProviderInstance = loadChromiumProvider();
+ if (DEBUG) Log.v(LOGTAG, "Loaded Chromium provider: " + sProviderInstance);
+ } finally {
+ StrictMode.setThreadPolicy(oldPolicy);
+ }
+ }
+
if (sProviderInstance == null) {
- if (DEBUG) Log.v(LOGTAG, "Falling back to explicit linkage");
- sProviderInstance = new WebViewClassic.Factory();
+ if (DEBUG) Log.v(LOGTAG, "Falling back to default provider: "
+ + DEFAULT_WEBVIEW_FACTORY);
+ sProviderInstance = getFactoryByName(DEFAULT_WEBVIEW_FACTORY,
+ WebViewFactory.class.getClassLoader());
+ if (sProviderInstance == null) {
+ if (DEBUG) Log.v(LOGTAG, "Falling back to explicit linkage");
+ sProviderInstance = new WebViewClassic.Factory();
+ }
}
return sProviderInstance;
}
- private static WebViewFactoryProvider getFactoryByName(String providerName) {
+ // TODO: This allows us to have the legacy and Chromium WebView coexist for development
+ // and side-by-side testing. After transition, remove this when no longer required.
+ private static WebViewFactoryProvider loadChromiumProvider() {
+ ClassLoader clazzLoader = new PathClassLoader(CHROMIUM_WEBVIEW_JAR, null,
+ WebViewFactory.class.getClassLoader());
+ return getFactoryByName(CHROMIUM_WEBVIEW_FACTORY, clazzLoader);
+ }
+
+ private static WebViewFactoryProvider getFactoryByName(String providerName,
+ ClassLoader loader) {
try {
if (DEBUG) Log.v(LOGTAG, "attempt to load class " + providerName);
- Class<?> c = Class.forName(providerName);
+ Class<?> c = Class.forName(providerName, true, loader);
if (DEBUG) Log.v(LOGTAG, "instantiating factory");
return (WebViewFactoryProvider) c.newInstance();
} catch (ClassNotFoundException e) {
diff --git a/core/java/android/widget/CheckBox.java b/core/java/android/widget/CheckBox.java
index 858c415..6d292dc 100644
--- a/core/java/android/widget/CheckBox.java
+++ b/core/java/android/widget/CheckBox.java
@@ -20,6 +20,7 @@
import android.util.AttributeSet;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityNodeInfo;
+import android.util.ValueModel;
/**
@@ -55,7 +56,9 @@
* {@link android.R.styleable#View View Attributes}
* </p>
*/
-public class CheckBox extends CompoundButton {
+public class CheckBox extends CompoundButton implements ValueEditor<Boolean> {
+ private ValueModel<Boolean> mValueModel = ValueModel.EMPTY;
+
public CheckBox(Context context) {
this(context, null);
}
@@ -79,4 +82,22 @@
super.onInitializeAccessibilityNodeInfo(info);
info.setClassName(CheckBox.class.getName());
}
+
+ @Override
+ public ValueModel<Boolean> getValueModel() {
+ return mValueModel;
+ }
+
+ @Override
+ public void setValueModel(ValueModel<Boolean> valueModel) {
+ mValueModel = valueModel;
+ setChecked(mValueModel.get());
+ }
+
+ @Override
+ public boolean performClick() {
+ boolean handled = super.performClick();
+ mValueModel.set(isChecked());
+ return handled;
+ }
}
diff --git a/core/java/android/widget/EditText.java b/core/java/android/widget/EditText.java
index 2fd8768..8686177 100644
--- a/core/java/android/widget/EditText.java
+++ b/core/java/android/widget/EditText.java
@@ -17,6 +17,7 @@
package android.widget;
import android.content.Context;
+import android.graphics.Rect;
import android.text.Editable;
import android.text.Selection;
import android.text.Spannable;
@@ -24,6 +25,7 @@
import android.text.method.ArrowKeyMovementMethod;
import android.text.method.MovementMethod;
import android.util.AttributeSet;
+import android.util.ValueModel;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityNodeInfo;
@@ -47,7 +49,9 @@
* {@link android.R.styleable#TextView TextView Attributes},
* {@link android.R.styleable#View View Attributes}
*/
-public class EditText extends TextView {
+public class EditText extends TextView implements ValueEditor<CharSequence> {
+ private ValueModel<CharSequence> mValueModel = ValueModel.EMPTY;
+
public EditText(Context context) {
this(context, null);
}
@@ -128,4 +132,21 @@
super.onInitializeAccessibilityNodeInfo(info);
info.setClassName(EditText.class.getName());
}
+
+ @Override
+ public ValueModel<CharSequence> getValueModel() {
+ return mValueModel;
+ }
+
+ @Override
+ public void setValueModel(ValueModel<CharSequence> valueModel) {
+ mValueModel = valueModel;
+ setText(mValueModel.get());
+ }
+
+ @Override
+ void sendAfterTextChanged(Editable text) {
+ super.sendAfterTextChanged(text);
+ mValueModel.set(text);
+ }
}
diff --git a/core/java/android/widget/RelativeLayout.java b/core/java/android/widget/RelativeLayout.java
index 29cf000..d9bde10 100644
--- a/core/java/android/widget/RelativeLayout.java
+++ b/core/java/android/widget/RelativeLayout.java
@@ -149,8 +149,34 @@
* bounds of its RelativeLayout parent.
*/
public static final int CENTER_VERTICAL = 15;
+ /**
+ * Rule that aligns a child's end edge with another child's start edge.
+ */
+ public static final int START_OF = 16;
+ /**
+ * Rule that aligns a child's start edge with another child's end edge.
+ */
+ public static final int END_OF = 17;
+ /**
+ * Rule that aligns a child's start edge with another child's start edge.
+ */
+ public static final int ALIGN_START = 18;
+ /**
+ * Rule that aligns a child's end edge with another child's end edge.
+ */
+ public static final int ALIGN_END = 19;
+ /**
+ * Rule that aligns the child's start edge with its RelativeLayout
+ * parent's start edge.
+ */
+ public static final int ALIGN_PARENT_START = 20;
+ /**
+ * Rule that aligns the child's end edge with its RelativeLayout
+ * parent's end edge.
+ */
+ public static final int ALIGN_PARENT_END = 21;
- private static final int VERB_COUNT = 16;
+ private static final int VERB_COUNT = 22;
private static final int[] RULES_VERTICAL = {
@@ -158,13 +184,13 @@
};
private static final int[] RULES_HORIZONTAL = {
- LEFT_OF, RIGHT_OF, ALIGN_LEFT, ALIGN_RIGHT
+ LEFT_OF, RIGHT_OF, ALIGN_LEFT, ALIGN_RIGHT, START_OF, END_OF, ALIGN_START, ALIGN_END
};
private View mBaselineView = null;
private boolean mHasBaselineAlignedChild;
- private int mGravity = Gravity.LEFT | Gravity.TOP;
+ private int mGravity = Gravity.START | Gravity.TOP;
private final Rect mContentBounds = new Rect();
private final Rect mSelfBounds = new Rect();
private int mIgnoreGravity;
@@ -204,7 +230,7 @@
/**
* Defines which View is ignored when the gravity is applied. This setting has no
- * effect if the gravity is <code>Gravity.LEFT | Gravity.TOP</code>.
+ * effect if the gravity is <code>Gravity.START | Gravity.TOP</code>.
*
* @param viewId The id of the View to be ignored by gravity, or 0 if no View
* should be ignored.
@@ -234,7 +260,7 @@
/**
* Describes how the child views are positioned. Defaults to
- * <code>Gravity.LEFT | Gravity.TOP</code>.
+ * <code>Gravity.START | Gravity.TOP</code>.
*
* <p>Note that since RelativeLayout considers the positioning of each child
* relative to one another to be significant, setting gravity will affect
@@ -369,7 +395,7 @@
View ignore = null;
int gravity = mGravity & Gravity.RELATIVE_HORIZONTAL_GRAVITY_MASK;
- final boolean horizontalGravity = gravity != Gravity.LEFT && gravity != 0;
+ final boolean horizontalGravity = gravity != Gravity.START && gravity != 0;
gravity = mGravity & Gravity.VERTICAL_GRAVITY_MASK;
final boolean verticalGravity = gravity != Gravity.TOP && gravity != 0;
@@ -457,6 +483,8 @@
}
}
+ final int layoutDirection = getResolvedLayoutDirection();
+
if (isWrapContentWidth) {
// Width already has left padding in it since it was calculated by looking at
// the right of each child view
@@ -474,7 +502,7 @@
View child = getChildAt(i);
if (child.getVisibility() != GONE) {
LayoutParams params = (LayoutParams) child.getLayoutParams();
- final int[] rules = params.getRules();
+ final int[] rules = params.getRules(layoutDirection);
if (rules[CENTER_IN_PARENT] != 0 || rules[CENTER_HORIZONTAL] != 0) {
centerHorizontal(child, params, width);
} else if (rules[ALIGN_PARENT_RIGHT] != 0) {
@@ -504,7 +532,7 @@
View child = getChildAt(i);
if (child.getVisibility() != GONE) {
LayoutParams params = (LayoutParams) child.getLayoutParams();
- final int[] rules = params.getRules();
+ final int[] rules = params.getRules(layoutDirection);
if (rules[CENTER_IN_PARENT] != 0 || rules[CENTER_VERTICAL] != 0) {
centerVertical(child, params, height);
} else if (rules[ALIGN_PARENT_BOTTOM] != 0) {
@@ -523,7 +551,6 @@
height - mPaddingBottom);
final Rect contentBounds = mContentBounds;
- final int layoutDirection = getResolvedLayoutDirection();
Gravity.apply(mGravity, right - left, bottom - top, selfBounds, contentBounds,
layoutDirection);
@@ -551,7 +578,8 @@
}
private void alignBaseline(View child, LayoutParams params) {
- int[] rules = params.getRules();
+ final int layoutDirection = getResolvedLayoutDirection();
+ int[] rules = params.getRules(layoutDirection);
int anchorBaseline = getRelatedViewBaseline(rules, ALIGN_BASELINE);
if (anchorBaseline != -1) {
@@ -619,7 +647,7 @@
/**
* Get a measure spec that accounts for all of the constraints on this view.
- * This includes size contstraints imposed by the RelativeLayout as well as
+ * This includes size constraints imposed by the RelativeLayout as well as
* the View's desired dimension.
*
* @param childStart The left or top field of the child's layout params
@@ -672,7 +700,7 @@
childSpecSize = childSize;
}
} else if (childSize == LayoutParams.MATCH_PARENT) {
- // Child wanted to be as big as possible. Give all availble
+ // Child wanted to be as big as possible. Give all available
// space
childSpecMode = MeasureSpec.EXACTLY;
childSpecSize = maxAvailable;
@@ -681,7 +709,7 @@
// to communicate available space if we know
// our max size
if (maxAvailable >= 0) {
- // We have a maxmum size in this dimension.
+ // We have a maximum size in this dimension.
childSpecMode = MeasureSpec.AT_MOST;
childSpecSize = maxAvailable;
} else {
@@ -699,7 +727,9 @@
private boolean positionChildHorizontal(View child, LayoutParams params, int myWidth,
boolean wrapContent) {
- int[] rules = params.getRules();
+ final int layoutDirection = getResolvedLayoutDirection();
+ int[] rules = params.getRules(layoutDirection);
+ params.onResolveLayoutDirection(layoutDirection);
if (params.mLeft < 0 && params.mRight >= 0) {
// Right is fixed, but left varies
@@ -718,11 +748,18 @@
}
return true;
} else {
- params.mLeft = mPaddingLeft + params.leftMargin;
- params.mRight = params.mLeft + child.getMeasuredWidth();
+ // This is the default case. For RTL we start from the right and for LTR we start
+ // from the left. This will give LEFT/TOP for LTR and RIGHT/TOP for RTL.
+ if (isLayoutRtl()) {
+ params.mRight = myWidth - mPaddingRight- params.rightMargin;
+ params.mLeft = params.mRight - child.getMeasuredWidth();
+ } else {
+ params.mLeft = mPaddingLeft + params.leftMargin;
+ params.mRight = params.mLeft + child.getMeasuredWidth();
+ }
}
}
- return rules[ALIGN_PARENT_RIGHT] != 0;
+ return rules[ALIGN_PARENT_END] != 0;
}
private boolean positionChildVertical(View child, LayoutParams params, int myHeight,
@@ -755,7 +792,8 @@
}
private void applyHorizontalSizeRules(LayoutParams childParams, int myWidth) {
- int[] rules = childParams.getRules();
+ final int layoutDirection = getResolvedLayoutDirection();
+ int[] rules = childParams.getRules(layoutDirection);
RelativeLayout.LayoutParams anchorParams;
// -1 indicated a "soft requirement" in that direction. For example:
@@ -945,8 +983,8 @@
if (child.getVisibility() != GONE) {
RelativeLayout.LayoutParams st =
(RelativeLayout.LayoutParams) child.getLayoutParams();
+ st.onResolveLayoutDirection(getResolvedLayoutDirection());
child.layout(st.mLeft, st.mTop, st.mRight, st.mBottom);
-
}
}
}
@@ -1061,6 +1099,12 @@
* @attr ref android.R.styleable#RelativeLayout_Layout_layout_centerInParent
* @attr ref android.R.styleable#RelativeLayout_Layout_layout_centerHorizontal
* @attr ref android.R.styleable#RelativeLayout_Layout_layout_centerVertical
+ * @attr ref android.R.styleable#RelativeLayout_Layout_layout_toStartOf
+ * @attr ref android.R.styleable#RelativeLayout_Layout_layout_toEndOf
+ * @attr ref android.R.styleable#RelativeLayout_Layout_layout_alignStart
+ * @attr ref android.R.styleable#RelativeLayout_Layout_layout_alignEnd
+ * @attr ref android.R.styleable#RelativeLayout_Layout_layout_alignParentStart
+ * @attr ref android.R.styleable#RelativeLayout_Layout_layout_alignParentEnd
*/
public static class LayoutParams extends ViewGroup.MarginLayoutParams {
@ViewDebug.ExportedProperty(category = "layout", resolveId = true, indexMapping = {
@@ -1079,15 +1123,28 @@
@ViewDebug.IntToString(from = CENTER_IN_PARENT, to = "center"),
@ViewDebug.IntToString(from = CENTER_VERTICAL, to = "centerVertical"),
@ViewDebug.IntToString(from = LEFT_OF, to = "leftOf"),
- @ViewDebug.IntToString(from = RIGHT_OF, to = "rightOf")
+ @ViewDebug.IntToString(from = RIGHT_OF, to = "rightOf"),
+ @ViewDebug.IntToString(from = ALIGN_START, to = "alignStart"),
+ @ViewDebug.IntToString(from = ALIGN_END, to = "alignEnd"),
+ @ViewDebug.IntToString(from = ALIGN_PARENT_START, to = "alignParentStart"),
+ @ViewDebug.IntToString(from = ALIGN_PARENT_END, to = "alignParentEnd"),
+ @ViewDebug.IntToString(from = START_OF, to = "startOf"),
+ @ViewDebug.IntToString(from = END_OF, to = "endOf")
}, mapping = {
@ViewDebug.IntToString(from = TRUE, to = "true"),
@ViewDebug.IntToString(from = 0, to = "false/NO_ID")
})
+
private int[] mRules = new int[VERB_COUNT];
+ private int[] mInitialRules = new int[VERB_COUNT];
private int mLeft, mTop, mRight, mBottom;
+ private int mStart = DEFAULT_RELATIVE;
+ private int mEnd = DEFAULT_RELATIVE;
+
+ private boolean mRulesChanged = false;
+
/**
* When true, uses the parent as the anchor if the anchor doesn't exist or if
* the anchor's visibility is GONE.
@@ -1102,6 +1159,7 @@
com.android.internal.R.styleable.RelativeLayout_Layout);
final int[] rules = mRules;
+ final int[] initialRules = mInitialRules;
final int N = a.getIndexCount();
for (int i = 0; i < N; i++) {
@@ -1158,9 +1216,31 @@
case com.android.internal.R.styleable.RelativeLayout_Layout_layout_centerVertical:
rules[CENTER_VERTICAL] = a.getBoolean(attr, false) ? TRUE : 0;
break;
+ case com.android.internal.R.styleable.RelativeLayout_Layout_layout_toStartOf:
+ rules[START_OF] = a.getResourceId(attr, 0);
+ break;
+ case com.android.internal.R.styleable.RelativeLayout_Layout_layout_toEndOf:
+ rules[END_OF] = a.getResourceId(attr, 0);
+ break;
+ case com.android.internal.R.styleable.RelativeLayout_Layout_layout_alignStart:
+ rules[ALIGN_START] = a.getResourceId(attr, 0);
+ break;
+ case com.android.internal.R.styleable.RelativeLayout_Layout_layout_alignEnd:
+ rules[ALIGN_END] = a.getResourceId(attr, 0);
+ break;
+ case com.android.internal.R.styleable.RelativeLayout_Layout_layout_alignParentStart:
+ rules[ALIGN_PARENT_START] = a.getBoolean(attr, false) ? TRUE : 0;
+ break;
+ case com.android.internal.R.styleable.RelativeLayout_Layout_layout_alignParentEnd:
+ rules[ALIGN_PARENT_END] = a.getBoolean(attr, false) ? TRUE : 0;
+ break;
}
}
+ for (int n = LEFT_OF; n < VERB_COUNT; n++) {
+ initialRules[n] = rules[n];
+ }
+
a.recycle();
}
@@ -1192,7 +1272,7 @@
* Adds a layout rule to be interpreted by the RelativeLayout. This
* method should only be used for constraints that don't refer to another sibling
* (e.g., CENTER_IN_PARENT) or take a boolean value ({@link RelativeLayout#TRUE}
- * for true or - for false). To specify a verb that takes a subject, use
+ * for true or 0 for false). To specify a verb that takes a subject, use
* {@link #addRule(int, int)} instead.
*
* @param verb One of the verbs defined by
@@ -1202,6 +1282,8 @@
*/
public void addRule(int verb) {
mRules[verb] = TRUE;
+ mInitialRules[verb] = TRUE;
+ mRulesChanged = true;
}
/**
@@ -1220,12 +1302,73 @@
*/
public void addRule(int verb, int anchor) {
mRules[verb] = anchor;
+ mInitialRules[verb] = anchor;
+ mRulesChanged = true;
+ }
+
+ private boolean hasRelativeRules() {
+ return (mInitialRules[START_OF] != 0 || mInitialRules[END_OF] != 0 ||
+ mInitialRules[ALIGN_START] != 0 || mInitialRules[ALIGN_END] != 0 ||
+ mInitialRules[ALIGN_PARENT_START] != 0 || mInitialRules[ALIGN_PARENT_END] != 0);
+ }
+
+ private void resolveRules(int layoutDirection) {
+ final boolean isLayoutRtl = (layoutDirection == View.LAYOUT_DIRECTION_RTL);
+ // Reset to initial state
+ for (int n = LEFT_OF; n < VERB_COUNT; n++) {
+ mRules[n] = mInitialRules[n];
+ }
+ // Apply rules depending on direction
+ if (mRules[ALIGN_START] != 0) {
+ mRules[isLayoutRtl ? ALIGN_RIGHT : ALIGN_LEFT] = mRules[ALIGN_START];
+ }
+ if (mRules[ALIGN_END] != 0) {
+ mRules[isLayoutRtl ? ALIGN_LEFT : ALIGN_RIGHT] = mRules[ALIGN_END];
+ }
+ if (mRules[START_OF] != 0) {
+ mRules[isLayoutRtl ? RIGHT_OF : LEFT_OF] = mRules[START_OF];
+ }
+ if (mRules[END_OF] != 0) {
+ mRules[isLayoutRtl ? LEFT_OF : RIGHT_OF] = mRules[END_OF];
+ }
+ if (mRules[ALIGN_PARENT_START] != 0) {
+ mRules[isLayoutRtl ? ALIGN_PARENT_RIGHT : ALIGN_PARENT_LEFT] = mRules[ALIGN_PARENT_START];
+ }
+ if (mRules[ALIGN_PARENT_END] != 0) {
+ mRules[isLayoutRtl ? ALIGN_PARENT_LEFT : ALIGN_PARENT_RIGHT] = mRules[ALIGN_PARENT_END];
+ }
+ mRulesChanged = false;
}
/**
* Retrieves a complete list of all supported rules, where the index is the rule
* verb, and the element value is the value specified, or "false" if it was never
- * set.
+ * set. If there are relative rules defined (*_START / *_END), they will be resolved
+ * depending on the layout direction.
+ *
+ * @param layoutDirection the direction of the layout.
+ * Should be either {@link View#LAYOUT_DIRECTION_LTR}
+ * or {@link View#LAYOUT_DIRECTION_RTL}
+ * @return the supported rules
+ * @see #addRule(int, int)
+ *
+ * @hide
+ */
+ public int[] getRules(int layoutDirection) {
+ if (hasRelativeRules() &&
+ (mRulesChanged || layoutDirection != getLayoutDirection())) {
+ resolveRules(layoutDirection);
+ if (layoutDirection != getLayoutDirection()) {
+ setLayoutDirection(layoutDirection);
+ }
+ }
+ return mRules;
+ }
+
+ /**
+ * Retrieves a complete list of all supported rules, where the index is the rule
+ * verb, and the element value is the value specified, or "false" if it was never
+ * set. There will be no resolution of relative rules done.
*
* @return the supported rules
* @see #addRule(int, int)
@@ -1233,6 +1376,24 @@
public int[] getRules() {
return mRules;
}
+
+ @Override
+ public void onResolveLayoutDirection(int layoutDirection) {
+ final boolean isLayoutRtl = isLayoutRtl();
+ if (isLayoutRtl) {
+ if (mStart != DEFAULT_RELATIVE) mRight = mStart;
+ if (mEnd != DEFAULT_RELATIVE) mLeft = mEnd;
+ } else {
+ if (mStart != DEFAULT_RELATIVE) mLeft = mStart;
+ if (mEnd != DEFAULT_RELATIVE) mRight = mEnd;
+ }
+
+ if (hasRelativeRules() && layoutDirection != getLayoutDirection()) {
+ resolveRules(layoutDirection);
+ }
+ // This will set the layout direction
+ super.onResolveLayoutDirection(layoutDirection);
+ }
}
private static class DependencyGraph {
diff --git a/core/java/android/widget/SeekBar.java b/core/java/android/widget/SeekBar.java
index 2737f94..a6486a8 100644
--- a/core/java/android/widget/SeekBar.java
+++ b/core/java/android/widget/SeekBar.java
@@ -18,6 +18,7 @@
import android.content.Context;
import android.util.AttributeSet;
+import android.util.ValueModel;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityNodeInfo;
@@ -33,7 +34,7 @@
*
* @attr ref android.R.styleable#SeekBar_thumb
*/
-public class SeekBar extends AbsSeekBar {
+public class SeekBar extends AbsSeekBar implements ValueEditor<Integer> {
/**
* A callback that notifies clients when the progress level has been
@@ -69,8 +70,9 @@
void onStopTrackingTouch(SeekBar seekBar);
}
+ private ValueModel<Integer> mValueModel = ValueModel.EMPTY;
private OnSeekBarChangeListener mOnSeekBarChangeListener;
-
+
public SeekBar(Context context) {
this(context, null);
}
@@ -89,9 +91,23 @@
if (mOnSeekBarChangeListener != null) {
mOnSeekBarChangeListener.onProgressChanged(this, getProgress(), fromUser);
+ if (fromUser) {
+ mValueModel.set(getProgress());
+ }
}
}
+ @Override
+ public ValueModel<Integer> getValueModel() {
+ return mValueModel;
+ }
+
+ @Override
+ public void setValueModel(ValueModel<Integer> valueModel) {
+ mValueModel = valueModel;
+ setProgress(mValueModel.get());
+ }
+
/**
* Sets a listener to receive notifications of changes to the SeekBar's progress level. Also
* provides notifications of when the user starts and stops a touch gesture within the SeekBar.
diff --git a/core/java/android/widget/ValueEditor.java b/core/java/android/widget/ValueEditor.java
new file mode 100755
index 0000000..2b91abf
--- /dev/null
+++ b/core/java/android/widget/ValueEditor.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.widget;
+
+import android.util.ValueModel;
+
+/**
+ * An interface for editors of simple values. Classes implementing this interface are normally
+ * UI controls (subclasses of {@link android.view.View View}) that can provide a suitable
+ * user interface to display and edit values of the specified type. This interface is
+ * intended to describe editors for simple types, like {@code boolean}, {@code int} or
+ * {@code String}, where the values themselves are immutable.
+ * <p>
+ * For example, {@link android.widget.CheckBox CheckBox} implements
+ * this interface for the Boolean type as it is capable of providing an appropriate
+ * mechanism for displaying and changing the value of a Boolean property.
+ *
+ * @param <T> the value type that this editor supports
+ */
+public interface ValueEditor<T> {
+ /**
+ * Return the last value model that was set. If no value model has been set, the editor
+ * should return the value {@link android.util.ValueModel#EMPTY}.
+ *
+ * @return the value model
+ */
+ public ValueModel<T> getValueModel();
+
+ /**
+ * Sets the value model for this editor. When the value model is set, the editor should
+ * retrieve the value from the value model, using {@link android.util.ValueModel#get()},
+ * and set its internal state accordingly. Likewise, when the editor's internal state changes
+ * it should update the value model by calling {@link android.util.ValueModel#set(T)}
+ * with the appropriate value.
+ *
+ * @param valueModel the new value model for this editor.
+ */
+ public void setValueModel(ValueModel<T> valueModel);
+}
diff --git a/core/java/com/android/internal/app/ResolverActivity.java b/core/java/com/android/internal/app/ResolverActivity.java
index 7334ac3..84fe8ce 100644
--- a/core/java/com/android/internal/app/ResolverActivity.java
+++ b/core/java/com/android/internal/app/ResolverActivity.java
@@ -76,6 +76,7 @@
private int mIconDpi;
private int mIconSize;
private int mMaxColumns;
+ private int mLastSelected = GridView.INVALID_POSITION;
private boolean mRegistered;
private final PackageMonitor mPackageMonitor = new PackageMonitor() {
@@ -247,6 +248,7 @@
if (mAlwaysUseOption) {
final int checkedPos = mGrid.getCheckedItemPosition();
final boolean enabled = checkedPos != GridView.INVALID_POSITION;
+ mLastSelected = checkedPos;
mAlwaysButton.setEnabled(enabled);
mOnceButton.setEnabled(enabled);
if (enabled) {
@@ -257,14 +259,15 @@
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
- if (mAlwaysUseOption) {
- final int checkedPos = mGrid.getCheckedItemPosition();
- final boolean enabled = checkedPos != GridView.INVALID_POSITION;
- mAlwaysButton.setEnabled(enabled);
- mOnceButton.setEnabled(enabled);
- if (enabled) {
+ final int checkedPos = mGrid.getCheckedItemPosition();
+ final boolean hasValidSelection = checkedPos != GridView.INVALID_POSITION;
+ if (mAlwaysUseOption && (!hasValidSelection || mLastSelected != checkedPos)) {
+ mAlwaysButton.setEnabled(hasValidSelection);
+ mOnceButton.setEnabled(hasValidSelection);
+ if (hasValidSelection) {
mGrid.smoothScrollToPosition(checkedPos);
}
+ mLastSelected = checkedPos;
} else {
startSelected(position, false);
}
@@ -371,7 +374,8 @@
void showAppDetails(ResolveInfo ri) {
Intent in = new Intent().setAction("android.settings.APPLICATION_DETAILS_SETTINGS")
- .setData(Uri.fromParts("package", ri.activityInfo.packageName, null));
+ .setData(Uri.fromParts("package", ri.activityInfo.packageName, null))
+ .addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
startActivity(in);
}
diff --git a/core/java/com/android/internal/net/VpnProfile.java b/core/java/com/android/internal/net/VpnProfile.java
new file mode 100644
index 0000000..154b16b
--- /dev/null
+++ b/core/java/com/android/internal/net/VpnProfile.java
@@ -0,0 +1,123 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.internal.net;
+
+import java.nio.charset.Charsets;
+
+/**
+ * Parcel-like entity class for VPN profiles. To keep things simple, all
+ * fields are package private. Methods are provided for serialization, so
+ * storage can be implemented easily. Two rules are set for this class.
+ * First, all fields must be kept non-null. Second, always make a copy
+ * using clone() before modifying.
+ *
+ * @hide
+ */
+public class VpnProfile implements Cloneable {
+ // Match these constants with R.array.vpn_types.
+ public static final int TYPE_PPTP = 0;
+ public static final int TYPE_L2TP_IPSEC_PSK = 1;
+ public static final int TYPE_L2TP_IPSEC_RSA = 2;
+ public static final int TYPE_IPSEC_XAUTH_PSK = 3;
+ public static final int TYPE_IPSEC_XAUTH_RSA = 4;
+ public static final int TYPE_IPSEC_HYBRID_RSA = 5;
+ public static final int TYPE_MAX = 5;
+
+ // Entity fields.
+ public final String key; // -1
+ public String name = ""; // 0
+ public int type = TYPE_PPTP; // 1
+ public String server = ""; // 2
+ public String username = ""; // 3
+ public String password = ""; // 4
+ public String dnsServers = ""; // 5
+ public String searchDomains = ""; // 6
+ public String routes = ""; // 7
+ public boolean mppe = true; // 8
+ public String l2tpSecret = ""; // 9
+ public String ipsecIdentifier = "";// 10
+ public String ipsecSecret = ""; // 11
+ public String ipsecUserCert = ""; // 12
+ public String ipsecCaCert = ""; // 13
+ public String ipsecServerCert = "";// 14
+
+ // Helper fields.
+ public boolean saveLogin = false;
+
+ public VpnProfile(String key) {
+ this.key = key;
+ }
+
+ public static VpnProfile decode(String key, byte[] value) {
+ try {
+ if (key == null) {
+ return null;
+ }
+
+ String[] values = new String(value, Charsets.UTF_8).split("\0", -1);
+ // There can be 14 or 15 values in ICS MR1.
+ if (values.length < 14 || values.length > 15) {
+ return null;
+ }
+
+ VpnProfile profile = new VpnProfile(key);
+ profile.name = values[0];
+ profile.type = Integer.valueOf(values[1]);
+ if (profile.type < 0 || profile.type > TYPE_MAX) {
+ return null;
+ }
+ profile.server = values[2];
+ profile.username = values[3];
+ profile.password = values[4];
+ profile.dnsServers = values[5];
+ profile.searchDomains = values[6];
+ profile.routes = values[7];
+ profile.mppe = Boolean.valueOf(values[8]);
+ profile.l2tpSecret = values[9];
+ profile.ipsecIdentifier = values[10];
+ profile.ipsecSecret = values[11];
+ profile.ipsecUserCert = values[12];
+ profile.ipsecCaCert = values[13];
+ profile.ipsecServerCert = (values.length > 14) ? values[14] : "";
+
+ profile.saveLogin = !profile.username.isEmpty() || !profile.password.isEmpty();
+ return profile;
+ } catch (Exception e) {
+ // ignore
+ }
+ return null;
+ }
+
+ public byte[] encode() {
+ StringBuilder builder = new StringBuilder(name);
+ builder.append('\0').append(type);
+ builder.append('\0').append(server);
+ builder.append('\0').append(saveLogin ? username : "");
+ builder.append('\0').append(saveLogin ? password : "");
+ builder.append('\0').append(dnsServers);
+ builder.append('\0').append(searchDomains);
+ builder.append('\0').append(routes);
+ builder.append('\0').append(mppe);
+ builder.append('\0').append(l2tpSecret);
+ builder.append('\0').append(ipsecIdentifier);
+ builder.append('\0').append(ipsecSecret);
+ builder.append('\0').append(ipsecUserCert);
+ builder.append('\0').append(ipsecCaCert);
+ builder.append('\0').append(ipsecServerCert);
+ return builder.toString().getBytes(Charsets.UTF_8);
+ }
+}
diff --git a/core/java/com/android/internal/widget/ActionBarView.java b/core/java/com/android/internal/widget/ActionBarView.java
index 7da8d46..8ff39d69 100644
--- a/core/java/com/android/internal/widget/ActionBarView.java
+++ b/core/java/com/android/internal/widget/ActionBarView.java
@@ -1370,6 +1370,7 @@
int upOffset = 0;
if (mUpView.getVisibility() != GONE) {
final LayoutParams upLp = (LayoutParams) mUpView.getLayoutParams();
+ upLp.onResolveLayoutDirection(layoutDirection);
final int upHeight = mUpView.getMeasuredHeight();
final int upWidth = mUpView.getMeasuredWidth();
upOffset = upLp.leftMargin + upWidth + upLp.rightMargin;
diff --git a/core/jni/android/graphics/TextLayoutCache.h b/core/jni/android/graphics/TextLayoutCache.h
index 96ba34a..f007f9a 100644
--- a/core/jni/android/graphics/TextLayoutCache.h
+++ b/core/jni/android/graphics/TextLayoutCache.h
@@ -57,7 +57,7 @@
#define MB(s) s * 1024 * 1024
// Define the default cache size in Mb
-#define DEFAULT_TEXT_LAYOUT_CACHE_SIZE_IN_MB 0.250f
+#define DEFAULT_TEXT_LAYOUT_CACHE_SIZE_IN_MB 0.500f
// Define the interval in number of cache hits between two statistics dump
#define DEFAULT_DUMP_STATS_CACHE_HIT_INTERVAL 100
diff --git a/core/jni/android_opengl_GLES10.cpp b/core/jni/android_opengl_GLES10.cpp
index 73696ec..571f579 100644
--- a/core/jni/android_opengl_GLES10.cpp
+++ b/core/jni/android_opengl_GLES10.cpp
@@ -75,14 +75,12 @@
}
static void *
-getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining)
+getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining, jint *offset)
{
jint position;
jint limit;
jint elementSizeShift;
jlong pointer;
- jint offset;
- void *data;
position = _env->GetIntField(buffer, positionID);
limit = _env->GetIntField(buffer, limitID);
@@ -97,11 +95,10 @@
*array = (jarray) _env->CallStaticObjectMethod(nioAccessClass,
getBaseArrayID, buffer);
- offset = _env->CallStaticIntMethod(nioAccessClass,
+ *offset = _env->CallStaticIntMethod(nioAccessClass,
getBaseArrayOffsetID, buffer);
- data = _env->GetPrimitiveArrayCritical(*array, (jboolean *) 0);
- return (void *) ((char *) data + offset);
+ return NULL;
}
static void
@@ -292,6 +289,7 @@
android_glColorPointerBounds__IIILjava_nio_Buffer_2I
(JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLvoid *pointer = (GLvoid *) 0;
@@ -315,10 +313,15 @@
android_glCompressedTexImage2D__IIIIIIILjava_nio_Buffer_2
(JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint width, jint height, jint border, jint imageSize, jobject data_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLvoid *data = (GLvoid *) 0;
- data = (GLvoid *)getPointer(_env, data_buf, &_array, &_remaining);
+ data = (GLvoid *)getPointer(_env, data_buf, &_array, &_remaining, &_bufferOffset);
+ if (data == NULL) {
+ char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ data = (GLvoid *) (_dataBase + _bufferOffset);
+ }
glCompressedTexImage2D(
(GLenum)target,
(GLint)level,
@@ -339,10 +342,15 @@
android_glCompressedTexSubImage2D__IIIIIIIILjava_nio_Buffer_2
(JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint width, jint height, jint format, jint imageSize, jobject data_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLvoid *data = (GLvoid *) 0;
- data = (GLvoid *)getPointer(_env, data_buf, &_array, &_remaining);
+ data = (GLvoid *)getPointer(_env, data_buf, &_array, &_remaining, &_bufferOffset);
+ if (data == NULL) {
+ char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ data = (GLvoid *) (_dataBase + _bufferOffset);
+ }
glCompressedTexSubImage2D(
(GLenum)target,
(GLint)level,
@@ -457,16 +465,21 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLuint *textures = (GLuint *) 0;
- textures = (GLuint *)getPointer(_env, textures_buf, &_array, &_remaining);
+ textures = (GLuint *)getPointer(_env, textures_buf, &_array, &_remaining, &_bufferOffset);
if (_remaining < n) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "remaining() < n < needed";
goto exit;
}
+ if (textures == NULL) {
+ char * _texturesBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ textures = (GLuint *) (_texturesBase + _bufferOffset);
+ }
glDeleteTextures(
(GLsizei)n,
(GLuint *)textures
@@ -556,16 +569,21 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLvoid *indices = (GLvoid *) 0;
- indices = (GLvoid *)getPointer(_env, indices_buf, &_array, &_remaining);
+ indices = (GLvoid *)getPointer(_env, indices_buf, &_array, &_remaining, &_bufferOffset);
if (_remaining < count) {
_exception = 1;
_exceptionType = "java/lang/ArrayIndexOutOfBoundsException";
_exceptionMessage = "remaining() < count < needed";
goto exit;
}
+ if (indices == NULL) {
+ char * _indicesBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ indices = (GLvoid *) (_indicesBase + _bufferOffset);
+ }
glDrawElements(
(GLenum)mode,
(GLsizei)count,
@@ -706,10 +724,11 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *params = (GLfloat *) 0;
- params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
int _needed;
switch (pname) {
#if defined(GL_FOG_MODE)
@@ -741,6 +760,10 @@
_exceptionMessage = "remaining() < needed";
goto exit;
}
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLfloat *) (_paramsBase + _bufferOffset);
+ }
glFogfv(
(GLenum)pname,
(GLfloat *)params
@@ -847,10 +870,11 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
- params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
int _needed;
switch (pname) {
#if defined(GL_FOG_MODE)
@@ -882,6 +906,10 @@
_exceptionMessage = "remaining() < needed";
goto exit;
}
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLfixed *) (_paramsBase + _bufferOffset);
+ }
glFogxv(
(GLenum)pname,
(GLfixed *)params
@@ -990,16 +1018,21 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLuint *textures = (GLuint *) 0;
- textures = (GLuint *)getPointer(_env, textures_buf, &_array, &_remaining);
+ textures = (GLuint *)getPointer(_env, textures_buf, &_array, &_remaining, &_bufferOffset);
if (_remaining < n) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "remaining() < n < needed";
goto exit;
}
+ if (textures == NULL) {
+ char * _texturesBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ textures = (GLuint *) (_texturesBase + _bufferOffset);
+ }
glGenTextures(
(GLsizei)n,
(GLuint *)textures
@@ -1411,10 +1444,11 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLint *params = (GLint *) 0;
- params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
int _needed;
switch (pname) {
#if defined(GL_ALPHA_BITS)
@@ -1752,6 +1786,10 @@
_exceptionMessage = "remaining() < needed";
goto exit;
}
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLint *) (_paramsBase + _bufferOffset);
+ }
glGetIntegerv(
(GLenum)pname,
(GLint *)params
@@ -1864,10 +1902,11 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *params = (GLfloat *) 0;
- params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
int _needed;
switch (pname) {
#if defined(GL_LIGHT_MODEL_TWO_SIDE)
@@ -1890,6 +1929,10 @@
_exceptionMessage = "remaining() < needed";
goto exit;
}
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLfloat *) (_paramsBase + _bufferOffset);
+ }
glLightModelfv(
(GLenum)pname,
(GLfloat *)params
@@ -1987,10 +2030,11 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
- params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
int _needed;
switch (pname) {
#if defined(GL_LIGHT_MODEL_TWO_SIDE)
@@ -2013,6 +2057,10 @@
_exceptionMessage = "remaining() < needed";
goto exit;
}
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLfixed *) (_paramsBase + _bufferOffset);
+ }
glLightModelxv(
(GLenum)pname,
(GLfixed *)params
@@ -2138,10 +2186,11 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *params = (GLfloat *) 0;
- params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
int _needed;
switch (pname) {
#if defined(GL_SPOT_EXPONENT)
@@ -2190,6 +2239,10 @@
_exceptionMessage = "remaining() < needed";
goto exit;
}
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLfloat *) (_paramsBase + _bufferOffset);
+ }
glLightfv(
(GLenum)light,
(GLenum)pname,
@@ -2316,10 +2369,11 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
- params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
int _needed;
switch (pname) {
#if defined(GL_SPOT_EXPONENT)
@@ -2368,6 +2422,10 @@
_exceptionMessage = "remaining() < needed";
goto exit;
}
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLfixed *) (_paramsBase + _bufferOffset);
+ }
glLightxv(
(GLenum)light,
(GLenum)pname,
@@ -2455,10 +2513,15 @@
android_glLoadMatrixf__Ljava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jobject m_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *m = (GLfloat *) 0;
- m = (GLfloat *)getPointer(_env, m_buf, &_array, &_remaining);
+ m = (GLfloat *)getPointer(_env, m_buf, &_array, &_remaining, &_bufferOffset);
+ if (m == NULL) {
+ char * _mBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ m = (GLfloat *) (_mBase + _bufferOffset);
+ }
glLoadMatrixf(
(GLfloat *)m
);
@@ -2514,10 +2577,15 @@
android_glLoadMatrixx__Ljava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jobject m_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfixed *m = (GLfixed *) 0;
- m = (GLfixed *)getPointer(_env, m_buf, &_array, &_remaining);
+ m = (GLfixed *)getPointer(_env, m_buf, &_array, &_remaining, &_bufferOffset);
+ if (m == NULL) {
+ char * _mBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ m = (GLfixed *) (_mBase + _bufferOffset);
+ }
glLoadMatrixx(
(GLfixed *)m
);
@@ -2632,10 +2700,11 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *params = (GLfloat *) 0;
- params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
int _needed;
switch (pname) {
#if defined(GL_SHININESS)
@@ -2670,6 +2739,10 @@
_exceptionMessage = "remaining() < needed";
goto exit;
}
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLfloat *) (_paramsBase + _bufferOffset);
+ }
glMaterialfv(
(GLenum)face,
(GLenum)pname,
@@ -2782,10 +2855,11 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
- params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
int _needed;
switch (pname) {
#if defined(GL_SHININESS)
@@ -2820,6 +2894,10 @@
_exceptionMessage = "remaining() < needed";
goto exit;
}
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLfixed *) (_paramsBase + _bufferOffset);
+ }
glMaterialxv(
(GLenum)face,
(GLenum)pname,
@@ -2891,10 +2969,15 @@
android_glMultMatrixf__Ljava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jobject m_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *m = (GLfloat *) 0;
- m = (GLfloat *)getPointer(_env, m_buf, &_array, &_remaining);
+ m = (GLfloat *)getPointer(_env, m_buf, &_array, &_remaining, &_bufferOffset);
+ if (m == NULL) {
+ char * _mBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ m = (GLfloat *) (_mBase + _bufferOffset);
+ }
glMultMatrixf(
(GLfloat *)m
);
@@ -2950,10 +3033,15 @@
android_glMultMatrixx__Ljava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jobject m_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfixed *m = (GLfixed *) 0;
- m = (GLfixed *)getPointer(_env, m_buf, &_array, &_remaining);
+ m = (GLfixed *)getPointer(_env, m_buf, &_array, &_remaining, &_bufferOffset);
+ if (m == NULL) {
+ char * _mBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ m = (GLfixed *) (_mBase + _bufferOffset);
+ }
glMultMatrixx(
(GLfixed *)m
);
@@ -3015,6 +3103,7 @@
android_glNormalPointerBounds__IILjava_nio_Buffer_2I
(JNIEnv *_env, jobject _this, jint type, jint stride, jobject pointer_buf, jint remaining) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLvoid *pointer = (GLvoid *) 0;
@@ -3127,10 +3216,15 @@
android_glReadPixels__IIIIIILjava_nio_Buffer_2
(JNIEnv *_env, jobject _this, jint x, jint y, jint width, jint height, jint format, jint type, jobject pixels_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLvoid *pixels = (GLvoid *) 0;
- pixels = (GLvoid *)getPointer(_env, pixels_buf, &_array, &_remaining);
+ pixels = (GLvoid *)getPointer(_env, pixels_buf, &_array, &_remaining, &_bufferOffset);
+ if (pixels == NULL) {
+ char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ pixels = (GLvoid *) (_pixelsBase + _bufferOffset);
+ }
glReadPixels(
(GLint)x,
(GLint)y,
@@ -3268,6 +3362,7 @@
android_glTexCoordPointerBounds__IIILjava_nio_Buffer_2I
(JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLvoid *pointer = (GLvoid *) 0;
@@ -3377,10 +3472,11 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *params = (GLfloat *) 0;
- params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
int _needed;
switch (pname) {
#if defined(GL_TEXTURE_ENV_MODE)
@@ -3409,6 +3505,10 @@
_exceptionMessage = "remaining() < needed";
goto exit;
}
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLfloat *) (_paramsBase + _bufferOffset);
+ }
glTexEnvfv(
(GLenum)target,
(GLenum)pname,
@@ -3515,10 +3615,11 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
- params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
int _needed;
switch (pname) {
#if defined(GL_TEXTURE_ENV_MODE)
@@ -3547,6 +3648,10 @@
_exceptionMessage = "remaining() < needed";
goto exit;
}
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLfixed *) (_paramsBase + _bufferOffset);
+ }
glTexEnvxv(
(GLenum)target,
(GLenum)pname,
@@ -3567,11 +3672,16 @@
android_glTexImage2D__IIIIIIIILjava_nio_Buffer_2
(JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint width, jint height, jint border, jint format, jint type, jobject pixels_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLvoid *pixels = (GLvoid *) 0;
if (pixels_buf) {
- pixels = (GLvoid *)getPointer(_env, pixels_buf, &_array, &_remaining);
+ pixels = (GLvoid *)getPointer(_env, pixels_buf, &_array, &_remaining, &_bufferOffset);
+ }
+ if (pixels_buf && pixels == NULL) {
+ char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ pixels = (GLvoid *) (_pixelsBase + _bufferOffset);
}
glTexImage2D(
(GLenum)target,
@@ -3616,11 +3726,16 @@
android_glTexSubImage2D__IIIIIIIILjava_nio_Buffer_2
(JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint width, jint height, jint format, jint type, jobject pixels_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLvoid *pixels = (GLvoid *) 0;
if (pixels_buf) {
- pixels = (GLvoid *)getPointer(_env, pixels_buf, &_array, &_remaining);
+ pixels = (GLvoid *)getPointer(_env, pixels_buf, &_array, &_remaining, &_bufferOffset);
+ }
+ if (pixels_buf && pixels == NULL) {
+ char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ pixels = (GLvoid *) (_pixelsBase + _bufferOffset);
}
glTexSubImage2D(
(GLenum)target,
@@ -3665,6 +3780,7 @@
android_glVertexPointerBounds__IIILjava_nio_Buffer_2I
(JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLvoid *pointer = (GLvoid *) 0;
diff --git a/core/jni/android_opengl_GLES10Ext.cpp b/core/jni/android_opengl_GLES10Ext.cpp
index 16a884a..1cd8e44 100644
--- a/core/jni/android_opengl_GLES10Ext.cpp
+++ b/core/jni/android_opengl_GLES10Ext.cpp
@@ -63,14 +63,12 @@
static void *
-getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining)
+getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining, jint *offset)
{
jint position;
jint limit;
jint elementSizeShift;
jlong pointer;
- jint offset;
- void *data;
position = _env->GetIntField(buffer, positionID);
limit = _env->GetIntField(buffer, limitID);
@@ -85,11 +83,10 @@
*array = (jarray) _env->CallStaticObjectMethod(nioAccessClass,
getBaseArrayID, buffer);
- offset = _env->CallStaticIntMethod(nioAccessClass,
+ *offset = _env->CallStaticIntMethod(nioAccessClass,
getBaseArrayOffsetID, buffer);
- data = _env->GetPrimitiveArrayCritical(*array, (jboolean *) 0);
- return (void *) ((char *) data + offset);
+ return NULL;
}
@@ -190,38 +187,48 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _mantissaArray = (jarray) 0;
+ jint _mantissaBufferOffset = (jint) 0;
jarray _exponentArray = (jarray) 0;
+ jint _exponentBufferOffset = (jint) 0;
GLbitfield _returnValue = -1;
jint _mantissaRemaining;
GLfixed *mantissa = (GLfixed *) 0;
jint _exponentRemaining;
GLint *exponent = (GLint *) 0;
- mantissa = (GLfixed *)getPointer(_env, mantissa_buf, &_mantissaArray, &_mantissaRemaining);
+ mantissa = (GLfixed *)getPointer(_env, mantissa_buf, &_mantissaArray, &_mantissaRemaining, &_mantissaBufferOffset);
if (_mantissaRemaining < 16) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "remaining() < 16 < needed";
goto exit;
}
- exponent = (GLint *)getPointer(_env, exponent_buf, &_exponentArray, &_exponentRemaining);
+ exponent = (GLint *)getPointer(_env, exponent_buf, &_exponentArray, &_exponentRemaining, &_exponentBufferOffset);
if (_exponentRemaining < 16) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "remaining() < 16 < needed";
goto exit;
}
+ if (mantissa == NULL) {
+ char * _mantissaBase = (char *)_env->GetPrimitiveArrayCritical(_mantissaArray, (jboolean *) 0);
+ mantissa = (GLfixed *) (_mantissaBase + _mantissaBufferOffset);
+ }
+ if (exponent == NULL) {
+ char * _exponentBase = (char *)_env->GetPrimitiveArrayCritical(_exponentArray, (jboolean *) 0);
+ exponent = (GLint *) (_exponentBase + _exponentBufferOffset);
+ }
_returnValue = glQueryMatrixxOES(
(GLfixed *)mantissa,
(GLint *)exponent
);
exit:
- if (_mantissaArray) {
- releasePointer(_env, _mantissaArray, exponent, _exception ? JNI_FALSE : JNI_TRUE);
- }
if (_exponentArray) {
- releasePointer(_env, _exponentArray, mantissa, _exception ? JNI_FALSE : JNI_TRUE);
+ releasePointer(_env, _exponentArray, exponent, _exception ? JNI_FALSE : JNI_TRUE);
+ }
+ if (_mantissaArray) {
+ releasePointer(_env, _mantissaArray, mantissa, _exception ? JNI_FALSE : JNI_TRUE);
}
if (_exception) {
jniThrowException(_env, _exceptionType, _exceptionMessage);
diff --git a/core/jni/android_opengl_GLES11.cpp b/core/jni/android_opengl_GLES11.cpp
index ee7cb12..1e6ceb3 100644
--- a/core/jni/android_opengl_GLES11.cpp
+++ b/core/jni/android_opengl_GLES11.cpp
@@ -70,14 +70,12 @@
static void *
-getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining)
+getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining, jint *offset)
{
jint position;
jint limit;
jint elementSizeShift;
jlong pointer;
- jint offset;
- void *data;
position = _env->GetIntField(buffer, positionID);
limit = _env->GetIntField(buffer, limitID);
@@ -92,11 +90,10 @@
*array = (jarray) _env->CallStaticObjectMethod(nioAccessClass,
getBaseArrayID, buffer);
- offset = _env->CallStaticIntMethod(nioAccessClass,
+ *offset = _env->CallStaticIntMethod(nioAccessClass,
getBaseArrayOffsetID, buffer);
- data = _env->GetPrimitiveArrayCritical(*array, (jboolean *) 0);
- return (void *) ((char *) data + offset);
+ return NULL;
}
@@ -140,11 +137,12 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLvoid *data = (GLvoid *) 0;
if (data_buf) {
- data = (GLvoid *)getPointer(_env, data_buf, &_array, &_remaining);
+ data = (GLvoid *)getPointer(_env, data_buf, &_array, &_remaining, &_bufferOffset);
if (_remaining < size) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
@@ -152,6 +150,10 @@
goto exit;
}
}
+ if (data_buf && data == NULL) {
+ char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ data = (GLvoid *) (_dataBase + _bufferOffset);
+ }
glBufferData(
(GLenum)target,
(GLsizeiptr)size,
@@ -176,16 +178,21 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLvoid *data = (GLvoid *) 0;
- data = (GLvoid *)getPointer(_env, data_buf, &_array, &_remaining);
+ data = (GLvoid *)getPointer(_env, data_buf, &_array, &_remaining, &_bufferOffset);
if (_remaining < size) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "remaining() < size < needed";
goto exit;
}
+ if (data == NULL) {
+ char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ data = (GLvoid *) (_dataBase + _bufferOffset);
+ }
glBufferSubData(
(GLenum)target,
(GLintptr)offset,
@@ -253,10 +260,15 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *equation = (GLfloat *) 0;
- equation = (GLfloat *)getPointer(_env, equation_buf, &_array, &_remaining);
+ equation = (GLfloat *)getPointer(_env, equation_buf, &_array, &_remaining, &_bufferOffset);
+ if (equation == NULL) {
+ char * _equationBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ equation = (GLfloat *) (_equationBase + _bufferOffset);
+ }
glClipPlanef(
(GLenum)plane,
(GLfloat *)equation
@@ -320,10 +332,15 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfixed *equation = (GLfixed *) 0;
- equation = (GLfixed *)getPointer(_env, equation_buf, &_array, &_remaining);
+ equation = (GLfixed *)getPointer(_env, equation_buf, &_array, &_remaining, &_bufferOffset);
+ if (equation == NULL) {
+ char * _equationBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ equation = (GLfixed *) (_equationBase + _bufferOffset);
+ }
glClipPlanex(
(GLenum)plane,
(GLfixed *)equation
@@ -417,16 +434,21 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLuint *buffers = (GLuint *) 0;
- buffers = (GLuint *)getPointer(_env, buffers_buf, &_array, &_remaining);
+ buffers = (GLuint *)getPointer(_env, buffers_buf, &_array, &_remaining, &_bufferOffset);
if (_remaining < n) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "remaining() < n < needed";
goto exit;
}
+ if (buffers == NULL) {
+ char * _buffersBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ buffers = (GLuint *) (_buffersBase + _bufferOffset);
+ }
glDeleteBuffers(
(GLsizei)n,
(GLuint *)buffers
@@ -516,16 +538,21 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLuint *buffers = (GLuint *) 0;
- buffers = (GLuint *)getPointer(_env, buffers_buf, &_array, &_remaining);
+ buffers = (GLuint *)getPointer(_env, buffers_buf, &_array, &_remaining, &_bufferOffset);
if (_remaining < n) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "remaining() < n < needed";
goto exit;
}
+ if (buffers == NULL) {
+ char * _buffersBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ buffers = (GLuint *) (_buffersBase + _bufferOffset);
+ }
glGenBuffers(
(GLsizei)n,
(GLuint *)buffers
@@ -588,10 +615,15 @@
android_glGetBooleanv__ILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLboolean *params = (GLboolean *) 0;
- params = (GLboolean *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLboolean *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLboolean *) (_paramsBase + _bufferOffset);
+ }
glGetBooleanv(
(GLenum)pname,
(GLboolean *)params
@@ -659,16 +691,21 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLint *params = (GLint *) 0;
- params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
if (_remaining < 1) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "remaining() < 1 < needed";
goto exit;
}
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLint *) (_paramsBase + _bufferOffset);
+ }
glGetBufferParameteriv(
(GLenum)target,
(GLenum)pname,
@@ -732,10 +769,15 @@
android_glGetClipPlanef__ILjava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jint pname, jobject eqn_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *eqn = (GLfloat *) 0;
- eqn = (GLfloat *)getPointer(_env, eqn_buf, &_array, &_remaining);
+ eqn = (GLfloat *)getPointer(_env, eqn_buf, &_array, &_remaining, &_bufferOffset);
+ if (eqn == NULL) {
+ char * _eqnBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ eqn = (GLfloat *) (_eqnBase + _bufferOffset);
+ }
glGetClipPlanef(
(GLenum)pname,
(GLfloat *)eqn
@@ -793,10 +835,15 @@
android_glGetClipPlanex__ILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint pname, jobject eqn_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfixed *eqn = (GLfixed *) 0;
- eqn = (GLfixed *)getPointer(_env, eqn_buf, &_array, &_remaining);
+ eqn = (GLfixed *)getPointer(_env, eqn_buf, &_array, &_remaining, &_bufferOffset);
+ if (eqn == NULL) {
+ char * _eqnBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ eqn = (GLfixed *) (_eqnBase + _bufferOffset);
+ }
glGetClipPlanex(
(GLenum)pname,
(GLfixed *)eqn
@@ -854,10 +901,15 @@
android_glGetFixedv__ILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
- params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLfixed *) (_paramsBase + _bufferOffset);
+ }
glGetFixedv(
(GLenum)pname,
(GLfixed *)params
@@ -915,10 +967,15 @@
android_glGetFloatv__ILjava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *params = (GLfloat *) 0;
- params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLfloat *) (_paramsBase + _bufferOffset);
+ }
glGetFloatv(
(GLenum)pname,
(GLfloat *)params
@@ -1028,10 +1085,11 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *params = (GLfloat *) 0;
- params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
int _needed;
switch (pname) {
#if defined(GL_SPOT_EXPONENT)
@@ -1080,6 +1138,10 @@
_exceptionMessage = "remaining() < needed";
goto exit;
}
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLfloat *) (_paramsBase + _bufferOffset);
+ }
glGetLightfv(
(GLenum)light,
(GLenum)pname,
@@ -1195,10 +1257,11 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
- params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
int _needed;
switch (pname) {
#if defined(GL_SPOT_EXPONENT)
@@ -1247,6 +1310,10 @@
_exceptionMessage = "remaining() < needed";
goto exit;
}
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLfixed *) (_paramsBase + _bufferOffset);
+ }
glGetLightxv(
(GLenum)light,
(GLenum)pname,
@@ -1348,10 +1415,11 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *params = (GLfloat *) 0;
- params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
int _needed;
switch (pname) {
#if defined(GL_SHININESS)
@@ -1386,6 +1454,10 @@
_exceptionMessage = "remaining() < needed";
goto exit;
}
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLfloat *) (_paramsBase + _bufferOffset);
+ }
glGetMaterialfv(
(GLenum)face,
(GLenum)pname,
@@ -1487,10 +1559,11 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
- params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
int _needed;
switch (pname) {
#if defined(GL_SHININESS)
@@ -1525,6 +1598,10 @@
_exceptionMessage = "remaining() < needed";
goto exit;
}
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLfixed *) (_paramsBase + _bufferOffset);
+ }
glGetMaterialxv(
(GLenum)face,
(GLenum)pname,
@@ -1620,10 +1697,11 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *params = (GLfloat *) 0;
- params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
int _needed;
switch (pname) {
#if defined(GL_TEXTURE_ENV_MODE)
@@ -1652,6 +1730,10 @@
_exceptionMessage = "remaining() < needed";
goto exit;
}
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLfloat *) (_paramsBase + _bufferOffset);
+ }
glGetTexEnvfv(
(GLenum)env,
(GLenum)pname,
@@ -1747,10 +1829,11 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLint *params = (GLint *) 0;
- params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
int _needed;
switch (pname) {
#if defined(GL_TEXTURE_ENV_MODE)
@@ -1779,6 +1862,10 @@
_exceptionMessage = "remaining() < needed";
goto exit;
}
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLint *) (_paramsBase + _bufferOffset);
+ }
glGetTexEnviv(
(GLenum)env,
(GLenum)pname,
@@ -1874,10 +1961,11 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
- params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
int _needed;
switch (pname) {
#if defined(GL_TEXTURE_ENV_MODE)
@@ -1906,6 +1994,10 @@
_exceptionMessage = "remaining() < needed";
goto exit;
}
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLfixed *) (_paramsBase + _bufferOffset);
+ }
glGetTexEnvxv(
(GLenum)env,
(GLenum)pname,
@@ -1979,16 +2071,21 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *params = (GLfloat *) 0;
- params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
if (_remaining < 1) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "remaining() < 1 < needed";
goto exit;
}
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLfloat *) (_paramsBase + _bufferOffset);
+ }
glGetTexParameterfv(
(GLenum)target,
(GLenum)pname,
@@ -2062,16 +2159,21 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLint *params = (GLint *) 0;
- params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
if (_remaining < 1) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "remaining() < 1 < needed";
goto exit;
}
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLint *) (_paramsBase + _bufferOffset);
+ }
glGetTexParameteriv(
(GLenum)target,
(GLenum)pname,
@@ -2145,16 +2247,21 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
- params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
if (_remaining < 1) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "remaining() < 1 < needed";
goto exit;
}
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLfixed *) (_paramsBase + _bufferOffset);
+ }
glGetTexParameterxv(
(GLenum)target,
(GLenum)pname,
@@ -2281,16 +2388,21 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *params = (GLfloat *) 0;
- params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
if (_remaining < 1) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "remaining() < 1 < needed";
goto exit;
}
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLfloat *) (_paramsBase + _bufferOffset);
+ }
glPointParameterfv(
(GLenum)pname,
(GLfloat *)params
@@ -2372,16 +2484,21 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
- params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
if (_remaining < 1) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "remaining() < 1 < needed";
goto exit;
}
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLfixed *) (_paramsBase + _bufferOffset);
+ }
glPointParameterxv(
(GLenum)pname,
(GLfixed *)params
@@ -2401,6 +2518,7 @@
android_glPointSizePointerOESBounds__IILjava_nio_Buffer_2I
(JNIEnv *_env, jobject _this, jint type, jint stride, jobject pointer_buf, jint remaining) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLvoid *pointer = (GLvoid *) 0;
@@ -2521,10 +2639,11 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLint *params = (GLint *) 0;
- params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
int _needed;
switch (pname) {
#if defined(GL_TEXTURE_ENV_MODE)
@@ -2553,6 +2672,10 @@
_exceptionMessage = "remaining() < needed";
goto exit;
}
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLint *) (_paramsBase + _bufferOffset);
+ }
glTexEnviv(
(GLenum)target,
(GLenum)pname,
@@ -2626,16 +2749,21 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *params = (GLfloat *) 0;
- params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
if (_remaining < 1) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "remaining() < 1 < needed";
goto exit;
}
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLfloat *) (_paramsBase + _bufferOffset);
+ }
glTexParameterfv(
(GLenum)target,
(GLenum)pname,
@@ -2720,16 +2848,21 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLint *params = (GLint *) 0;
- params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
if (_remaining < 1) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "remaining() < 1 < needed";
goto exit;
}
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLint *) (_paramsBase + _bufferOffset);
+ }
glTexParameteriv(
(GLenum)target,
(GLenum)pname,
@@ -2803,16 +2936,21 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
- params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
if (_remaining < 1) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "remaining() < 1 < needed";
goto exit;
}
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLfixed *) (_paramsBase + _bufferOffset);
+ }
glTexParameterxv(
(GLenum)target,
(GLenum)pname,
diff --git a/core/jni/android_opengl_GLES11Ext.cpp b/core/jni/android_opengl_GLES11Ext.cpp
index a05f809..073bbb2 100644
--- a/core/jni/android_opengl_GLES11Ext.cpp
+++ b/core/jni/android_opengl_GLES11Ext.cpp
@@ -72,14 +72,12 @@
static void *
-getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining)
+getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining, jint *offset)
{
jint position;
jint limit;
jint elementSizeShift;
jlong pointer;
- jint offset;
- void *data;
position = _env->GetIntField(buffer, positionID);
limit = _env->GetIntField(buffer, limitID);
@@ -94,11 +92,9 @@
*array = (jarray) _env->CallStaticObjectMethod(nioAccessClass,
getBaseArrayID, buffer);
- offset = _env->CallStaticIntMethod(nioAccessClass,
+ *offset = _env->CallStaticIntMethod(nioAccessClass,
getBaseArrayOffsetID, buffer);
- data = _env->GetPrimitiveArrayCritical(*array, (jboolean *) 0);
-
- return (void *) ((char *) data + offset);
+ return NULL;
}
@@ -249,16 +245,21 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLshort *coords = (GLshort *) 0;
- coords = (GLshort *)getPointer(_env, coords_buf, &_array, &_remaining);
+ coords = (GLshort *)getPointer(_env, coords_buf, &_array, &_remaining, &_bufferOffset);
if (_remaining < 5) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "remaining() < 5 < needed";
goto exit;
}
+ if (coords == NULL) {
+ char * _coordsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ coords = (GLshort *) (_coordsBase + _bufferOffset);
+ }
glDrawTexsvOES(
(GLshort *)coords
);
@@ -328,16 +329,21 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLint *coords = (GLint *) 0;
- coords = (GLint *)getPointer(_env, coords_buf, &_array, &_remaining);
+ coords = (GLint *)getPointer(_env, coords_buf, &_array, &_remaining, &_bufferOffset);
if (_remaining < 5) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "remaining() < 5 < needed";
goto exit;
}
+ if (coords == NULL) {
+ char * _coordsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ coords = (GLint *) (_coordsBase + _bufferOffset);
+ }
glDrawTexivOES(
(GLint *)coords
);
@@ -407,16 +413,21 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfixed *coords = (GLfixed *) 0;
- coords = (GLfixed *)getPointer(_env, coords_buf, &_array, &_remaining);
+ coords = (GLfixed *)getPointer(_env, coords_buf, &_array, &_remaining, &_bufferOffset);
if (_remaining < 5) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "remaining() < 5 < needed";
goto exit;
}
+ if (coords == NULL) {
+ char * _coordsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ coords = (GLfixed *) (_coordsBase + _bufferOffset);
+ }
glDrawTexxvOES(
(GLfixed *)coords
);
@@ -499,16 +510,21 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *coords = (GLfloat *) 0;
- coords = (GLfloat *)getPointer(_env, coords_buf, &_array, &_remaining);
+ coords = (GLfloat *)getPointer(_env, coords_buf, &_array, &_remaining, &_bufferOffset);
if (_remaining < 5) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "remaining() < 5 < needed";
goto exit;
}
+ if (coords == NULL) {
+ char * _coordsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ coords = (GLfloat *) (_coordsBase + _bufferOffset);
+ }
glDrawTexfvOES(
(GLfloat *)coords
);
@@ -527,10 +543,15 @@
android_glEGLImageTargetTexture2DOES__ILjava_nio_Buffer_2
(JNIEnv *_env, jobject _this, jint target, jobject image_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLeglImageOES image = (GLeglImageOES) 0;
- image = (GLeglImageOES)getPointer(_env, image_buf, &_array, &_remaining);
+ image = (GLeglImageOES)getPointer(_env, image_buf, &_array, &_remaining, &_bufferOffset);
+ if (image == NULL) {
+ char * _imageBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ image = (GLeglImageOES) (_imageBase + _bufferOffset);
+ }
glEGLImageTargetTexture2DOES(
(GLenum)target,
(GLeglImageOES)image
@@ -545,10 +566,15 @@
android_glEGLImageTargetRenderbufferStorageOES__ILjava_nio_Buffer_2
(JNIEnv *_env, jobject _this, jint target, jobject image_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLeglImageOES image = (GLeglImageOES) 0;
- image = (GLeglImageOES)getPointer(_env, image_buf, &_array, &_remaining);
+ image = (GLeglImageOES)getPointer(_env, image_buf, &_array, &_remaining, &_bufferOffset);
+ if (image == NULL) {
+ char * _imageBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ image = (GLeglImageOES) (_imageBase + _bufferOffset);
+ }
glEGLImageTargetRenderbufferStorageOES(
(GLenum)target,
(GLeglImageOES)image
@@ -637,10 +663,15 @@
android_glClipPlanexOES__ILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint plane, jobject equation_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfixed *equation = (GLfixed *) 0;
- equation = (GLfixed *)getPointer(_env, equation_buf, &_array, &_remaining);
+ equation = (GLfixed *)getPointer(_env, equation_buf, &_array, &_remaining, &_bufferOffset);
+ if (equation == NULL) {
+ char * _equationBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ equation = (GLfixed *) (_equationBase + _bufferOffset);
+ }
glClipPlanexOES(
(GLenum)plane,
(GLfixed *)equation
@@ -730,10 +761,15 @@
android_glFogxvOES__ILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
- params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLfixed *) (_paramsBase + _bufferOffset);
+ }
glFogxvOES(
(GLenum)pname,
(GLfixed *)params
@@ -814,16 +850,21 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfixed *eqn = (GLfixed *) 0;
- eqn = (GLfixed *)getPointer(_env, eqn_buf, &_array, &_remaining);
+ eqn = (GLfixed *)getPointer(_env, eqn_buf, &_array, &_remaining, &_bufferOffset);
if (_remaining < 4) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "remaining() < 4 < needed";
goto exit;
}
+ if (eqn == NULL) {
+ char * _eqnBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ eqn = (GLfixed *) (_eqnBase + _bufferOffset);
+ }
glGetClipPlanexOES(
(GLenum)pname,
(GLfixed *)eqn
@@ -886,10 +927,15 @@
android_glGetFixedvOES__ILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
- params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLfixed *) (_paramsBase + _bufferOffset);
+ }
glGetFixedvOES(
(GLenum)pname,
(GLfixed *)params
@@ -948,10 +994,15 @@
android_glGetLightxvOES__IILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint light, jint pname, jobject params_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
- params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLfixed *) (_paramsBase + _bufferOffset);
+ }
glGetLightxvOES(
(GLenum)light,
(GLenum)pname,
@@ -1011,10 +1062,15 @@
android_glGetMaterialxvOES__IILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
- params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLfixed *) (_paramsBase + _bufferOffset);
+ }
glGetMaterialxvOES(
(GLenum)face,
(GLenum)pname,
@@ -1074,10 +1130,15 @@
android_glGetTexEnvxvOES__IILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint env, jint pname, jobject params_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
- params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLfixed *) (_paramsBase + _bufferOffset);
+ }
glGetTexEnvxvOES(
(GLenum)env,
(GLenum)pname,
@@ -1137,10 +1198,15 @@
android_glGetTexParameterxvOES__IILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
- params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLfixed *) (_paramsBase + _bufferOffset);
+ }
glGetTexParameterxvOES(
(GLenum)target,
(GLenum)pname,
@@ -1209,10 +1275,15 @@
android_glLightModelxvOES__ILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
- params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLfixed *) (_paramsBase + _bufferOffset);
+ }
glLightModelxvOES(
(GLenum)pname,
(GLfixed *)params
@@ -1282,10 +1353,15 @@
android_glLightxvOES__IILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint light, jint pname, jobject params_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
- params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLfixed *) (_paramsBase + _bufferOffset);
+ }
glLightxvOES(
(GLenum)light,
(GLenum)pname,
@@ -1352,10 +1428,15 @@
android_glLoadMatrixxOES__Ljava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jobject m_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfixed *m = (GLfixed *) 0;
- m = (GLfixed *)getPointer(_env, m_buf, &_array, &_remaining);
+ m = (GLfixed *)getPointer(_env, m_buf, &_array, &_remaining, &_bufferOffset);
+ if (m == NULL) {
+ char * _mBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ m = (GLfixed *) (_mBase + _bufferOffset);
+ }
glLoadMatrixxOES(
(GLfixed *)m
);
@@ -1424,10 +1505,15 @@
android_glMaterialxvOES__IILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
- params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLfixed *) (_paramsBase + _bufferOffset);
+ }
glMaterialxvOES(
(GLenum)face,
(GLenum)pname,
@@ -1485,10 +1571,15 @@
android_glMultMatrixxOES__Ljava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jobject m_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfixed *m = (GLfixed *) 0;
- m = (GLfixed *)getPointer(_env, m_buf, &_array, &_remaining);
+ m = (GLfixed *)getPointer(_env, m_buf, &_array, &_remaining, &_bufferOffset);
+ if (m == NULL) {
+ char * _mBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ m = (GLfixed *) (_mBase + _bufferOffset);
+ }
glMultMatrixxOES(
(GLfixed *)m
);
@@ -1593,10 +1684,15 @@
android_glPointParameterxvOES__ILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
- params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLfixed *) (_paramsBase + _bufferOffset);
+ }
glPointParameterxvOES(
(GLenum)pname,
(GLfixed *)params
@@ -1718,10 +1814,15 @@
android_glTexEnvxvOES__IILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
- params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLfixed *) (_paramsBase + _bufferOffset);
+ }
glTexEnvxvOES(
(GLenum)target,
(GLenum)pname,
@@ -1792,10 +1893,15 @@
android_glTexParameterxvOES__IILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
- params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLfixed *) (_paramsBase + _bufferOffset);
+ }
glTexParameterxvOES(
(GLenum)target,
(GLenum)pname,
@@ -1895,16 +2001,21 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLuint *renderbuffers = (GLuint *) 0;
- renderbuffers = (GLuint *)getPointer(_env, renderbuffers_buf, &_array, &_remaining);
+ renderbuffers = (GLuint *)getPointer(_env, renderbuffers_buf, &_array, &_remaining, &_bufferOffset);
if (_remaining < n) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "remaining() < n < needed";
goto exit;
}
+ if (renderbuffers == NULL) {
+ char * _renderbuffersBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ renderbuffers = (GLuint *) (_renderbuffersBase + _bufferOffset);
+ }
glDeleteRenderbuffersOES(
(GLsizei)n,
(GLuint *)renderbuffers
@@ -1976,16 +2087,21 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLuint *renderbuffers = (GLuint *) 0;
- renderbuffers = (GLuint *)getPointer(_env, renderbuffers_buf, &_array, &_remaining);
+ renderbuffers = (GLuint *)getPointer(_env, renderbuffers_buf, &_array, &_remaining, &_bufferOffset);
if (_remaining < n) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "remaining() < n < needed";
goto exit;
}
+ if (renderbuffers == NULL) {
+ char * _renderbuffersBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ renderbuffers = (GLuint *) (_renderbuffersBase + _bufferOffset);
+ }
glGenRenderbuffersOES(
(GLsizei)n,
(GLuint *)renderbuffers
@@ -2070,16 +2186,21 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLint *params = (GLint *) 0;
- params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
if (_remaining < 1) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "remaining() < 1 < needed";
goto exit;
}
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLint *) (_paramsBase + _bufferOffset);
+ }
glGetRenderbufferParameterivOES(
(GLenum)target,
(GLenum)pname,
@@ -2173,16 +2294,21 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLuint *framebuffers = (GLuint *) 0;
- framebuffers = (GLuint *)getPointer(_env, framebuffers_buf, &_array, &_remaining);
+ framebuffers = (GLuint *)getPointer(_env, framebuffers_buf, &_array, &_remaining, &_bufferOffset);
if (_remaining < n) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "remaining() < n < needed";
goto exit;
}
+ if (framebuffers == NULL) {
+ char * _framebuffersBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ framebuffers = (GLuint *) (_framebuffersBase + _bufferOffset);
+ }
glDeleteFramebuffersOES(
(GLsizei)n,
(GLuint *)framebuffers
@@ -2254,16 +2380,21 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLuint *framebuffers = (GLuint *) 0;
- framebuffers = (GLuint *)getPointer(_env, framebuffers_buf, &_array, &_remaining);
+ framebuffers = (GLuint *)getPointer(_env, framebuffers_buf, &_array, &_remaining, &_bufferOffset);
if (_remaining < n) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "remaining() < n < needed";
goto exit;
}
+ if (framebuffers == NULL) {
+ char * _framebuffersBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ framebuffers = (GLuint *) (_framebuffersBase + _bufferOffset);
+ }
glGenFramebuffersOES(
(GLsizei)n,
(GLuint *)framebuffers
@@ -2373,16 +2504,21 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLint *params = (GLint *) 0;
- params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
if (_remaining < 1) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "remaining() < 1 < needed";
goto exit;
}
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLint *) (_paramsBase + _bufferOffset);
+ }
glGetFramebufferAttachmentParameterivOES(
(GLenum)target,
(GLenum)attachment,
@@ -2429,6 +2565,7 @@
android_glMatrixIndexPointerOESBounds__IIILjava_nio_Buffer_2I
(JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLvoid *pointer = (GLvoid *) 0;
@@ -2452,6 +2589,7 @@
android_glWeightPointerOESBounds__IIILjava_nio_Buffer_2I
(JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLvoid *pointer = (GLvoid *) 0;
@@ -2556,10 +2694,15 @@
android_glClipPlanefOES__ILjava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jint plane, jobject equation_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *equation = (GLfloat *) 0;
- equation = (GLfloat *)getPointer(_env, equation_buf, &_array, &_remaining);
+ equation = (GLfloat *)getPointer(_env, equation_buf, &_array, &_remaining, &_bufferOffset);
+ if (equation == NULL) {
+ char * _equationBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ equation = (GLfloat *) (_equationBase + _bufferOffset);
+ }
glClipPlanefOES(
(GLenum)plane,
(GLfloat *)equation
@@ -2626,16 +2769,21 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *eqn = (GLfloat *) 0;
- eqn = (GLfloat *)getPointer(_env, eqn_buf, &_array, &_remaining);
+ eqn = (GLfloat *)getPointer(_env, eqn_buf, &_array, &_remaining, &_bufferOffset);
if (_remaining < 4) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "remaining() < 4 < needed";
goto exit;
}
+ if (eqn == NULL) {
+ char * _eqnBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ eqn = (GLfloat *) (_eqnBase + _bufferOffset);
+ }
glGetClipPlanefOES(
(GLenum)pname,
(GLfloat *)eqn
@@ -2719,10 +2867,15 @@
android_glTexGenfvOES__IILjava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *params = (GLfloat *) 0;
- params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLfloat *) (_paramsBase + _bufferOffset);
+ }
glTexGenfvOES(
(GLenum)coord,
(GLenum)pname,
@@ -2793,10 +2946,15 @@
android_glTexGenivOES__IILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLint *params = (GLint *) 0;
- params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLint *) (_paramsBase + _bufferOffset);
+ }
glTexGenivOES(
(GLenum)coord,
(GLenum)pname,
@@ -2867,10 +3025,15 @@
android_glTexGenxvOES__IILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
- params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLfixed *) (_paramsBase + _bufferOffset);
+ }
glTexGenxvOES(
(GLenum)coord,
(GLenum)pname,
@@ -2930,10 +3093,15 @@
android_glGetTexGenfvOES__IILjava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *params = (GLfloat *) 0;
- params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLfloat *) (_paramsBase + _bufferOffset);
+ }
glGetTexGenfvOES(
(GLenum)coord,
(GLenum)pname,
@@ -2993,10 +3161,15 @@
android_glGetTexGenivOES__IILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLint *params = (GLint *) 0;
- params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLint *) (_paramsBase + _bufferOffset);
+ }
glGetTexGenivOES(
(GLenum)coord,
(GLenum)pname,
@@ -3056,10 +3229,15 @@
android_glGetTexGenxvOES__IILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
- params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLfixed *) (_paramsBase + _bufferOffset);
+ }
glGetTexGenxvOES(
(GLenum)coord,
(GLenum)pname,
diff --git a/core/jni/android_opengl_GLES20.cpp b/core/jni/android_opengl_GLES20.cpp
index 87ff270..c530117 100644
--- a/core/jni/android_opengl_GLES20.cpp
+++ b/core/jni/android_opengl_GLES20.cpp
@@ -63,14 +63,12 @@
static void *
-getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining)
+getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining, jint *offset)
{
jint position;
jint limit;
jint elementSizeShift;
jlong pointer;
- jint offset;
- void *data;
position = _env->GetIntField(buffer, positionID);
limit = _env->GetIntField(buffer, limitID);
@@ -85,11 +83,10 @@
*array = (jarray) _env->CallStaticObjectMethod(nioAccessClass,
getBaseArrayID, buffer);
- offset = _env->CallStaticIntMethod(nioAccessClass,
+ *offset = _env->CallStaticIntMethod(nioAccessClass,
getBaseArrayOffsetID, buffer);
- data = _env->GetPrimitiveArrayCritical(*array, (jboolean *) 0);
- return (void *) ((char *) data + offset);
+ return NULL;
}
@@ -279,11 +276,12 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLvoid *data = (GLvoid *) 0;
if (data_buf) {
- data = (GLvoid *)getPointer(_env, data_buf, &_array, &_remaining);
+ data = (GLvoid *)getPointer(_env, data_buf, &_array, &_remaining, &_bufferOffset);
if (_remaining < size) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
@@ -291,6 +289,10 @@
goto exit;
}
}
+ if (data_buf && data == NULL) {
+ char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ data = (GLvoid *) (_dataBase + _bufferOffset);
+ }
glBufferData(
(GLenum)target,
(GLsizeiptr)size,
@@ -315,16 +317,21 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLvoid *data = (GLvoid *) 0;
- data = (GLvoid *)getPointer(_env, data_buf, &_array, &_remaining);
+ data = (GLvoid *)getPointer(_env, data_buf, &_array, &_remaining, &_bufferOffset);
if (_remaining < size) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "remaining() < size < needed";
goto exit;
}
+ if (data == NULL) {
+ char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ data = (GLvoid *) (_dataBase + _bufferOffset);
+ }
glBufferSubData(
(GLenum)target,
(GLintptr)offset,
@@ -417,10 +424,15 @@
android_glCompressedTexImage2D__IIIIIIILjava_nio_Buffer_2
(JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint width, jint height, jint border, jint imageSize, jobject data_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLvoid *data = (GLvoid *) 0;
- data = (GLvoid *)getPointer(_env, data_buf, &_array, &_remaining);
+ data = (GLvoid *)getPointer(_env, data_buf, &_array, &_remaining, &_bufferOffset);
+ if (data == NULL) {
+ char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ data = (GLvoid *) (_dataBase + _bufferOffset);
+ }
glCompressedTexImage2D(
(GLenum)target,
(GLint)level,
@@ -441,10 +453,15 @@
android_glCompressedTexSubImage2D__IIIIIIIILjava_nio_Buffer_2
(JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint width, jint height, jint format, jint imageSize, jobject data_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLvoid *data = (GLvoid *) 0;
- data = (GLvoid *)getPointer(_env, data_buf, &_array, &_remaining);
+ data = (GLvoid *)getPointer(_env, data_buf, &_array, &_remaining, &_bufferOffset);
+ if (data == NULL) {
+ char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ data = (GLvoid *) (_dataBase + _bufferOffset);
+ }
glCompressedTexSubImage2D(
(GLenum)target,
(GLint)level,
@@ -579,16 +596,21 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLuint *buffers = (GLuint *) 0;
- buffers = (GLuint *)getPointer(_env, buffers_buf, &_array, &_remaining);
+ buffers = (GLuint *)getPointer(_env, buffers_buf, &_array, &_remaining, &_bufferOffset);
if (_remaining < n) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "remaining() < n < needed";
goto exit;
}
+ if (buffers == NULL) {
+ char * _buffersBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ buffers = (GLuint *) (_buffersBase + _bufferOffset);
+ }
glDeleteBuffers(
(GLsizei)n,
(GLuint *)buffers
@@ -651,10 +673,15 @@
android_glDeleteFramebuffers__ILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint n, jobject framebuffers_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLuint *framebuffers = (GLuint *) 0;
- framebuffers = (GLuint *)getPointer(_env, framebuffers_buf, &_array, &_remaining);
+ framebuffers = (GLuint *)getPointer(_env, framebuffers_buf, &_array, &_remaining, &_bufferOffset);
+ if (framebuffers == NULL) {
+ char * _framebuffersBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ framebuffers = (GLuint *) (_framebuffersBase + _bufferOffset);
+ }
glDeleteFramebuffers(
(GLsizei)n,
(GLuint *)framebuffers
@@ -721,10 +748,15 @@
android_glDeleteRenderbuffers__ILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint n, jobject renderbuffers_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLuint *renderbuffers = (GLuint *) 0;
- renderbuffers = (GLuint *)getPointer(_env, renderbuffers_buf, &_array, &_remaining);
+ renderbuffers = (GLuint *)getPointer(_env, renderbuffers_buf, &_array, &_remaining, &_bufferOffset);
+ if (renderbuffers == NULL) {
+ char * _renderbuffersBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ renderbuffers = (GLuint *) (_renderbuffersBase + _bufferOffset);
+ }
glDeleteRenderbuffers(
(GLsizei)n,
(GLuint *)renderbuffers
@@ -800,16 +832,21 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLuint *textures = (GLuint *) 0;
- textures = (GLuint *)getPointer(_env, textures_buf, &_array, &_remaining);
+ textures = (GLuint *)getPointer(_env, textures_buf, &_array, &_remaining, &_bufferOffset);
if (_remaining < n) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "remaining() < n < needed";
goto exit;
}
+ if (textures == NULL) {
+ char * _texturesBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ textures = (GLuint *) (_texturesBase + _bufferOffset);
+ }
glDeleteTextures(
(GLsizei)n,
(GLuint *)textures
@@ -917,16 +954,21 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLvoid *indices = (GLvoid *) 0;
- indices = (GLvoid *)getPointer(_env, indices_buf, &_array, &_remaining);
+ indices = (GLvoid *)getPointer(_env, indices_buf, &_array, &_remaining, &_bufferOffset);
if (_remaining < count) {
_exception = 1;
_exceptionType = "java/lang/ArrayIndexOutOfBoundsException";
_exceptionMessage = "remaining() < count < needed";
goto exit;
}
+ if (indices == NULL) {
+ char * _indicesBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ indices = (GLvoid *) (_indicesBase + _bufferOffset);
+ }
glDrawElements(
(GLenum)mode,
(GLsizei)count,
@@ -1066,16 +1108,21 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLuint *buffers = (GLuint *) 0;
- buffers = (GLuint *)getPointer(_env, buffers_buf, &_array, &_remaining);
+ buffers = (GLuint *)getPointer(_env, buffers_buf, &_array, &_remaining, &_bufferOffset);
if (_remaining < n) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "remaining() < n < needed";
goto exit;
}
+ if (buffers == NULL) {
+ char * _buffersBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ buffers = (GLuint *) (_buffersBase + _bufferOffset);
+ }
glGenBuffers(
(GLsizei)n,
(GLuint *)buffers
@@ -1147,10 +1194,15 @@
android_glGenFramebuffers__ILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint n, jobject framebuffers_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLuint *framebuffers = (GLuint *) 0;
- framebuffers = (GLuint *)getPointer(_env, framebuffers_buf, &_array, &_remaining);
+ framebuffers = (GLuint *)getPointer(_env, framebuffers_buf, &_array, &_remaining, &_bufferOffset);
+ if (framebuffers == NULL) {
+ char * _framebuffersBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ framebuffers = (GLuint *) (_framebuffersBase + _bufferOffset);
+ }
glGenFramebuffers(
(GLsizei)n,
(GLuint *)framebuffers
@@ -1208,10 +1260,15 @@
android_glGenRenderbuffers__ILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint n, jobject renderbuffers_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLuint *renderbuffers = (GLuint *) 0;
- renderbuffers = (GLuint *)getPointer(_env, renderbuffers_buf, &_array, &_remaining);
+ renderbuffers = (GLuint *)getPointer(_env, renderbuffers_buf, &_array, &_remaining, &_bufferOffset);
+ if (renderbuffers == NULL) {
+ char * _renderbuffersBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ renderbuffers = (GLuint *) (_renderbuffersBase + _bufferOffset);
+ }
glGenRenderbuffers(
(GLsizei)n,
(GLuint *)renderbuffers
@@ -1278,16 +1335,21 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLuint *textures = (GLuint *) 0;
- textures = (GLuint *)getPointer(_env, textures_buf, &_array, &_remaining);
+ textures = (GLuint *)getPointer(_env, textures_buf, &_array, &_remaining, &_bufferOffset);
if (_remaining < n) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "remaining() < n < needed";
goto exit;
}
+ if (textures == NULL) {
+ char * _texturesBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ textures = (GLuint *) (_texturesBase + _bufferOffset);
+ }
glGenTextures(
(GLsizei)n,
(GLuint *)textures
@@ -1427,8 +1489,11 @@
android_glGetActiveAttrib__IIILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2B
(JNIEnv *_env, jobject _this, jint program, jint index, jint bufsize, jobject length_buf, jobject size_buf, jobject type_buf, jbyte name) {
jarray _lengthArray = (jarray) 0;
+ jint _lengthBufferOffset = (jint) 0;
jarray _sizeArray = (jarray) 0;
+ jint _sizeBufferOffset = (jint) 0;
jarray _typeArray = (jarray) 0;
+ jint _typeBufferOffset = (jint) 0;
jint _lengthRemaining;
GLsizei *length = (GLsizei *) 0;
jint _sizeRemaining;
@@ -1436,9 +1501,21 @@
jint _typeRemaining;
GLenum *type = (GLenum *) 0;
- length = (GLsizei *)getPointer(_env, length_buf, &_lengthArray, &_lengthRemaining);
- size = (GLint *)getPointer(_env, size_buf, &_sizeArray, &_sizeRemaining);
- type = (GLenum *)getPointer(_env, type_buf, &_typeArray, &_typeRemaining);
+ length = (GLsizei *)getPointer(_env, length_buf, &_lengthArray, &_lengthRemaining, &_lengthBufferOffset);
+ size = (GLint *)getPointer(_env, size_buf, &_sizeArray, &_sizeRemaining, &_sizeBufferOffset);
+ type = (GLenum *)getPointer(_env, type_buf, &_typeArray, &_typeRemaining, &_typeBufferOffset);
+ if (length == NULL) {
+ char * _lengthBase = (char *)_env->GetPrimitiveArrayCritical(_lengthArray, (jboolean *) 0);
+ length = (GLsizei *) (_lengthBase + _lengthBufferOffset);
+ }
+ if (size == NULL) {
+ char * _sizeBase = (char *)_env->GetPrimitiveArrayCritical(_sizeArray, (jboolean *) 0);
+ size = (GLint *) (_sizeBase + _sizeBufferOffset);
+ }
+ if (type == NULL) {
+ char * _typeBase = (char *)_env->GetPrimitiveArrayCritical(_typeArray, (jboolean *) 0);
+ type = (GLenum *) (_typeBase + _typeBufferOffset);
+ }
glGetActiveAttrib(
(GLuint)program,
(GLuint)index,
@@ -1448,17 +1525,173 @@
(GLenum *)type,
(char *)name
);
- if (_lengthArray) {
- releasePointer(_env, _lengthArray, type, JNI_TRUE);
+ if (_typeArray) {
+ releasePointer(_env, _typeArray, type, JNI_TRUE);
}
if (_sizeArray) {
releasePointer(_env, _sizeArray, size, JNI_TRUE);
}
- if (_typeArray) {
- releasePointer(_env, _typeArray, length, JNI_TRUE);
+ if (_lengthArray) {
+ releasePointer(_env, _lengthArray, length, JNI_TRUE);
}
}
+/* void glGetActiveAttrib ( GLuint program, GLuint index, GLsizei bufsize, GLsizei *length, GLint *size, GLenum *type, char *name ) */
+static jstring
+android_glGetActiveAttrib1
+ (JNIEnv *_env, jobject _this, jint program, jint index, jintArray size_ref, jint sizeOffset, jintArray type_ref, jint typeOffset) {
+ jint _exception = 0;
+ const char * _exceptionType;
+ const char * _exceptionMessage;
+ GLint *size_base = (GLint *) 0;
+ jint _sizeRemaining;
+ GLint *size = (GLint *) 0;
+ GLenum *type_base = (GLenum *) 0;
+ jint _typeRemaining;
+ GLenum *type = (GLenum *) 0;
+
+ jstring result = 0;
+
+ GLint len = 0;
+ glGetProgramiv((GLuint)program, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, &len);
+ if (!len) {
+ return _env->NewStringUTF("");
+ }
+ char* buf = (char*) malloc(len);
+
+ if (buf == NULL) {
+ jniThrowException(_env, "java/lang/IllegalArgumentException", "out of memory");
+ return NULL;
+ }
+ if (!size_ref) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "size == null";
+ goto exit;
+ }
+ if (sizeOffset < 0) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "sizeOffset < 0";
+ goto exit;
+ }
+ _sizeRemaining = _env->GetArrayLength(size_ref) - sizeOffset;
+ size_base = (GLint *)
+ _env->GetPrimitiveArrayCritical(size_ref, (jboolean *)0);
+ size = size_base + sizeOffset;
+
+ if (!type_ref) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "type == null";
+ goto exit;
+ }
+ if (typeOffset < 0) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "typeOffset < 0";
+ goto exit;
+ }
+ _typeRemaining = _env->GetArrayLength(type_ref) - typeOffset;
+ type_base = (GLenum *)
+ _env->GetPrimitiveArrayCritical(type_ref, (jboolean *)0);
+ type = type_base + typeOffset;
+
+ glGetActiveAttrib(
+ (GLuint)program,
+ (GLuint)index,
+ (GLsizei)len,
+ NULL,
+ (GLint *)size,
+ (GLenum *)type,
+ (char *)buf
+ );
+exit:
+ if (type_base) {
+ _env->ReleasePrimitiveArrayCritical(type_ref, type_base,
+ _exception ? JNI_ABORT: 0);
+ }
+ if (size_base) {
+ _env->ReleasePrimitiveArrayCritical(size_ref, size_base,
+ _exception ? JNI_ABORT: 0);
+ }
+ if (_exception != 1) {
+ result = _env->NewStringUTF(buf);
+ }
+ if (buf) {
+ free(buf);
+ }
+ if (_exception) {
+ jniThrowException(_env, _exceptionType, _exceptionMessage);
+ }
+ if (result == 0) {
+ result = _env->NewStringUTF("");
+ }
+
+ return result;
+}
+
+/* void glGetActiveAttrib ( GLuint program, GLuint index, GLsizei bufsize, GLsizei *length, GLint *size, GLenum *type, char *name ) */
+static jstring
+android_glGetActiveAttrib2
+ (JNIEnv *_env, jobject _this, jint program, jint index, jobject size_buf, jobject type_buf) {
+ jarray _sizeArray = (jarray) 0;
+ jint _sizeBufferOffset = (jint) 0;
+ jarray _typeArray = (jarray) 0;
+ jint _typeBufferOffset = (jint) 0;
+ jint _lengthRemaining;
+ GLsizei *length = (GLsizei *) 0;
+ jint _sizeRemaining;
+ GLint *size = (GLint *) 0;
+ jint _typeRemaining;
+ GLenum *type = (GLenum *) 0;
+
+ jstring result = 0;
+
+ GLint len = 0;
+ glGetProgramiv((GLuint)program, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, &len);
+ if (!len) {
+ return _env->NewStringUTF("");
+ }
+ char* buf = (char*) malloc(len);
+
+ if (buf == NULL) {
+ jniThrowException(_env, "java/lang/IllegalArgumentException", "out of memory");
+ return NULL;
+ }
+
+ size = (GLint *)getPointer(_env, size_buf, &_sizeArray, &_sizeRemaining, &_sizeBufferOffset);
+ type = (GLenum *)getPointer(_env, type_buf, &_typeArray, &_typeRemaining, &_typeBufferOffset);
+ if (size == NULL) {
+ char * _sizeBase = (char *)_env->GetPrimitiveArrayCritical(_sizeArray, (jboolean *) 0);
+ size = (GLint *) (_sizeBase + _sizeBufferOffset);
+ }
+ if (type == NULL) {
+ char * _typeBase = (char *)_env->GetPrimitiveArrayCritical(_typeArray, (jboolean *) 0);
+ type = (GLenum *) (_typeBase + _typeBufferOffset);
+ }
+ glGetActiveAttrib(
+ (GLuint)program,
+ (GLuint)index,
+ (GLsizei)len,
+ NULL,
+ (GLint *)size,
+ (GLenum *)type,
+ (char *)buf
+ );
+
+ if (_typeArray) {
+ releasePointer(_env, _typeArray, type, JNI_TRUE);
+ }
+ if (_sizeArray) {
+ releasePointer(_env, _sizeArray, size, JNI_TRUE);
+ }
+ result = _env->NewStringUTF(buf);
+ if (buf) {
+ free(buf);
+ }
+ return result;
+}
/* void glGetActiveUniform ( GLuint program, GLuint index, GLsizei bufsize, GLsizei *length, GLint *size, GLenum *type, char *name ) */
static void
android_glGetActiveUniform__III_3II_3II_3II_3BI
@@ -1584,8 +1817,11 @@
android_glGetActiveUniform__IIILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2B
(JNIEnv *_env, jobject _this, jint program, jint index, jint bufsize, jobject length_buf, jobject size_buf, jobject type_buf, jbyte name) {
jarray _lengthArray = (jarray) 0;
+ jint _lengthBufferOffset = (jint) 0;
jarray _sizeArray = (jarray) 0;
+ jint _sizeBufferOffset = (jint) 0;
jarray _typeArray = (jarray) 0;
+ jint _typeBufferOffset = (jint) 0;
jint _lengthRemaining;
GLsizei *length = (GLsizei *) 0;
jint _sizeRemaining;
@@ -1593,9 +1829,21 @@
jint _typeRemaining;
GLenum *type = (GLenum *) 0;
- length = (GLsizei *)getPointer(_env, length_buf, &_lengthArray, &_lengthRemaining);
- size = (GLint *)getPointer(_env, size_buf, &_sizeArray, &_sizeRemaining);
- type = (GLenum *)getPointer(_env, type_buf, &_typeArray, &_typeRemaining);
+ length = (GLsizei *)getPointer(_env, length_buf, &_lengthArray, &_lengthRemaining, &_lengthBufferOffset);
+ size = (GLint *)getPointer(_env, size_buf, &_sizeArray, &_sizeRemaining, &_sizeBufferOffset);
+ type = (GLenum *)getPointer(_env, type_buf, &_typeArray, &_typeRemaining, &_typeBufferOffset);
+ if (length == NULL) {
+ char * _lengthBase = (char *)_env->GetPrimitiveArrayCritical(_lengthArray, (jboolean *) 0);
+ length = (GLsizei *) (_lengthBase + _lengthBufferOffset);
+ }
+ if (size == NULL) {
+ char * _sizeBase = (char *)_env->GetPrimitiveArrayCritical(_sizeArray, (jboolean *) 0);
+ size = (GLint *) (_sizeBase + _sizeBufferOffset);
+ }
+ if (type == NULL) {
+ char * _typeBase = (char *)_env->GetPrimitiveArrayCritical(_typeArray, (jboolean *) 0);
+ type = (GLenum *) (_typeBase + _typeBufferOffset);
+ }
glGetActiveUniform(
(GLuint)program,
(GLuint)index,
@@ -1605,17 +1853,174 @@
(GLenum *)type,
(char *)name
);
- if (_lengthArray) {
- releasePointer(_env, _lengthArray, type, JNI_TRUE);
+ if (_typeArray) {
+ releasePointer(_env, _typeArray, type, JNI_TRUE);
}
if (_sizeArray) {
releasePointer(_env, _sizeArray, size, JNI_TRUE);
}
- if (_typeArray) {
- releasePointer(_env, _typeArray, length, JNI_TRUE);
+ if (_lengthArray) {
+ releasePointer(_env, _lengthArray, length, JNI_TRUE);
}
}
+/* void glGetActiveUniform ( GLuint program, GLuint index, GLsizei bufsize, GLsizei *length, GLint *size, GLenum *type, char *name ) */
+static jstring
+android_glGetActiveUniform1
+ (JNIEnv *_env, jobject _this, jint program, jint index, jintArray size_ref, jint sizeOffset, jintArray type_ref, jint typeOffset) {
+ jint _exception = 0;
+ const char * _exceptionType;
+ const char * _exceptionMessage;
+
+ GLint *size_base = (GLint *) 0;
+ jint _sizeRemaining;
+ GLint *size = (GLint *) 0;
+
+ GLenum *type_base = (GLenum *) 0;
+ jint _typeRemaining;
+ GLenum *type = (GLenum *) 0;
+
+ jstring result = 0;
+
+ GLint len = 0;
+ glGetProgramiv((GLuint)program, GL_ACTIVE_UNIFORM_MAX_LENGTH, &len);
+ if (!len) {
+ return _env->NewStringUTF("");
+ }
+ char* buf = (char*) malloc(len);
+
+ if (buf == NULL) {
+ jniThrowException(_env, "java/lang/IllegalArgumentException", "out of memory");
+ return NULL;
+ }
+
+ if (!size_ref) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "size == null";
+ goto exit;
+ }
+ if (sizeOffset < 0) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "sizeOffset < 0";
+ goto exit;
+ }
+ _sizeRemaining = _env->GetArrayLength(size_ref) - sizeOffset;
+ size_base = (GLint *)
+ _env->GetPrimitiveArrayCritical(size_ref, (jboolean *)0);
+ size = size_base + sizeOffset;
+
+ if (!type_ref) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "type == null";
+ goto exit;
+ }
+ if (typeOffset < 0) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "typeOffset < 0";
+ goto exit;
+ }
+ _typeRemaining = _env->GetArrayLength(type_ref) - typeOffset;
+ type_base = (GLenum *)
+ _env->GetPrimitiveArrayCritical(type_ref, (jboolean *)0);
+ type = type_base + typeOffset;
+
+ glGetActiveUniform(
+ (GLuint)program,
+ (GLuint)index,
+ (GLsizei)len,
+ NULL,
+ (GLint *)size,
+ (GLenum *)type,
+ (char *)buf
+ );
+
+exit:
+ if (type_base) {
+ _env->ReleasePrimitiveArrayCritical(type_ref, type_base,
+ _exception ? JNI_ABORT: 0);
+ }
+ if (size_base) {
+ _env->ReleasePrimitiveArrayCritical(size_ref, size_base,
+ _exception ? JNI_ABORT: 0);
+ }
+ if (_exception != 1) {
+ result = _env->NewStringUTF(buf);
+ }
+ if (buf) {
+ free(buf);
+ }
+ if (_exception) {
+ jniThrowException(_env, _exceptionType, _exceptionMessage);
+ }
+ if (result == 0) {
+ result = _env->NewStringUTF("");
+ }
+ return result;
+}
+
+/* void glGetActiveUniform ( GLuint program, GLuint index, GLsizei bufsize, GLsizei *length, GLint *size, GLenum *type, char *name ) */
+static jstring
+android_glGetActiveUniform2
+ (JNIEnv *_env, jobject _this, jint program, jint index, jobject size_buf, jobject type_buf) {
+ jarray _sizeArray = (jarray) 0;
+ jint _sizeBufferOffset = (jint) 0;
+ jarray _typeArray = (jarray) 0;
+ jint _typeBufferOffset = (jint) 0;
+ jint _sizeRemaining;
+ GLint *size = (GLint *) 0;
+ jint _typeRemaining;
+ GLenum *type = (GLenum *) 0;
+
+ jstring result = 0;
+ GLint len = 0;
+ glGetProgramiv((GLuint)program, GL_ACTIVE_UNIFORM_MAX_LENGTH, &len);
+ if (!len) {
+ return _env->NewStringUTF("");
+ }
+ char* buf = (char*) malloc(len);
+
+ if (buf == NULL) {
+ jniThrowException(_env, "java/lang/IllegalArgumentException", "out of memory");
+ return NULL;
+ }
+
+ size = (GLint *)getPointer(_env, size_buf, &_sizeArray, &_sizeRemaining, &_sizeBufferOffset);
+ type = (GLenum *)getPointer(_env, type_buf, &_typeArray, &_typeRemaining, &_typeBufferOffset);
+
+ if (size == NULL) {
+ char * _sizeBase = (char *)_env->GetPrimitiveArrayCritical(_sizeArray, (jboolean *) 0);
+ size = (GLint *) (_sizeBase + _sizeBufferOffset);
+ }
+ if (type == NULL) {
+ char * _typeBase = (char *)_env->GetPrimitiveArrayCritical(_typeArray, (jboolean *) 0);
+ type = (GLenum *) (_typeBase + _typeBufferOffset);
+ }
+ glGetActiveUniform(
+ (GLuint)program,
+ (GLuint)index,
+ len,
+ NULL,
+ (GLint *)size,
+ (GLenum *)type,
+ (char *)buf
+ );
+
+ if (_typeArray) {
+ releasePointer(_env, _typeArray, type, JNI_TRUE);
+ }
+ if (_sizeArray) {
+ releasePointer(_env, _sizeArray, size, JNI_TRUE);
+ }
+ result = _env->NewStringUTF(buf);
+ if (buf) {
+ free(buf);
+ }
+ return result;
+}
/* void glGetAttachedShaders ( GLuint program, GLsizei maxcount, GLsizei *count, GLuint *shaders ) */
static void
android_glGetAttachedShaders__II_3II_3II
@@ -1690,25 +2095,35 @@
android_glGetAttachedShaders__IILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint program, jint maxcount, jobject count_buf, jobject shaders_buf) {
jarray _countArray = (jarray) 0;
+ jint _countBufferOffset = (jint) 0;
jarray _shadersArray = (jarray) 0;
+ jint _shadersBufferOffset = (jint) 0;
jint _countRemaining;
GLsizei *count = (GLsizei *) 0;
jint _shadersRemaining;
GLuint *shaders = (GLuint *) 0;
- count = (GLsizei *)getPointer(_env, count_buf, &_countArray, &_countRemaining);
- shaders = (GLuint *)getPointer(_env, shaders_buf, &_shadersArray, &_shadersRemaining);
+ count = (GLsizei *)getPointer(_env, count_buf, &_countArray, &_countRemaining, &_countBufferOffset);
+ shaders = (GLuint *)getPointer(_env, shaders_buf, &_shadersArray, &_shadersRemaining, &_shadersBufferOffset);
+ if (count == NULL) {
+ char * _countBase = (char *)_env->GetPrimitiveArrayCritical(_countArray, (jboolean *) 0);
+ count = (GLsizei *) (_countBase + _countBufferOffset);
+ }
+ if (shaders == NULL) {
+ char * _shadersBase = (char *)_env->GetPrimitiveArrayCritical(_shadersArray, (jboolean *) 0);
+ shaders = (GLuint *) (_shadersBase + _shadersBufferOffset);
+ }
glGetAttachedShaders(
(GLuint)program,
(GLsizei)maxcount,
(GLsizei *)count,
(GLuint *)shaders
);
- if (_countArray) {
- releasePointer(_env, _countArray, shaders, JNI_TRUE);
- }
if (_shadersArray) {
- releasePointer(_env, _shadersArray, count, JNI_TRUE);
+ releasePointer(_env, _shadersArray, shaders, JNI_TRUE);
+ }
+ if (_countArray) {
+ releasePointer(_env, _countArray, count, JNI_TRUE);
}
}
@@ -1793,10 +2208,15 @@
android_glGetBooleanv__ILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLboolean *params = (GLboolean *) 0;
- params = (GLboolean *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLboolean *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLboolean *) (_paramsBase + _bufferOffset);
+ }
glGetBooleanv(
(GLenum)pname,
(GLboolean *)params
@@ -1864,16 +2284,21 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLint *params = (GLint *) 0;
- params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
if (_remaining < 1) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "remaining() < 1 < needed";
goto exit;
}
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLint *) (_paramsBase + _bufferOffset);
+ }
glGetBufferParameteriv(
(GLenum)target,
(GLenum)pname,
@@ -1946,10 +2371,15 @@
android_glGetFloatv__ILjava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *params = (GLfloat *) 0;
- params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLfloat *) (_paramsBase + _bufferOffset);
+ }
glGetFloatv(
(GLenum)pname,
(GLfloat *)params
@@ -2009,10 +2439,15 @@
android_glGetFramebufferAttachmentParameteriv__IIILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint target, jint attachment, jint pname, jobject params_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLint *params = (GLint *) 0;
- params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLint *) (_paramsBase + _bufferOffset);
+ }
glGetFramebufferAttachmentParameteriv(
(GLenum)target,
(GLenum)attachment,
@@ -2412,10 +2847,11 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLint *params = (GLint *) 0;
- params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
int _needed;
switch (pname) {
#if defined(GL_ALPHA_BITS)
@@ -2753,6 +3189,10 @@
_exceptionMessage = "remaining() < needed";
goto exit;
}
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLint *) (_paramsBase + _bufferOffset);
+ }
glGetIntegerv(
(GLenum)pname,
(GLint *)params
@@ -2816,10 +3256,15 @@
android_glGetProgramiv__IILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint program, jint pname, jobject params_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLint *params = (GLint *) 0;
- params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLint *) (_paramsBase + _bufferOffset);
+ }
glGetProgramiv(
(GLuint)program,
(GLenum)pname,
@@ -2898,10 +3343,15 @@
android_glGetRenderbufferParameteriv__IILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLint *params = (GLint *) 0;
- params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLint *) (_paramsBase + _bufferOffset);
+ }
glGetRenderbufferParameteriv(
(GLenum)target,
(GLenum)pname,
@@ -2961,10 +3411,15 @@
android_glGetShaderiv__IILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint shader, jint pname, jobject params_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLint *params = (GLint *) 0;
- params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLint *) (_paramsBase + _bufferOffset);
+ }
glGetShaderiv(
(GLuint)shader,
(GLenum)pname,
@@ -3068,25 +3523,35 @@
android_glGetShaderPrecisionFormat__IILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint shadertype, jint precisiontype, jobject range_buf, jobject precision_buf) {
jarray _rangeArray = (jarray) 0;
+ jint _rangeBufferOffset = (jint) 0;
jarray _precisionArray = (jarray) 0;
+ jint _precisionBufferOffset = (jint) 0;
jint _rangeRemaining;
GLint *range = (GLint *) 0;
jint _precisionRemaining;
GLint *precision = (GLint *) 0;
- range = (GLint *)getPointer(_env, range_buf, &_rangeArray, &_rangeRemaining);
- precision = (GLint *)getPointer(_env, precision_buf, &_precisionArray, &_precisionRemaining);
+ range = (GLint *)getPointer(_env, range_buf, &_rangeArray, &_rangeRemaining, &_rangeBufferOffset);
+ precision = (GLint *)getPointer(_env, precision_buf, &_precisionArray, &_precisionRemaining, &_precisionBufferOffset);
+ if (range == NULL) {
+ char * _rangeBase = (char *)_env->GetPrimitiveArrayCritical(_rangeArray, (jboolean *) 0);
+ range = (GLint *) (_rangeBase + _rangeBufferOffset);
+ }
+ if (precision == NULL) {
+ char * _precisionBase = (char *)_env->GetPrimitiveArrayCritical(_precisionArray, (jboolean *) 0);
+ precision = (GLint *) (_precisionBase + _precisionBufferOffset);
+ }
glGetShaderPrecisionFormat(
(GLenum)shadertype,
(GLenum)precisiontype,
(GLint *)range,
(GLint *)precision
);
- if (_rangeArray) {
- releasePointer(_env, _rangeArray, precision, JNI_TRUE);
- }
if (_precisionArray) {
- releasePointer(_env, _precisionArray, range, JNI_TRUE);
+ releasePointer(_env, _precisionArray, precision, JNI_TRUE);
+ }
+ if (_rangeArray) {
+ releasePointer(_env, _rangeArray, range, JNI_TRUE);
}
}
@@ -3164,10 +3629,15 @@
android_glGetShaderSource__IILjava_nio_IntBuffer_2B
(JNIEnv *_env, jobject _this, jint shader, jint bufsize, jobject length_buf, jbyte source) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLsizei *length = (GLsizei *) 0;
- length = (GLsizei *)getPointer(_env, length_buf, &_array, &_remaining);
+ length = (GLsizei *)getPointer(_env, length_buf, &_array, &_remaining, &_bufferOffset);
+ if (length == NULL) {
+ char * _lengthBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ length = (GLsizei *) (_lengthBase + _bufferOffset);
+ }
glGetShaderSource(
(GLuint)shader,
(GLsizei)bufsize,
@@ -3179,6 +3649,23 @@
}
}
+/* void glGetShaderSource ( GLuint shader, GLsizei bufsize, GLsizei *length, char *source ) */
+static jstring android_glGetShaderSource(JNIEnv *_env, jobject, jint shader) {
+ GLint shaderLen = 0;
+ glGetShaderiv((GLuint)shader, GL_SHADER_SOURCE_LENGTH, &shaderLen);
+ if (!shaderLen) {
+ return _env->NewStringUTF("");
+ }
+ char* buf = (char*) malloc(shaderLen);
+ if (buf == NULL) {
+ jniThrowException(_env, "java/lang/IllegalArgumentException", "out of memory");
+ return NULL;
+ }
+ glGetShaderSource(shader, shaderLen, NULL, buf);
+ jstring result = _env->NewStringUTF(buf);
+ free(buf);
+ return result;
+}
/* const GLubyte * glGetString ( GLenum name ) */
static jstring android_glGetString(JNIEnv* _env, jobject, jint name) {
const char* chars = (const char*) glGetString((GLenum) name);
@@ -3242,16 +3729,21 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *params = (GLfloat *) 0;
- params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
if (_remaining < 1) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "remaining() < 1 < needed";
goto exit;
}
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLfloat *) (_paramsBase + _bufferOffset);
+ }
glGetTexParameterfv(
(GLenum)target,
(GLenum)pname,
@@ -3325,16 +3817,21 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLint *params = (GLint *) 0;
- params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
if (_remaining < 1) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "remaining() < 1 < needed";
goto exit;
}
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLint *) (_paramsBase + _bufferOffset);
+ }
glGetTexParameteriv(
(GLenum)target,
(GLenum)pname,
@@ -3399,10 +3896,15 @@
android_glGetUniformfv__IILjava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jint program, jint location, jobject params_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *params = (GLfloat *) 0;
- params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLfloat *) (_paramsBase + _bufferOffset);
+ }
glGetUniformfv(
(GLuint)program,
(GLint)location,
@@ -3462,10 +3964,15 @@
android_glGetUniformiv__IILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint program, jint location, jobject params_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLint *params = (GLint *) 0;
- params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLint *) (_paramsBase + _bufferOffset);
+ }
glGetUniformiv(
(GLuint)program,
(GLint)location,
@@ -3558,10 +4065,15 @@
android_glGetVertexAttribfv__IILjava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jint index, jint pname, jobject params_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *params = (GLfloat *) 0;
- params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLfloat *) (_paramsBase + _bufferOffset);
+ }
glGetVertexAttribfv(
(GLuint)index,
(GLenum)pname,
@@ -3621,10 +4133,15 @@
android_glGetVertexAttribiv__IILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint index, jint pname, jobject params_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLint *params = (GLint *) 0;
- params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLint *) (_paramsBase + _bufferOffset);
+ }
glGetVertexAttribiv(
(GLuint)index,
(GLenum)pname,
@@ -3765,10 +4282,15 @@
android_glReadPixels__IIIIIILjava_nio_Buffer_2
(JNIEnv *_env, jobject _this, jint x, jint y, jint width, jint height, jint format, jint type, jobject pixels_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLvoid *pixels = (GLvoid *) 0;
- pixels = (GLvoid *)getPointer(_env, pixels_buf, &_array, &_remaining);
+ pixels = (GLvoid *)getPointer(_env, pixels_buf, &_array, &_remaining, &_bufferOffset);
+ if (pixels == NULL) {
+ char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ pixels = (GLvoid *) (_pixelsBase + _bufferOffset);
+ }
glReadPixels(
(GLint)x,
(GLint)y,
@@ -3832,6 +4354,7 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
GLuint *shaders_base = (GLuint *) 0;
jint _shadersRemaining;
GLuint *shaders = (GLuint *) 0;
@@ -3855,7 +4378,11 @@
_env->GetPrimitiveArrayCritical(shaders_ref, (jboolean *)0);
shaders = shaders_base + offset;
- binary = (GLvoid *)getPointer(_env, binary_buf, &_array, &_binaryRemaining);
+ binary = (GLvoid *)getPointer(_env, binary_buf, &_array, &_binaryRemaining, &_bufferOffset);
+ if (binary == NULL) {
+ char * _binaryBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ binary = (GLvoid *) (_binaryBase + _bufferOffset);
+ }
glShaderBinary(
(GLsizei)n,
(GLuint *)shaders,
@@ -3882,14 +4409,24 @@
android_glShaderBinary__ILjava_nio_IntBuffer_2ILjava_nio_Buffer_2I
(JNIEnv *_env, jobject _this, jint n, jobject shaders_buf, jint binaryformat, jobject binary_buf, jint length) {
jarray _shadersArray = (jarray) 0;
+ jint _shadersBufferOffset = (jint) 0;
jarray _binaryArray = (jarray) 0;
+ jint _binaryBufferOffset = (jint) 0;
jint _shadersRemaining;
GLuint *shaders = (GLuint *) 0;
jint _binaryRemaining;
GLvoid *binary = (GLvoid *) 0;
- shaders = (GLuint *)getPointer(_env, shaders_buf, &_shadersArray, &_shadersRemaining);
- binary = (GLvoid *)getPointer(_env, binary_buf, &_binaryArray, &_binaryRemaining);
+ shaders = (GLuint *)getPointer(_env, shaders_buf, &_shadersArray, &_shadersRemaining, &_shadersBufferOffset);
+ binary = (GLvoid *)getPointer(_env, binary_buf, &_binaryArray, &_binaryRemaining, &_binaryBufferOffset);
+ if (shaders == NULL) {
+ char * _shadersBase = (char *)_env->GetPrimitiveArrayCritical(_shadersArray, (jboolean *) 0);
+ shaders = (GLuint *) (_shadersBase + _shadersBufferOffset);
+ }
+ if (binary == NULL) {
+ char * _binaryBase = (char *)_env->GetPrimitiveArrayCritical(_binaryArray, (jboolean *) 0);
+ binary = (GLvoid *) (_binaryBase + _binaryBufferOffset);
+ }
glShaderBinary(
(GLsizei)n,
(GLuint *)shaders,
@@ -3897,11 +4434,11 @@
(GLvoid *)binary,
(GLsizei)length
);
- if (_shadersArray) {
- releasePointer(_env, _shadersArray, binary, JNI_FALSE);
- }
if (_binaryArray) {
- releasePointer(_env, _binaryArray, shaders, JNI_FALSE);
+ releasePointer(_env, _binaryArray, binary, JNI_FALSE);
+ }
+ if (_shadersArray) {
+ releasePointer(_env, _shadersArray, shaders, JNI_FALSE);
}
}
@@ -3992,11 +4529,16 @@
android_glTexImage2D__IIIIIIIILjava_nio_Buffer_2
(JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint width, jint height, jint border, jint format, jint type, jobject pixels_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLvoid *pixels = (GLvoid *) 0;
if (pixels_buf) {
- pixels = (GLvoid *)getPointer(_env, pixels_buf, &_array, &_remaining);
+ pixels = (GLvoid *)getPointer(_env, pixels_buf, &_array, &_remaining, &_bufferOffset);
+ }
+ if (pixels_buf && pixels == NULL) {
+ char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ pixels = (GLvoid *) (_pixelsBase + _bufferOffset);
}
glTexImage2D(
(GLenum)target,
@@ -4083,16 +4625,21 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *params = (GLfloat *) 0;
- params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
if (_remaining < 1) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "remaining() < 1 < needed";
goto exit;
}
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLfloat *) (_paramsBase + _bufferOffset);
+ }
glTexParameterfv(
(GLenum)target,
(GLenum)pname,
@@ -4177,16 +4724,21 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLint *params = (GLint *) 0;
- params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
if (_remaining < 1) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "remaining() < 1 < needed";
goto exit;
}
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLint *) (_paramsBase + _bufferOffset);
+ }
glTexParameteriv(
(GLenum)target,
(GLenum)pname,
@@ -4207,11 +4759,16 @@
android_glTexSubImage2D__IIIIIIIILjava_nio_Buffer_2
(JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint width, jint height, jint format, jint type, jobject pixels_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLvoid *pixels = (GLvoid *) 0;
if (pixels_buf) {
- pixels = (GLvoid *)getPointer(_env, pixels_buf, &_array, &_remaining);
+ pixels = (GLvoid *)getPointer(_env, pixels_buf, &_array, &_remaining, &_bufferOffset);
+ }
+ if (pixels_buf && pixels == NULL) {
+ char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ pixels = (GLvoid *) (_pixelsBase + _bufferOffset);
}
glTexSubImage2D(
(GLenum)target,
@@ -4288,10 +4845,15 @@
android_glUniform1fv__IILjava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jint location, jint count, jobject v_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *v = (GLfloat *) 0;
- v = (GLfloat *)getPointer(_env, v_buf, &_array, &_remaining);
+ v = (GLfloat *)getPointer(_env, v_buf, &_array, &_remaining, &_bufferOffset);
+ if (v == NULL) {
+ char * _vBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ v = (GLfloat *) (_vBase + _bufferOffset);
+ }
glUniform1fv(
(GLint)location,
(GLsizei)count,
@@ -4361,10 +4923,15 @@
android_glUniform1iv__IILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint location, jint count, jobject v_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLint *v = (GLint *) 0;
- v = (GLint *)getPointer(_env, v_buf, &_array, &_remaining);
+ v = (GLint *)getPointer(_env, v_buf, &_array, &_remaining, &_bufferOffset);
+ if (v == NULL) {
+ char * _vBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ v = (GLint *) (_vBase + _bufferOffset);
+ }
glUniform1iv(
(GLint)location,
(GLsizei)count,
@@ -4435,10 +5002,15 @@
android_glUniform2fv__IILjava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jint location, jint count, jobject v_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *v = (GLfloat *) 0;
- v = (GLfloat *)getPointer(_env, v_buf, &_array, &_remaining);
+ v = (GLfloat *)getPointer(_env, v_buf, &_array, &_remaining, &_bufferOffset);
+ if (v == NULL) {
+ char * _vBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ v = (GLfloat *) (_vBase + _bufferOffset);
+ }
glUniform2fv(
(GLint)location,
(GLsizei)count,
@@ -4509,10 +5081,15 @@
android_glUniform2iv__IILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint location, jint count, jobject v_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLint *v = (GLint *) 0;
- v = (GLint *)getPointer(_env, v_buf, &_array, &_remaining);
+ v = (GLint *)getPointer(_env, v_buf, &_array, &_remaining, &_bufferOffset);
+ if (v == NULL) {
+ char * _vBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ v = (GLint *) (_vBase + _bufferOffset);
+ }
glUniform2iv(
(GLint)location,
(GLsizei)count,
@@ -4584,10 +5161,15 @@
android_glUniform3fv__IILjava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jint location, jint count, jobject v_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *v = (GLfloat *) 0;
- v = (GLfloat *)getPointer(_env, v_buf, &_array, &_remaining);
+ v = (GLfloat *)getPointer(_env, v_buf, &_array, &_remaining, &_bufferOffset);
+ if (v == NULL) {
+ char * _vBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ v = (GLfloat *) (_vBase + _bufferOffset);
+ }
glUniform3fv(
(GLint)location,
(GLsizei)count,
@@ -4659,10 +5241,15 @@
android_glUniform3iv__IILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint location, jint count, jobject v_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLint *v = (GLint *) 0;
- v = (GLint *)getPointer(_env, v_buf, &_array, &_remaining);
+ v = (GLint *)getPointer(_env, v_buf, &_array, &_remaining, &_bufferOffset);
+ if (v == NULL) {
+ char * _vBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ v = (GLint *) (_vBase + _bufferOffset);
+ }
glUniform3iv(
(GLint)location,
(GLsizei)count,
@@ -4735,10 +5322,15 @@
android_glUniform4fv__IILjava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jint location, jint count, jobject v_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *v = (GLfloat *) 0;
- v = (GLfloat *)getPointer(_env, v_buf, &_array, &_remaining);
+ v = (GLfloat *)getPointer(_env, v_buf, &_array, &_remaining, &_bufferOffset);
+ if (v == NULL) {
+ char * _vBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ v = (GLfloat *) (_vBase + _bufferOffset);
+ }
glUniform4fv(
(GLint)location,
(GLsizei)count,
@@ -4811,10 +5403,15 @@
android_glUniform4iv__IILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint location, jint count, jobject v_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLint *v = (GLint *) 0;
- v = (GLint *)getPointer(_env, v_buf, &_array, &_remaining);
+ v = (GLint *)getPointer(_env, v_buf, &_array, &_remaining, &_bufferOffset);
+ if (v == NULL) {
+ char * _vBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ v = (GLint *) (_vBase + _bufferOffset);
+ }
glUniform4iv(
(GLint)location,
(GLsizei)count,
@@ -4875,10 +5472,15 @@
android_glUniformMatrix2fv__IIZLjava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jobject value_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *value = (GLfloat *) 0;
- value = (GLfloat *)getPointer(_env, value_buf, &_array, &_remaining);
+ value = (GLfloat *)getPointer(_env, value_buf, &_array, &_remaining, &_bufferOffset);
+ if (value == NULL) {
+ char * _valueBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ value = (GLfloat *) (_valueBase + _bufferOffset);
+ }
glUniformMatrix2fv(
(GLint)location,
(GLsizei)count,
@@ -4940,10 +5542,15 @@
android_glUniformMatrix3fv__IIZLjava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jobject value_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *value = (GLfloat *) 0;
- value = (GLfloat *)getPointer(_env, value_buf, &_array, &_remaining);
+ value = (GLfloat *)getPointer(_env, value_buf, &_array, &_remaining, &_bufferOffset);
+ if (value == NULL) {
+ char * _valueBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ value = (GLfloat *) (_valueBase + _bufferOffset);
+ }
glUniformMatrix3fv(
(GLint)location,
(GLsizei)count,
@@ -5005,10 +5612,15 @@
android_glUniformMatrix4fv__IIZLjava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jobject value_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *value = (GLfloat *) 0;
- value = (GLfloat *)getPointer(_env, value_buf, &_array, &_remaining);
+ value = (GLfloat *)getPointer(_env, value_buf, &_array, &_remaining, &_bufferOffset);
+ if (value == NULL) {
+ char * _valueBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ value = (GLfloat *) (_valueBase + _bufferOffset);
+ }
glUniformMatrix4fv(
(GLint)location,
(GLsizei)count,
@@ -5096,10 +5708,15 @@
android_glVertexAttrib1fv__ILjava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jint indx, jobject values_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *values = (GLfloat *) 0;
- values = (GLfloat *)getPointer(_env, values_buf, &_array, &_remaining);
+ values = (GLfloat *)getPointer(_env, values_buf, &_array, &_remaining, &_bufferOffset);
+ if (values == NULL) {
+ char * _valuesBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ values = (GLfloat *) (_valuesBase + _bufferOffset);
+ }
glVertexAttrib1fv(
(GLuint)indx,
(GLfloat *)values
@@ -5168,10 +5785,15 @@
android_glVertexAttrib2fv__ILjava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jint indx, jobject values_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *values = (GLfloat *) 0;
- values = (GLfloat *)getPointer(_env, values_buf, &_array, &_remaining);
+ values = (GLfloat *)getPointer(_env, values_buf, &_array, &_remaining, &_bufferOffset);
+ if (values == NULL) {
+ char * _valuesBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ values = (GLfloat *) (_valuesBase + _bufferOffset);
+ }
glVertexAttrib2fv(
(GLuint)indx,
(GLfloat *)values
@@ -5241,10 +5863,15 @@
android_glVertexAttrib3fv__ILjava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jint indx, jobject values_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *values = (GLfloat *) 0;
- values = (GLfloat *)getPointer(_env, values_buf, &_array, &_remaining);
+ values = (GLfloat *)getPointer(_env, values_buf, &_array, &_remaining, &_bufferOffset);
+ if (values == NULL) {
+ char * _valuesBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ values = (GLfloat *) (_valuesBase + _bufferOffset);
+ }
glVertexAttrib3fv(
(GLuint)indx,
(GLfloat *)values
@@ -5315,10 +5942,15 @@
android_glVertexAttrib4fv__ILjava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jint indx, jobject values_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *values = (GLfloat *) 0;
- values = (GLfloat *)getPointer(_env, values_buf, &_array, &_remaining);
+ values = (GLfloat *)getPointer(_env, values_buf, &_array, &_remaining, &_bufferOffset);
+ if (values == NULL) {
+ char * _valuesBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ values = (GLfloat *) (_valuesBase + _bufferOffset);
+ }
glVertexAttrib4fv(
(GLuint)indx,
(GLfloat *)values
@@ -5347,6 +5979,7 @@
android_glVertexAttribPointerBounds__IIIZILjava_nio_Buffer_2I
(JNIEnv *_env, jobject _this, jint indx, jint size, jint type, jboolean normalized, jint stride, jobject ptr_buf, jint remaining) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLvoid *ptr = (GLvoid *) 0;
@@ -5448,8 +6081,12 @@
{"glGenTextures", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenTextures__ILjava_nio_IntBuffer_2 },
{"glGetActiveAttrib", "(III[II[II[II[BI)V", (void *) android_glGetActiveAttrib__III_3II_3II_3II_3BI },
{"glGetActiveAttrib", "(IIILjava/nio/IntBuffer;Ljava/nio/IntBuffer;Ljava/nio/IntBuffer;B)V", (void *) android_glGetActiveAttrib__IIILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2B },
+{"glGetActiveAttrib", "(II[II[II)Ljava/lang/String;", (void *) android_glGetActiveAttrib1 },
+{"glGetActiveAttrib", "(IILjava/nio/IntBuffer;Ljava/nio/IntBuffer;)Ljava/lang/String;", (void *) android_glGetActiveAttrib2 },
{"glGetActiveUniform", "(III[II[II[II[BI)V", (void *) android_glGetActiveUniform__III_3II_3II_3II_3BI },
+{"glGetActiveUniform", "(II[II[II)Ljava/lang/String;", (void *) android_glGetActiveUniform1 },
{"glGetActiveUniform", "(IIILjava/nio/IntBuffer;Ljava/nio/IntBuffer;Ljava/nio/IntBuffer;B)V", (void *) android_glGetActiveUniform__IIILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2B },
+{"glGetActiveUniform", "(IILjava/nio/IntBuffer;Ljava/nio/IntBuffer;)Ljava/lang/String;", (void *) android_glGetActiveUniform2 },
{"glGetAttachedShaders", "(II[II[II)V", (void *) android_glGetAttachedShaders__II_3II_3II },
{"glGetAttachedShaders", "(IILjava/nio/IntBuffer;Ljava/nio/IntBuffer;)V", (void *) android_glGetAttachedShaders__IILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2 },
{"glGetAttribLocation", "(ILjava/lang/String;)I", (void *) android_glGetAttribLocation__ILjava_lang_String_2 },
@@ -5476,6 +6113,7 @@
{"glGetShaderPrecisionFormat", "(IILjava/nio/IntBuffer;Ljava/nio/IntBuffer;)V", (void *) android_glGetShaderPrecisionFormat__IILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2 },
{"glGetShaderSource", "(II[II[BI)V", (void *) android_glGetShaderSource__II_3II_3BI },
{"glGetShaderSource", "(IILjava/nio/IntBuffer;B)V", (void *) android_glGetShaderSource__IILjava_nio_IntBuffer_2B },
+{"glGetShaderSource", "(I)Ljava/lang/String;", (void *) android_glGetShaderSource },
{"glGetString", "(I)Ljava/lang/String;", (void *) android_glGetString },
{"glGetTexParameterfv", "(II[FI)V", (void *) android_glGetTexParameterfv__II_3FI },
{"glGetTexParameterfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetTexParameterfv__IILjava_nio_FloatBuffer_2 },
diff --git a/core/jni/android_os_SELinux.cpp b/core/jni/android_os_SELinux.cpp
index eb99d2b..40443ff 100644
--- a/core/jni/android_os_SELinux.cpp
+++ b/core/jni/android_os_SELinux.cpp
@@ -90,14 +90,14 @@
int fd = jniGetFDFromFileDescriptor(env, fileDescriptor);
if (env->ExceptionOccurred() != NULL) {
- LOGE("There was an issue with retrieving the file descriptor");
+ ALOGE("There was an issue with retrieving the file descriptor");
goto bail;
}
if (getpeercon(fd, &context) == -1)
goto bail;
- LOGV("getPeerCon: Successfully retrived context of peer socket '%s'", context);
+ ALOGV("getPeerCon: Successfully retrived context of peer socket '%s'", context);
securityString = env->NewStringUTF(context);
@@ -139,7 +139,7 @@
if ((ret = setfscreatecon(securityContext)) == -1)
goto bail;
- LOGV("setFSCreateCon: set new security context to '%s' ", context == NULL ? "default", context);
+ ALOGV("setFSCreateCon: set new security context to '%s' ", context == NULL ? "default", context);
bail:
if (constant_securityContext != NULL)
@@ -185,7 +185,7 @@
if ((ret = setfilecon(objectPath, newCon)) == -1)
goto bail;
- LOGV("setFileCon: Succesfully set security context '%s' for '%s'", newCon, objectPath);
+ ALOGV("setFileCon: Succesfully set security context '%s' for '%s'", newCon, objectPath);
bail:
env->ReleaseStringUTFChars(path, objectPath);
@@ -224,7 +224,7 @@
if (getfilecon(objectPath, &context) == -1)
goto bail;
- LOGV("getFileCon: Successfully retrived context '%s' for file '%s'", context, objectPath);
+ ALOGV("getFileCon: Successfully retrived context '%s' for file '%s'", context, objectPath);
securityString = env->NewStringUTF(context);
@@ -259,7 +259,7 @@
if (getcon(&context) == -1)
goto bail;
- LOGV("getCon: Successfully retrieved context '%s'", context);
+ ALOGV("getCon: Successfully retrieved context '%s'", context);
securityString = env->NewStringUTF(context);
@@ -295,7 +295,7 @@
if (getpidcon(checkPid, &context) == -1)
goto bail;
- LOGV("getPidCon: Successfully retrived context '%s' for pid '%d'", context, checkPid);
+ ALOGV("getPidCon: Successfully retrived context '%s' for pid '%d'", context, checkPid);
securityString = env->NewStringUTF(context);
@@ -442,7 +442,7 @@
accessGranted = selinux_check_access(myscon, mytcon, mytclass, myperm, NULL);
- LOGV("selinux_check_access returned %d", accessGranted);
+ ALOGV("selinux_check_access returned %d", accessGranted);
env->ReleaseStringUTFChars(scon, const_scon);
env->ReleaseStringUTFChars(tcon, const_tcon);
diff --git a/core/jni/android_os_SystemClock.cpp b/core/jni/android_os_SystemClock.cpp
index 66d58cd..78f989a 100644
--- a/core/jni/android_os_SystemClock.cpp
+++ b/core/jni/android_os_SystemClock.cpp
@@ -112,6 +112,15 @@
}
/*
+ * public static native long elapsedRealtimeNano();
+ */
+static jlong android_os_SystemClock_elapsedRealtimeNano(JNIEnv* env,
+ jobject clazz)
+{
+ return (jlong)elapsedRealtimeNano();
+}
+
+/*
* JNI registration.
*/
static JNINativeMethod gMethods[] = {
@@ -128,6 +137,8 @@
(void*) android_os_SystemClock_currentThreadTimeMicro },
{ "currentTimeMicro", "()J",
(void*) android_os_SystemClock_currentTimeMicro },
+ { "elapsedRealtimeNano", "()J",
+ (void*) android_os_SystemClock_elapsedRealtimeNano },
};
int register_android_os_SystemClock(JNIEnv* env)
{
diff --git a/core/jni/android_view_GLES20Canvas.cpp b/core/jni/android_view_GLES20Canvas.cpp
index 9040941..ade3180 100644
--- a/core/jni/android_view_GLES20Canvas.cpp
+++ b/core/jni/android_view_GLES20Canvas.cpp
@@ -528,8 +528,11 @@
}
const jchar* glyphs = value->getGlyphs();
size_t glyphsCount = value->getGlyphsCount();
+ jfloat totalAdvance = value->getTotalAdvance();
+ const float* positions = value->getPos();
int bytesCount = glyphsCount * sizeof(jchar);
- renderer->drawText((const char*) glyphs, bytesCount, glyphsCount, x, y, paint);
+ renderer->drawGeneralText((const char*) glyphs, bytesCount, glyphsCount, x, y,
+ positions, paint, totalAdvance);
}
static void renderTextOnPath(OpenGLRenderer* renderer, const jchar* text, int count,
@@ -556,8 +559,11 @@
}
const jchar* glyphs = value->getGlyphs();
size_t glyphsCount = value->getGlyphsCount();
+ jfloat totalAdvance = value->getTotalAdvance();
+ const float* positions = value->getPos();
int bytesCount = glyphsCount * sizeof(jchar);
- renderer->drawText((const char*) glyphs, bytesCount, glyphsCount, x, y, paint);
+ renderer->drawGeneralText((const char*) glyphs, bytesCount, glyphsCount, x, y,
+ positions, paint, totalAdvance);
}
static void android_view_GLES20Canvas_drawTextArray(JNIEnv* env, jobject clazz,
diff --git a/core/jni/com_google_android_gles_jni_GLImpl.cpp b/core/jni/com_google_android_gles_jni_GLImpl.cpp
index 0310dc7..3f9942e 100644
--- a/core/jni/com_google_android_gles_jni_GLImpl.cpp
+++ b/core/jni/com_google_android_gles_jni_GLImpl.cpp
@@ -114,14 +114,12 @@
}
static void *
-getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining)
+getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining, jint *offset)
{
jint position;
jint limit;
jint elementSizeShift;
jlong pointer;
- jint offset;
- void *data;
position = _env->GetIntField(buffer, positionID);
limit = _env->GetIntField(buffer, limitID);
@@ -139,11 +137,10 @@
if (*array == NULL) {
return (void*) NULL;
}
- offset = _env->CallStaticIntMethod(nioAccessClass,
+ *offset = _env->CallStaticIntMethod(nioAccessClass,
getBaseArrayOffsetID, buffer);
- data = _env->GetPrimitiveArrayCritical(*array, (jboolean *) 0);
- return (void *) ((char *) data + offset);
+ return NULL;
}
static void
@@ -181,10 +178,12 @@
if (allowIndirectBuffers(_env)) {
jarray array = 0;
jint remaining;
- buf = getPointer(_env, buffer, &array, &remaining);
+ jint offset;
+ buf = getPointer(_env, buffer, &array, &remaining, &offset);
if (array) {
releasePointer(_env, array, buf, 0);
}
+ buf = buf + offset;
} else {
jniThrowException(_env, "java/lang/IllegalArgumentException",
"Must use a native order direct Buffer");
@@ -418,6 +417,7 @@
android_glColorPointerBounds__IIILjava_nio_Buffer_2I
(JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLvoid *pointer = (GLvoid *) 0;
@@ -441,10 +441,15 @@
android_glCompressedTexImage2D__IIIIIIILjava_nio_Buffer_2
(JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint width, jint height, jint border, jint imageSize, jobject data_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLvoid *data = (GLvoid *) 0;
- data = (GLvoid *)getPointer(_env, data_buf, &_array, &_remaining);
+ data = (GLvoid *)getPointer(_env, data_buf, &_array, &_remaining, &_bufferOffset);
+ if (data == NULL) {
+ char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ data = (GLvoid *) (_dataBase + _bufferOffset);
+ }
glCompressedTexImage2D(
(GLenum)target,
(GLint)level,
@@ -465,10 +470,15 @@
android_glCompressedTexSubImage2D__IIIIIIIILjava_nio_Buffer_2
(JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint width, jint height, jint format, jint imageSize, jobject data_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLvoid *data = (GLvoid *) 0;
- data = (GLvoid *)getPointer(_env, data_buf, &_array, &_remaining);
+ data = (GLvoid *)getPointer(_env, data_buf, &_array, &_remaining, &_bufferOffset);
+ if (data == NULL) {
+ char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ data = (GLvoid *) (_dataBase + _bufferOffset);
+ }
glCompressedTexSubImage2D(
(GLenum)target,
(GLint)level,
@@ -583,16 +593,21 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLuint *textures = (GLuint *) 0;
- textures = (GLuint *)getPointer(_env, textures_buf, &_array, &_remaining);
+ textures = (GLuint *)getPointer(_env, textures_buf, &_array, &_remaining, &_bufferOffset);
if (_remaining < n) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "remaining() < n < needed";
goto exit;
}
+ if (textures == NULL) {
+ char * _texturesBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ textures = (GLuint *) (_texturesBase + _bufferOffset);
+ }
glDeleteTextures(
(GLsizei)n,
(GLuint *)textures
@@ -682,16 +697,21 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLvoid *indices = (GLvoid *) 0;
- indices = (GLvoid *)getPointer(_env, indices_buf, &_array, &_remaining);
+ indices = (GLvoid *)getPointer(_env, indices_buf, &_array, &_remaining, &_bufferOffset);
if (_remaining < count) {
_exception = 1;
_exceptionType = "java/lang/ArrayIndexOutOfBoundsException";
_exceptionMessage = "remaining() < count < needed";
goto exit;
}
+ if (indices == NULL) {
+ char * _indicesBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ indices = (GLvoid *) (_indicesBase + _bufferOffset);
+ }
glDrawElements(
(GLenum)mode,
(GLsizei)count,
@@ -832,10 +852,11 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *params = (GLfloat *) 0;
- params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
int _needed;
switch (pname) {
#if defined(GL_FOG_MODE)
@@ -867,6 +888,10 @@
_exceptionMessage = "remaining() < needed";
goto exit;
}
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLfloat *) (_paramsBase + _bufferOffset);
+ }
glFogfv(
(GLenum)pname,
(GLfloat *)params
@@ -973,10 +998,11 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
- params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
int _needed;
switch (pname) {
#if defined(GL_FOG_MODE)
@@ -1008,6 +1034,10 @@
_exceptionMessage = "remaining() < needed";
goto exit;
}
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLfixed *) (_paramsBase + _bufferOffset);
+ }
glFogxv(
(GLenum)pname,
(GLfixed *)params
@@ -1116,16 +1146,21 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLuint *textures = (GLuint *) 0;
- textures = (GLuint *)getPointer(_env, textures_buf, &_array, &_remaining);
+ textures = (GLuint *)getPointer(_env, textures_buf, &_array, &_remaining, &_bufferOffset);
if (_remaining < n) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "remaining() < n < needed";
goto exit;
}
+ if (textures == NULL) {
+ char * _texturesBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ textures = (GLuint *) (_texturesBase + _bufferOffset);
+ }
glGenTextures(
(GLsizei)n,
(GLuint *)textures
@@ -1537,10 +1572,11 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLint *params = (GLint *) 0;
- params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
int _needed;
switch (pname) {
#if defined(GL_ALPHA_BITS)
@@ -1878,6 +1914,10 @@
_exceptionMessage = "remaining() < needed";
goto exit;
}
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLint *) (_paramsBase + _bufferOffset);
+ }
glGetIntegerv(
(GLenum)pname,
(GLint *)params
@@ -1990,10 +2030,11 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *params = (GLfloat *) 0;
- params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
int _needed;
switch (pname) {
#if defined(GL_LIGHT_MODEL_TWO_SIDE)
@@ -2016,6 +2057,10 @@
_exceptionMessage = "remaining() < needed";
goto exit;
}
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLfloat *) (_paramsBase + _bufferOffset);
+ }
glLightModelfv(
(GLenum)pname,
(GLfloat *)params
@@ -2113,10 +2158,11 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
- params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
int _needed;
switch (pname) {
#if defined(GL_LIGHT_MODEL_TWO_SIDE)
@@ -2139,6 +2185,10 @@
_exceptionMessage = "remaining() < needed";
goto exit;
}
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLfixed *) (_paramsBase + _bufferOffset);
+ }
glLightModelxv(
(GLenum)pname,
(GLfixed *)params
@@ -2264,10 +2314,11 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *params = (GLfloat *) 0;
- params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
int _needed;
switch (pname) {
#if defined(GL_SPOT_EXPONENT)
@@ -2316,6 +2367,10 @@
_exceptionMessage = "remaining() < needed";
goto exit;
}
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLfloat *) (_paramsBase + _bufferOffset);
+ }
glLightfv(
(GLenum)light,
(GLenum)pname,
@@ -2442,10 +2497,11 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
- params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
int _needed;
switch (pname) {
#if defined(GL_SPOT_EXPONENT)
@@ -2494,6 +2550,10 @@
_exceptionMessage = "remaining() < needed";
goto exit;
}
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLfixed *) (_paramsBase + _bufferOffset);
+ }
glLightxv(
(GLenum)light,
(GLenum)pname,
@@ -2581,10 +2641,15 @@
android_glLoadMatrixf__Ljava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jobject m_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *m = (GLfloat *) 0;
- m = (GLfloat *)getPointer(_env, m_buf, &_array, &_remaining);
+ m = (GLfloat *)getPointer(_env, m_buf, &_array, &_remaining, &_bufferOffset);
+ if (m == NULL) {
+ char * _mBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ m = (GLfloat *) (_mBase + _bufferOffset);
+ }
glLoadMatrixf(
(GLfloat *)m
);
@@ -2640,10 +2705,15 @@
android_glLoadMatrixx__Ljava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jobject m_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfixed *m = (GLfixed *) 0;
- m = (GLfixed *)getPointer(_env, m_buf, &_array, &_remaining);
+ m = (GLfixed *)getPointer(_env, m_buf, &_array, &_remaining, &_bufferOffset);
+ if (m == NULL) {
+ char * _mBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ m = (GLfixed *) (_mBase + _bufferOffset);
+ }
glLoadMatrixx(
(GLfixed *)m
);
@@ -2758,10 +2828,11 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *params = (GLfloat *) 0;
- params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
int _needed;
switch (pname) {
#if defined(GL_SHININESS)
@@ -2796,6 +2867,10 @@
_exceptionMessage = "remaining() < needed";
goto exit;
}
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLfloat *) (_paramsBase + _bufferOffset);
+ }
glMaterialfv(
(GLenum)face,
(GLenum)pname,
@@ -2908,10 +2983,11 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
- params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
int _needed;
switch (pname) {
#if defined(GL_SHININESS)
@@ -2946,6 +3022,10 @@
_exceptionMessage = "remaining() < needed";
goto exit;
}
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLfixed *) (_paramsBase + _bufferOffset);
+ }
glMaterialxv(
(GLenum)face,
(GLenum)pname,
@@ -3017,10 +3097,15 @@
android_glMultMatrixf__Ljava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jobject m_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *m = (GLfloat *) 0;
- m = (GLfloat *)getPointer(_env, m_buf, &_array, &_remaining);
+ m = (GLfloat *)getPointer(_env, m_buf, &_array, &_remaining, &_bufferOffset);
+ if (m == NULL) {
+ char * _mBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ m = (GLfloat *) (_mBase + _bufferOffset);
+ }
glMultMatrixf(
(GLfloat *)m
);
@@ -3076,10 +3161,15 @@
android_glMultMatrixx__Ljava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jobject m_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfixed *m = (GLfixed *) 0;
- m = (GLfixed *)getPointer(_env, m_buf, &_array, &_remaining);
+ m = (GLfixed *)getPointer(_env, m_buf, &_array, &_remaining, &_bufferOffset);
+ if (m == NULL) {
+ char * _mBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ m = (GLfixed *) (_mBase + _bufferOffset);
+ }
glMultMatrixx(
(GLfixed *)m
);
@@ -3141,6 +3231,7 @@
android_glNormalPointerBounds__IILjava_nio_Buffer_2I
(JNIEnv *_env, jobject _this, jint type, jint stride, jobject pointer_buf, jint remaining) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLvoid *pointer = (GLvoid *) 0;
@@ -3253,10 +3344,15 @@
android_glReadPixels__IIIIIILjava_nio_Buffer_2
(JNIEnv *_env, jobject _this, jint x, jint y, jint width, jint height, jint format, jint type, jobject pixels_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLvoid *pixels = (GLvoid *) 0;
- pixels = (GLvoid *)getPointer(_env, pixels_buf, &_array, &_remaining);
+ pixels = (GLvoid *)getPointer(_env, pixels_buf, &_array, &_remaining, &_bufferOffset);
+ if (pixels == NULL) {
+ char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ pixels = (GLvoid *) (_pixelsBase + _bufferOffset);
+ }
glReadPixels(
(GLint)x,
(GLint)y,
@@ -3394,6 +3490,7 @@
android_glTexCoordPointerBounds__IIILjava_nio_Buffer_2I
(JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLvoid *pointer = (GLvoid *) 0;
@@ -3503,10 +3600,11 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *params = (GLfloat *) 0;
- params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
int _needed;
switch (pname) {
#if defined(GL_TEXTURE_ENV_MODE)
@@ -3535,6 +3633,10 @@
_exceptionMessage = "remaining() < needed";
goto exit;
}
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLfloat *) (_paramsBase + _bufferOffset);
+ }
glTexEnvfv(
(GLenum)target,
(GLenum)pname,
@@ -3641,10 +3743,11 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
- params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
int _needed;
switch (pname) {
#if defined(GL_TEXTURE_ENV_MODE)
@@ -3673,6 +3776,10 @@
_exceptionMessage = "remaining() < needed";
goto exit;
}
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLfixed *) (_paramsBase + _bufferOffset);
+ }
glTexEnvxv(
(GLenum)target,
(GLenum)pname,
@@ -3693,11 +3800,16 @@
android_glTexImage2D__IIIIIIIILjava_nio_Buffer_2
(JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint width, jint height, jint border, jint format, jint type, jobject pixels_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLvoid *pixels = (GLvoid *) 0;
if (pixels_buf) {
- pixels = (GLvoid *)getPointer(_env, pixels_buf, &_array, &_remaining);
+ pixels = (GLvoid *)getPointer(_env, pixels_buf, &_array, &_remaining, &_bufferOffset);
+ }
+ if (pixels_buf && pixels == NULL) {
+ char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ pixels = (GLvoid *) (_pixelsBase + _bufferOffset);
}
glTexImage2D(
(GLenum)target,
@@ -3742,11 +3854,16 @@
android_glTexSubImage2D__IIIIIIIILjava_nio_Buffer_2
(JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint width, jint height, jint format, jint type, jobject pixels_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLvoid *pixels = (GLvoid *) 0;
if (pixels_buf) {
- pixels = (GLvoid *)getPointer(_env, pixels_buf, &_array, &_remaining);
+ pixels = (GLvoid *)getPointer(_env, pixels_buf, &_array, &_remaining, &_bufferOffset);
+ }
+ if (pixels_buf && pixels == NULL) {
+ char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ pixels = (GLvoid *) (_pixelsBase + _bufferOffset);
}
glTexSubImage2D(
(GLenum)target,
@@ -3791,6 +3908,7 @@
android_glVertexPointerBounds__IIILjava_nio_Buffer_2I
(JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLvoid *pointer = (GLvoid *) 0;
@@ -3910,38 +4028,48 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _mantissaArray = (jarray) 0;
+ jint _mantissaBufferOffset = (jint) 0;
jarray _exponentArray = (jarray) 0;
+ jint _exponentBufferOffset = (jint) 0;
GLbitfield _returnValue = -1;
jint _mantissaRemaining;
GLfixed *mantissa = (GLfixed *) 0;
jint _exponentRemaining;
GLint *exponent = (GLint *) 0;
- mantissa = (GLfixed *)getPointer(_env, mantissa_buf, &_mantissaArray, &_mantissaRemaining);
+ mantissa = (GLfixed *)getPointer(_env, mantissa_buf, &_mantissaArray, &_mantissaRemaining, &_mantissaBufferOffset);
if (_mantissaRemaining < 16) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "remaining() < 16 < needed";
goto exit;
}
- exponent = (GLint *)getPointer(_env, exponent_buf, &_exponentArray, &_exponentRemaining);
+ exponent = (GLint *)getPointer(_env, exponent_buf, &_exponentArray, &_exponentRemaining, &_exponentBufferOffset);
if (_exponentRemaining < 16) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "remaining() < 16 < needed";
goto exit;
}
+ if (mantissa == NULL) {
+ char * _mantissaBase = (char *)_env->GetPrimitiveArrayCritical(_mantissaArray, (jboolean *) 0);
+ mantissa = (GLfixed *) (_mantissaBase + _mantissaBufferOffset);
+ }
+ if (exponent == NULL) {
+ char * _exponentBase = (char *)_env->GetPrimitiveArrayCritical(_exponentArray, (jboolean *) 0);
+ exponent = (GLint *) (_exponentBase + _exponentBufferOffset);
+ }
_returnValue = glQueryMatrixxOES(
(GLfixed *)mantissa,
(GLint *)exponent
);
exit:
- if (_mantissaArray) {
- releasePointer(_env, _mantissaArray, exponent, _exception ? JNI_FALSE : JNI_TRUE);
- }
if (_exponentArray) {
- releasePointer(_env, _exponentArray, mantissa, _exception ? JNI_FALSE : JNI_TRUE);
+ releasePointer(_env, _exponentArray, exponent, _exception ? JNI_FALSE : JNI_TRUE);
+ }
+ if (_mantissaArray) {
+ releasePointer(_env, _mantissaArray, mantissa, _exception ? JNI_FALSE : JNI_TRUE);
}
if (_exception) {
jniThrowException(_env, _exceptionType, _exceptionMessage);
@@ -3967,11 +4095,12 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLvoid *data = (GLvoid *) 0;
if (data_buf) {
- data = (GLvoid *)getPointer(_env, data_buf, &_array, &_remaining);
+ data = (GLvoid *)getPointer(_env, data_buf, &_array, &_remaining, &_bufferOffset);
if (_remaining < size) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
@@ -3979,6 +4108,10 @@
goto exit;
}
}
+ if (data_buf && data == NULL) {
+ char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ data = (GLvoid *) (_dataBase + _bufferOffset);
+ }
glBufferData(
(GLenum)target,
(GLsizeiptr)size,
@@ -4003,16 +4136,21 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLvoid *data = (GLvoid *) 0;
- data = (GLvoid *)getPointer(_env, data_buf, &_array, &_remaining);
+ data = (GLvoid *)getPointer(_env, data_buf, &_array, &_remaining, &_bufferOffset);
if (_remaining < size) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "remaining() < size < needed";
goto exit;
}
+ if (data == NULL) {
+ char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ data = (GLvoid *) (_dataBase + _bufferOffset);
+ }
glBufferSubData(
(GLenum)target,
(GLintptr)offset,
@@ -4086,16 +4224,21 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *equation = (GLfloat *) 0;
- equation = (GLfloat *)getPointer(_env, equation_buf, &_array, &_remaining);
+ equation = (GLfloat *)getPointer(_env, equation_buf, &_array, &_remaining, &_bufferOffset);
if (_remaining < 4) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "remaining() < 4 < needed";
goto exit;
}
+ if (equation == NULL) {
+ char * _equationBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ equation = (GLfloat *) (_equationBase + _bufferOffset);
+ }
glClipPlanef(
(GLenum)plane,
(GLfloat *)equation
@@ -4167,16 +4310,21 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfixed *equation = (GLfixed *) 0;
- equation = (GLfixed *)getPointer(_env, equation_buf, &_array, &_remaining);
+ equation = (GLfixed *)getPointer(_env, equation_buf, &_array, &_remaining, &_bufferOffset);
if (_remaining < 4) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "remaining() < 4 < needed";
goto exit;
}
+ if (equation == NULL) {
+ char * _equationBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ equation = (GLfixed *) (_equationBase + _bufferOffset);
+ }
glClipPlanex(
(GLenum)plane,
(GLfixed *)equation
@@ -4272,16 +4420,21 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLuint *buffers = (GLuint *) 0;
- buffers = (GLuint *)getPointer(_env, buffers_buf, &_array, &_remaining);
+ buffers = (GLuint *)getPointer(_env, buffers_buf, &_array, &_remaining, &_bufferOffset);
if (_remaining < n) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "remaining() < n < needed";
goto exit;
}
+ if (buffers == NULL) {
+ char * _buffersBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ buffers = (GLuint *) (_buffersBase + _bufferOffset);
+ }
glDeleteBuffers(
(GLsizei)n,
(GLuint *)buffers
@@ -4371,16 +4524,21 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLuint *buffers = (GLuint *) 0;
- buffers = (GLuint *)getPointer(_env, buffers_buf, &_array, &_remaining);
+ buffers = (GLuint *)getPointer(_env, buffers_buf, &_array, &_remaining, &_bufferOffset);
if (_remaining < n) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "remaining() < n < needed";
goto exit;
}
+ if (buffers == NULL) {
+ char * _buffersBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ buffers = (GLuint *) (_buffersBase + _bufferOffset);
+ }
glGenBuffers(
(GLsizei)n,
(GLuint *)buffers
@@ -4443,10 +4601,15 @@
android_glGetBooleanv__ILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLboolean *params = (GLboolean *) 0;
- params = (GLboolean *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLboolean *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLboolean *) (_paramsBase + _bufferOffset);
+ }
glGetBooleanv(
(GLenum)pname,
(GLboolean *)params
@@ -4520,10 +4683,15 @@
android_glGetClipPlanef__ILjava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jint pname, jobject eqn_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *eqn = (GLfloat *) 0;
- eqn = (GLfloat *)getPointer(_env, eqn_buf, &_array, &_remaining);
+ eqn = (GLfloat *)getPointer(_env, eqn_buf, &_array, &_remaining, &_bufferOffset);
+ if (eqn == NULL) {
+ char * _eqnBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ eqn = (GLfloat *) (_eqnBase + _bufferOffset);
+ }
glGetClipPlanef(
(GLenum)pname,
(GLfloat *)eqn
@@ -4581,10 +4749,15 @@
android_glGetClipPlanex__ILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint pname, jobject eqn_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfixed *eqn = (GLfixed *) 0;
- eqn = (GLfixed *)getPointer(_env, eqn_buf, &_array, &_remaining);
+ eqn = (GLfixed *)getPointer(_env, eqn_buf, &_array, &_remaining, &_bufferOffset);
+ if (eqn == NULL) {
+ char * _eqnBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ eqn = (GLfixed *) (_eqnBase + _bufferOffset);
+ }
glGetClipPlanex(
(GLenum)pname,
(GLfixed *)eqn
@@ -4642,10 +4815,15 @@
android_glGetFixedv__ILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
- params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLfixed *) (_paramsBase + _bufferOffset);
+ }
glGetFixedv(
(GLenum)pname,
(GLfixed *)params
@@ -4703,10 +4881,15 @@
android_glGetFloatv__ILjava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *params = (GLfloat *) 0;
- params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLfloat *) (_paramsBase + _bufferOffset);
+ }
glGetFloatv(
(GLenum)pname,
(GLfloat *)params
@@ -4816,10 +4999,11 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *params = (GLfloat *) 0;
- params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
int _needed;
switch (pname) {
#if defined(GL_SPOT_EXPONENT)
@@ -4868,6 +5052,10 @@
_exceptionMessage = "remaining() < needed";
goto exit;
}
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLfloat *) (_paramsBase + _bufferOffset);
+ }
glGetLightfv(
(GLenum)light,
(GLenum)pname,
@@ -4983,10 +5171,11 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
- params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
int _needed;
switch (pname) {
#if defined(GL_SPOT_EXPONENT)
@@ -5035,6 +5224,10 @@
_exceptionMessage = "remaining() < needed";
goto exit;
}
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLfixed *) (_paramsBase + _bufferOffset);
+ }
glGetLightxv(
(GLenum)light,
(GLenum)pname,
@@ -5136,10 +5329,11 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *params = (GLfloat *) 0;
- params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
int _needed;
switch (pname) {
#if defined(GL_SHININESS)
@@ -5174,6 +5368,10 @@
_exceptionMessage = "remaining() < needed";
goto exit;
}
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLfloat *) (_paramsBase + _bufferOffset);
+ }
glGetMaterialfv(
(GLenum)face,
(GLenum)pname,
@@ -5275,10 +5473,11 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
- params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
int _needed;
switch (pname) {
#if defined(GL_SHININESS)
@@ -5313,6 +5512,10 @@
_exceptionMessage = "remaining() < needed";
goto exit;
}
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLfixed *) (_paramsBase + _bufferOffset);
+ }
glGetMaterialxv(
(GLenum)face,
(GLenum)pname,
@@ -5408,10 +5611,11 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLint *params = (GLint *) 0;
- params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
int _needed;
switch (pname) {
#if defined(GL_TEXTURE_ENV_MODE)
@@ -5440,6 +5644,10 @@
_exceptionMessage = "remaining() < needed";
goto exit;
}
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLint *) (_paramsBase + _bufferOffset);
+ }
glGetTexEnviv(
(GLenum)env,
(GLenum)pname,
@@ -5535,10 +5743,11 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
- params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
int _needed;
switch (pname) {
#if defined(GL_TEXTURE_ENV_MODE)
@@ -5567,6 +5776,10 @@
_exceptionMessage = "remaining() < needed";
goto exit;
}
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLfixed *) (_paramsBase + _bufferOffset);
+ }
glGetTexEnvxv(
(GLenum)env,
(GLenum)pname,
@@ -5640,16 +5853,21 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *params = (GLfloat *) 0;
- params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
if (_remaining < 1) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "remaining() < 1 < needed";
goto exit;
}
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLfloat *) (_paramsBase + _bufferOffset);
+ }
glGetTexParameterfv(
(GLenum)target,
(GLenum)pname,
@@ -5723,16 +5941,21 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLint *params = (GLint *) 0;
- params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
if (_remaining < 1) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "remaining() < 1 < needed";
goto exit;
}
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLint *) (_paramsBase + _bufferOffset);
+ }
glGetTexParameteriv(
(GLenum)target,
(GLenum)pname,
@@ -5806,16 +6029,21 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
- params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
if (_remaining < 1) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "remaining() < 1 < needed";
goto exit;
}
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLfixed *) (_paramsBase + _bufferOffset);
+ }
glGetTexParameterxv(
(GLenum)target,
(GLenum)pname,
@@ -5942,16 +6170,21 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *params = (GLfloat *) 0;
- params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
if (_remaining < 1) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "remaining() < 1 < needed";
goto exit;
}
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLfloat *) (_paramsBase + _bufferOffset);
+ }
glPointParameterfv(
(GLenum)pname,
(GLfloat *)params
@@ -6033,16 +6266,21 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
- params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
if (_remaining < 1) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "remaining() < 1 < needed";
goto exit;
}
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLfixed *) (_paramsBase + _bufferOffset);
+ }
glPointParameterxv(
(GLenum)pname,
(GLfixed *)params
@@ -6062,6 +6300,7 @@
android_glPointSizePointerOESBounds__IILjava_nio_Buffer_2I
(JNIEnv *_env, jobject _this, jint type, jint stride, jobject pointer_buf, jint remaining) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLvoid *pointer = (GLvoid *) 0;
@@ -6182,10 +6421,11 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLint *params = (GLint *) 0;
- params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
int _needed;
switch (pname) {
#if defined(GL_TEXTURE_ENV_MODE)
@@ -6214,6 +6454,10 @@
_exceptionMessage = "remaining() < needed";
goto exit;
}
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLint *) (_paramsBase + _bufferOffset);
+ }
glTexEnviv(
(GLenum)target,
(GLenum)pname,
@@ -6287,16 +6531,21 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *params = (GLfloat *) 0;
- params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
if (_remaining < 1) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "remaining() < 1 < needed";
goto exit;
}
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLfloat *) (_paramsBase + _bufferOffset);
+ }
glTexParameterfv(
(GLenum)target,
(GLenum)pname,
@@ -6381,16 +6630,21 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLint *params = (GLint *) 0;
- params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
if (_remaining < 1) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "remaining() < 1 < needed";
goto exit;
}
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLint *) (_paramsBase + _bufferOffset);
+ }
glTexParameteriv(
(GLenum)target,
(GLenum)pname,
@@ -6464,16 +6718,21 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
- params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
if (_remaining < 1) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "remaining() < 1 < needed";
goto exit;
}
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLfixed *) (_paramsBase + _bufferOffset);
+ }
glTexParameterxv(
(GLenum)target,
(GLenum)pname,
@@ -6579,16 +6838,21 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *coords = (GLfloat *) 0;
- coords = (GLfloat *)getPointer(_env, coords_buf, &_array, &_remaining);
+ coords = (GLfloat *)getPointer(_env, coords_buf, &_array, &_remaining, &_bufferOffset);
if (_remaining < 5) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "remaining() < 5 < needed";
goto exit;
}
+ if (coords == NULL) {
+ char * _coordsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ coords = (GLfloat *) (_coordsBase + _bufferOffset);
+ }
glDrawTexfvOES(
(GLfloat *)coords
);
@@ -6671,16 +6935,21 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLint *coords = (GLint *) 0;
- coords = (GLint *)getPointer(_env, coords_buf, &_array, &_remaining);
+ coords = (GLint *)getPointer(_env, coords_buf, &_array, &_remaining, &_bufferOffset);
if (_remaining < 5) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "remaining() < 5 < needed";
goto exit;
}
+ if (coords == NULL) {
+ char * _coordsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ coords = (GLint *) (_coordsBase + _bufferOffset);
+ }
glDrawTexivOES(
(GLint *)coords
);
@@ -6763,16 +7032,21 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLshort *coords = (GLshort *) 0;
- coords = (GLshort *)getPointer(_env, coords_buf, &_array, &_remaining);
+ coords = (GLshort *)getPointer(_env, coords_buf, &_array, &_remaining, &_bufferOffset);
if (_remaining < 5) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "remaining() < 5 < needed";
goto exit;
}
+ if (coords == NULL) {
+ char * _coordsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ coords = (GLshort *) (_coordsBase + _bufferOffset);
+ }
glDrawTexsvOES(
(GLshort *)coords
);
@@ -6855,16 +7129,21 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfixed *coords = (GLfixed *) 0;
- coords = (GLfixed *)getPointer(_env, coords_buf, &_array, &_remaining);
+ coords = (GLfixed *)getPointer(_env, coords_buf, &_array, &_remaining, &_bufferOffset);
if (_remaining < 5) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "remaining() < 5 < needed";
goto exit;
}
+ if (coords == NULL) {
+ char * _coordsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ coords = (GLfixed *) (_coordsBase + _bufferOffset);
+ }
glDrawTexxvOES(
(GLfixed *)coords
);
@@ -6890,6 +7169,7 @@
android_glMatrixIndexPointerOESBounds__IIILjava_nio_Buffer_2I
(JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLvoid *pointer = (GLvoid *) 0;
@@ -6925,6 +7205,7 @@
android_glWeightPointerOESBounds__IIILjava_nio_Buffer_2I
(JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) {
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLvoid *pointer = (GLvoid *) 0;
@@ -7114,16 +7395,21 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLuint *framebuffers = (GLuint *) 0;
- framebuffers = (GLuint *)getPointer(_env, framebuffers_buf, &_array, &_remaining);
+ framebuffers = (GLuint *)getPointer(_env, framebuffers_buf, &_array, &_remaining, &_bufferOffset);
if (_remaining < n) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "remaining() < n < needed";
goto exit;
}
+ if (framebuffers == NULL) {
+ char * _framebuffersBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ framebuffers = (GLuint *) (_framebuffersBase + _bufferOffset);
+ }
glDeleteFramebuffersOES(
(GLint)n,
(GLuint *)framebuffers
@@ -7205,16 +7491,21 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLuint *renderbuffers = (GLuint *) 0;
- renderbuffers = (GLuint *)getPointer(_env, renderbuffers_buf, &_array, &_remaining);
+ renderbuffers = (GLuint *)getPointer(_env, renderbuffers_buf, &_array, &_remaining, &_bufferOffset);
if (_remaining < n) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "remaining() < n < needed";
goto exit;
}
+ if (renderbuffers == NULL) {
+ char * _renderbuffersBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ renderbuffers = (GLuint *) (_renderbuffersBase + _bufferOffset);
+ }
glDeleteRenderbuffersOES(
(GLint)n,
(GLuint *)renderbuffers
@@ -7345,16 +7636,21 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLuint *framebuffers = (GLuint *) 0;
- framebuffers = (GLuint *)getPointer(_env, framebuffers_buf, &_array, &_remaining);
+ framebuffers = (GLuint *)getPointer(_env, framebuffers_buf, &_array, &_remaining, &_bufferOffset);
if (_remaining < n) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "remaining() < n < needed";
goto exit;
}
+ if (framebuffers == NULL) {
+ char * _framebuffersBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ framebuffers = (GLuint *) (_framebuffersBase + _bufferOffset);
+ }
glGenFramebuffersOES(
(GLint)n,
(GLuint *)framebuffers
@@ -7436,16 +7732,21 @@
const char * _exceptionType;
const char * _exceptionMessage;
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLuint *renderbuffers = (GLuint *) 0;
- renderbuffers = (GLuint *)getPointer(_env, renderbuffers_buf, &_array, &_remaining);
+ renderbuffers = (GLuint *)getPointer(_env, renderbuffers_buf, &_array, &_remaining, &_bufferOffset);
if (_remaining < n) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "remaining() < n < needed";
goto exit;
}
+ if (renderbuffers == NULL) {
+ char * _renderbuffersBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ renderbuffers = (GLuint *) (_renderbuffersBase + _bufferOffset);
+ }
glGenRenderbuffersOES(
(GLint)n,
(GLuint *)renderbuffers
@@ -7520,10 +7821,15 @@
return;
}
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLint *params = (GLint *) 0;
- params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLint *) (_paramsBase + _bufferOffset);
+ }
glGetFramebufferAttachmentParameterivOES(
(GLint)target,
(GLint)attachment,
@@ -7594,10 +7900,15 @@
return;
}
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLint *params = (GLint *) 0;
- params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLint *) (_paramsBase + _bufferOffset);
+ }
glGetRenderbufferParameterivOES(
(GLint)target,
(GLint)pname,
@@ -7667,10 +7978,15 @@
return;
}
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *params = (GLfloat *) 0;
- params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLfloat *) (_paramsBase + _bufferOffset);
+ }
glGetTexGenfv(
(GLint)coord,
(GLint)pname,
@@ -7740,10 +8056,15 @@
return;
}
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLint *params = (GLint *) 0;
- params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLint *) (_paramsBase + _bufferOffset);
+ }
glGetTexGeniv(
(GLint)coord,
(GLint)pname,
@@ -7813,10 +8134,15 @@
return;
}
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLint *params = (GLint *) 0;
- params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLint *) (_paramsBase + _bufferOffset);
+ }
glGetTexGenxv(
(GLint)coord,
(GLint)pname,
@@ -7951,10 +8277,15 @@
return;
}
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *params = (GLfloat *) 0;
- params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLfloat *) (_paramsBase + _bufferOffset);
+ }
glTexGenfv(
(GLint)coord,
(GLint)pname,
@@ -8040,10 +8371,15 @@
return;
}
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLint *params = (GLint *) 0;
- params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLint *) (_paramsBase + _bufferOffset);
+ }
glTexGeniv(
(GLint)coord,
(GLint)pname,
@@ -8129,10 +8465,15 @@
return;
}
jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
jint _remaining;
GLint *params = (GLint *) 0;
- params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining);
+ params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (GLint *) (_paramsBase + _bufferOffset);
+ }
glTexGenxv(
(GLint)coord,
(GLint)pname,
diff --git a/core/res/res/values-ar/strings.xml b/core/res/res/values-ar/strings.xml
index ee3b437..cae9a5b 100644
--- a/core/res/res/values-ar/strings.xml
+++ b/core/res/res/values-ar/strings.xml
@@ -246,7 +246,7 @@
<string name="permlab_retrieve_window_info" msgid="8532295199112519378">"استرداد معلومات النوافذ"</string>
<string name="permdesc_retrieve_window_info" msgid="4998836370424186849">"للسماح لأحد التطبيقات باستعادة معلومات حول النوافذ من مدير النوافذ. يمكن أن تستعيد التطبيقات الضارة معلومات الغرض منها استخدام النظام الداخلي."</string>
<string name="permlab_filter_events" msgid="8675535648807427389">"تصفية الأحداث"</string>
- <string name="permdesc_filter_events" msgid="8006236315888347680">"للسماح لأحد التطبيقات بتسجيل فلتر إدخال يعمل على تصفية مجموعة البث من جميع أحداث المستخدمين قبل إرسالها. يمكن أن يتحكم برنامج ضار في واجهة المستخدم النظام بدون تدخل المستخدم."</string>
+ <string name="permdesc_filter_events" msgid="8006236315888347680">"للسماح لأحد التطبيقات بتسجيل فلتر إدخال يعمل على تصفية مجموعة البث من جميع أحداث المستخدمين قبل إرسالها. يمكن أن يتحكم برنامج ضار في واجهة المستخدم النظام دون تدخل المستخدم."</string>
<string name="permlab_shutdown" msgid="7185747824038909016">"إيقاف تشغيل جزئي"</string>
<string name="permdesc_shutdown" msgid="7046500838746291775">"لوضع مدير الأنشطة في حالة إيقاف التشغيل. لا يتم تنفيذ إيقاف تشغيل كامل."</string>
<string name="permlab_stopAppSwitches" msgid="4138608610717425573">"منع التبديل بين التطبيقات"</string>
diff --git a/core/res/res/values-ca/strings.xml b/core/res/res/values-ca/strings.xml
index b8a5e84..95f8944 100644
--- a/core/res/res/values-ca/strings.xml
+++ b/core/res/res/values-ca/strings.xml
@@ -246,7 +246,7 @@
<string name="permlab_retrieve_window_info" msgid="8532295199112519378">"recupera informació de les finestres"</string>
<string name="permdesc_retrieve_window_info" msgid="4998836370424186849">"Permet que una aplicació recuperi informació sobre les finestres del gestor de finestres. Aplicacions malicioses podrien recuperar informació dirigida a la utilització per part del sistema intern."</string>
<string name="permlab_filter_events" msgid="8675535648807427389">"filtra els esdeveniments"</string>
- <string name="permdesc_filter_events" msgid="8006236315888347680">"Permet que una aplicació registre un filtre d\'entrada per a l\'emissió de tots els esdeveniments d\'usuari abans no s\'enviïn. Aplicacions malicioses podrien controlar la IU del sistema sense la intervenció de l\'usuari."</string>
+ <string name="permdesc_filter_events" msgid="8006236315888347680">"Permet que una aplicació registri un filtre d\'entrada per a l\'emissió de tots els esdeveniments d\'usuari abans no s\'enviïn. Aplicacions malicioses podrien controlar la IU del sistema sense la intervenció de l\'usuari."</string>
<string name="permlab_shutdown" msgid="7185747824038909016">"apagar parcialment"</string>
<string name="permdesc_shutdown" msgid="7046500838746291775">"Posa el gestor d\'activitats en estat d\'apagada. No fa una apagada completa."</string>
<string name="permlab_stopAppSwitches" msgid="4138608610717425573">"impedir els canvis d\'aplicació"</string>
diff --git a/core/res/res/values-en-rGB/strings.xml b/core/res/res/values-en-rGB/strings.xml
index 6763ed7..e6e85ed 100644
--- a/core/res/res/values-en-rGB/strings.xml
+++ b/core/res/res/values-en-rGB/strings.xml
@@ -1294,7 +1294,7 @@
<string name="activity_resolver_use_always" msgid="8017770747801494933">"Always"</string>
<string name="activity_resolver_use_once" msgid="2404644797149173758">"Just once"</string>
<string name="default_audio_route_name" product="tablet" msgid="4617053898167127471">"Tablet"</string>
- <string name="default_audio_route_name" product="default" msgid="4239291273420140123">"Phones"</string>
+ <string name="default_audio_route_name" product="default" msgid="4239291273420140123">"Phone"</string>
<string name="default_audio_route_name_headphones" msgid="8119971843803439110">"Headphones"</string>
<string name="default_audio_route_name_dock_speakers" msgid="6240602982276591864">"Dock speakers"</string>
<string name="default_audio_route_name_hdmi" msgid="7986404173839007682">"HDMI audio"</string>
diff --git a/core/res/res/values-fa/strings.xml b/core/res/res/values-fa/strings.xml
index 941d5c3..fa98e56 100644
--- a/core/res/res/values-fa/strings.xml
+++ b/core/res/res/values-fa/strings.xml
@@ -44,7 +44,7 @@
<string name="passwordIncorrect" msgid="7612208839450128715">"رمز ورود اشتباه است."</string>
<string name="mmiComplete" msgid="8232527495411698359">"MMI کامل شد."</string>
<string name="badPin" msgid="9015277645546710014">"پین قدیمی که نوشتهاید صحیح نیست."</string>
- <string name="badPuk" msgid="5487257647081132201">"PUK که نوشته اید صحیح نیست."</string>
+ <string name="badPuk" msgid="5487257647081132201">"PUK که نوشتهاید صحیح نیست."</string>
<string name="mismatchPin" msgid="609379054496863419">"پینهایی که وارد کردهاید با یکدیگر مطابقت ندارند."</string>
<string name="invalidPin" msgid="3850018445187475377">"یک پین بنویسید که 4 تا 8 رقم باشد."</string>
<string name="invalidPuk" msgid="8761456210898036513">"یک PUK با 8 رقم یا بیشتر تایپ کنید."</string>
@@ -129,10 +129,10 @@
<string name="contentServiceSync" msgid="8353523060269335667">"همگام سازی"</string>
<string name="contentServiceSyncNotificationTitle" msgid="397743349191901458">"همگام سازی"</string>
<string name="contentServiceTooManyDeletesNotificationDesc" msgid="8100981435080696431">"تعداد موارد حذف شده <xliff:g id="CONTENT_TYPE">%s</xliff:g> بسیار زیاد است."</string>
- <string name="low_memory" product="tablet" msgid="6494019234102154896">"حافظه رایانه لوحی پر است! برخی از فایلها را حذف کنید تا فضا آزاد شود."</string>
+ <string name="low_memory" product="tablet" msgid="6494019234102154896">"حافظه رایانهٔ لوحی پر است! برخی از فایلها را حذف کنید تا فضا آزاد شود."</string>
<string name="low_memory" product="default" msgid="3475999286680000541">"حافظه تلفن پر است. بعضی از فایلها را حذف کنید تا فضا آزاد شود."</string>
<string name="me" msgid="6545696007631404292">"من"</string>
- <string name="power_dialog" product="tablet" msgid="8545351420865202853">"گزینههای رایانه لوحی"</string>
+ <string name="power_dialog" product="tablet" msgid="8545351420865202853">"گزینههای رایانهٔ لوحی"</string>
<string name="power_dialog" product="default" msgid="1319919075463988638">"گزینههای تلفن"</string>
<string name="silent_mode" msgid="7167703389802618663">"حالت ساکت"</string>
<string name="turn_on_radio" msgid="3912793092339962371">"روشن کردن بی سیم"</string>
@@ -143,14 +143,14 @@
<string name="silent_mode_vibrate" msgid="7072043388581551395">"زنگ لرزشی"</string>
<string name="silent_mode_ring" msgid="8592241816194074353">"زنگ روشن"</string>
<string name="shutdown_progress" msgid="2281079257329981203">"خاموش کردن..."</string>
- <string name="shutdown_confirm" product="tablet" msgid="3385745179555731470">"رایانه لوحی شما خاموش میشود."</string>
+ <string name="shutdown_confirm" product="tablet" msgid="3385745179555731470">"رایانهٔ لوحی شما خاموش میشود."</string>
<string name="shutdown_confirm" product="default" msgid="649792175242821353">"گوشی شما خاموش میشود."</string>
<string name="shutdown_confirm_question" msgid="2906544768881136183">"آیا میخواهید تلفن خاموش شود؟"</string>
<string name="reboot_safemode_title" msgid="7054509914500140361">"راهاندازی مجدد در حالت امن"</string>
- <string name="reboot_safemode_confirm" msgid="55293944502784668">"آیا میخواهید با حالت امن راهاندازی مجدد کنید؟ با این کار کلیه برنامههای شخص ثالثی که نصب کردهاید غیرفعال میشوند. با راهاندازی دوباره سیستم این برنامهها دوباره بازیابی میشوند."</string>
+ <string name="reboot_safemode_confirm" msgid="55293944502784668">"آیا میخواهید با حالت امن راهاندازی مجدد کنید؟ با این کار همهٔ برنامههای شخص ثالثی که نصب کردهاید غیرفعال میشوند. با راهاندازی دوباره سیستم این برنامهها دوباره بازیابی میشوند."</string>
<string name="recent_tasks_title" msgid="3691764623638127888">"اخیر"</string>
<string name="no_recent_tasks" msgid="8794906658732193473">"برنامههای جدید موجود نیست."</string>
- <string name="global_actions" product="tablet" msgid="408477140088053665">"گزینههای رایانه لوحی"</string>
+ <string name="global_actions" product="tablet" msgid="408477140088053665">"گزینههای رایانهٔ لوحی"</string>
<string name="global_actions" product="default" msgid="2406416831541615258">"گزینههای تلفن"</string>
<string name="global_action_lock" msgid="2844945191792119712">"قفل صفحه"</string>
<string name="global_action_power_off" msgid="4471879440839879722">"خاموش کردن"</string>
@@ -168,7 +168,7 @@
<string name="permgrouplab_messages" msgid="7521249148445456662">"پیامهای شما"</string>
<string name="permgroupdesc_messages" msgid="7821999071003699236">"پیام کوتاه، ایمیل و دیگر پیامها را بخوانید."</string>
<string name="permgrouplab_personalInfo" msgid="3519163141070533474">"اطلاعات شخصی شما"</string>
- <string name="permgroupdesc_personalInfo" product="tablet" msgid="6975389054186265786">"دسترسی مستقیم به مخاطبین و تقویم ذخیره شده در رایانه لوحی."</string>
+ <string name="permgroupdesc_personalInfo" product="tablet" msgid="6975389054186265786">"دسترسی مستقیم به مخاطبین و تقویم ذخیره شده در رایانهٔ لوحی."</string>
<string name="permgroupdesc_personalInfo" product="default" msgid="5488050357388806068">"دسترسی مستقیم به مخاطبین و تقویم ذخیره شده در گوشی."</string>
<string name="permgrouplab_location" msgid="635149742436692049">"موقعیت مکانی شما"</string>
<string name="permgroupdesc_location" msgid="5704679763124170100">"بر موقعیت مکانی فیزیکی خود نظارت داشته باشید."</string>
@@ -176,8 +176,8 @@
<string name="permgroupdesc_network" msgid="4478299413241861987">"به ویژگیهای مختلف شبکه دسترسی داشته باشید."</string>
<string name="permgrouplab_accounts" msgid="3359646291125325519">"حسابهای شما"</string>
<string name="permgroupdesc_accounts" msgid="4948732641827091312">"به حسابهای موجود دسترسی داشته باشید."</string>
- <string name="permgrouplab_hardwareControls" msgid="7998214968791599326">"کنترلهای سخت افزار"</string>
- <string name="permgroupdesc_hardwareControls" msgid="4357057861225462702">"دسترسی مستقیم به سخت افزار در گوشی."</string>
+ <string name="permgrouplab_hardwareControls" msgid="7998214968791599326">"کنترلهای سختافزار"</string>
+ <string name="permgroupdesc_hardwareControls" msgid="4357057861225462702">"دسترسی مستقیم به سختافزار در گوشی."</string>
<string name="permgrouplab_phoneCalls" msgid="9067173988325865923">"تماسهای تلفنی"</string>
<string name="permgroupdesc_phoneCalls" msgid="7489701620446183770">"نظارت، ضبط و پردازش تماسهای تلفنی."</string>
<string name="permgrouplab_systemTools" msgid="4652191644082714048">"ابزارهای سیستم"</string>
@@ -208,10 +208,10 @@
<string name="permlab_sendSmsNoConfirmation" msgid="4781483105951730228">"ارسال پیامک بدون تأیید"</string>
<string name="permdesc_sendSmsNoConfirmation" msgid="402569800862935907">"به برنامه اجازه میدهد پیامکها را ارسال کند. این باعث ایجاد هزینههای پیشبینی نشده میشود. برنامههای مخرب ممکن است با ارسال پیام بدون تأیید شما هزینههایی را برای شما ایجاد کنند."</string>
<string name="permlab_readSms" msgid="8745086572213270480">"خواندن پیامهای نوشتاری شما (پیامک یا MMS)"</string>
- <string name="permdesc_readSms" product="tablet" msgid="2467981548684735522">"به برنامه اجازه میدهد پیامکهای ذخیره شده در رایانه لوحی یا سیم کارت شما را بخواند. این ویژگی به برنامه امکان میدهد همه پیامکها را صرفنظر از محتوا یا محرمانه بودن آنها بخواند."</string>
+ <string name="permdesc_readSms" product="tablet" msgid="2467981548684735522">"به برنامه اجازه میدهد پیامکهای ذخیره شده در رایانهٔ لوحی یا سیم کارت شما را بخواند. این ویژگی به برنامه امکان میدهد همه پیامکها را صرفنظر از محتوا یا محرمانه بودن آنها بخواند."</string>
<string name="permdesc_readSms" product="default" msgid="3695967533457240550">"به برنامه اجازه میدهد پیامکهای ذخیره شده در تلفن یا سیم کارت شما را بخواند. این ویژگی به برنامه امکان میدهد همه پیامکها را صرفنظر از محتوا یا محرمانه بودن آنها بخواند."</string>
<string name="permlab_writeSms" msgid="3216950472636214774">"ویرایش پیامهای نوشتاری شما (پیامک یا MMS)"</string>
- <string name="permdesc_writeSms" product="tablet" msgid="5160413947794501538">"به برنامه اجازه میدهد تا در پیامهای کوتاه ذخیره شده در رایانه لوحی یا سیم کارت بنویسد. برنامههای مخرب پیامهای شما را حذف میکنند."</string>
+ <string name="permdesc_writeSms" product="tablet" msgid="5160413947794501538">"به برنامه اجازه میدهد تا در پیامهای کوتاه ذخیره شده در رایانهٔ لوحی یا سیم کارت بنویسد. برنامههای مخرب پیامهای شما را حذف میکنند."</string>
<string name="permdesc_writeSms" product="default" msgid="7268668709052328567">"به برنامه اجازه میدهد تا در پیامهای کوتاه ذخیره شده در تلفن یا سیم کارت بنویسد. برنامههای مخرب میتوانند پیامهای شما را حذف کنند."</string>
<string name="permlab_receiveWapPush" msgid="5991398711936590410">"دریافت پیامهای نوشتاری (WAP)"</string>
<string name="permdesc_receiveWapPush" msgid="748232190220583385">"به برنامه اجازه میدهد پیامهای WAP را دریافت و پردازش کند. این مجوز میتواند پیامهای ارسالی به شما را بدون نمایش آنها به شما حذف یا کنترل کند."</string>
@@ -226,7 +226,7 @@
<string name="permlab_startAnyActivity" msgid="2918768238045206456">"شروع هر نوع فعالیت"</string>
<string name="permdesc_startAnyActivity" msgid="997823695343584001">"به برنامه اجازه میدهد هر فعالیتی را شروع کند بدون اینکه وضعیت صادرشده یا حفاظت با مجوز در نظر گرفته شود."</string>
<string name="permlab_setScreenCompatibility" msgid="6975387118861842061">"تنظیم سازگاری با صفحهٔ نمایش"</string>
- <string name="permdesc_setScreenCompatibility" msgid="692043618693917374">"به برنامه کاربردی اجازه کنترل حالت سازگاری صفحهٔ نمایش برای برنامههای دیگر را میدهد. برنامههای خرابکار ممکن است باعث کارکرد نادرست دیگر برنامهها شوند."</string>
+ <string name="permdesc_setScreenCompatibility" msgid="692043618693917374">"به برنامهٔ کاربردی اجازه کنترل حالت سازگاری صفحهٔ نمایش برای برنامههای دیگر را میدهد. برنامههای خرابکار ممکن است باعث کارکرد نادرست دیگر برنامهها شوند."</string>
<string name="permlab_setDebugApp" msgid="3022107198686584052">"فعال کردن عیبیابی برنامه"</string>
<string name="permdesc_setDebugApp" msgid="4474512416299013256">"به برنامه اجازه میدهد تا عیبیابی را برای برنامهای دیگر فعال کند. برنامههای مخرب میتوانند از آن استفاده کنند تا اجرای برنامههای دیگر را متوقف کنند."</string>
<string name="permlab_changeConfiguration" msgid="4162092185124234480">"تغییر تنظیمات نمایشگر سیستم"</string>
@@ -244,27 +244,27 @@
<string name="permlab_retrieve_window_content" msgid="8022588608994589938">"بازیابی محتوای صفحه"</string>
<string name="permdesc_retrieve_window_content" msgid="3193269069469700265">"به برنامه اجازه میدهد تا محتوای پنجره فعال را بازیابی کند. برنامههای مخرب میتوانند کل محتوای پنجره را بازیابی کنند و همه متن آنرا به غیر از گذرواژهها امتحان کنند."</string>
<string name="permlab_retrieve_window_info" msgid="8532295199112519378">"بازیابی اطلاعات پنجره"</string>
- <string name="permdesc_retrieve_window_info" msgid="4998836370424186849">"به یک برنامه کاربردی اجازه میدهد که اطلاعات مربوط به پنجرهها را از مدیریت پنجره بازیابی کند. برنامههای کاربردی مخرب ممکن است اطلاعاتی که برای استفاده سیستم داخلی درنظر گرفته شدهاند را بازیابی کنند."</string>
+ <string name="permdesc_retrieve_window_info" msgid="4998836370424186849">"به یک برنامهٔ کاربردی اجازه میدهد که اطلاعات مربوط به پنجرهها را از مدیریت پنجره بازیابی کند. برنامههای کاربردی مخرب ممکن است اطلاعاتی که برای استفاده سیستم داخلی درنظر گرفته شدهاند را بازیابی کنند."</string>
<string name="permlab_filter_events" msgid="8675535648807427389">"فیلتر کردن رویدادها"</string>
- <string name="permdesc_filter_events" msgid="8006236315888347680">"به یک برنامه کاربردی اجازه میدهد یک فیلتر ورودی را که جریان تمام رویدادهای کاربران را قبل از ارسال شدن فیلتر میکند، ثبت نماید. برنامه کاربردی مخرب ممکن است رابط کاربری سیستم را بدون مداخله کاربر، کنترل کند."</string>
+ <string name="permdesc_filter_events" msgid="8006236315888347680">"به یک برنامهٔ کاربردی اجازه میدهد یک فیلتر ورودی را که جریان تمام رویدادهای کاربران را قبل از ارسال شدن فیلتر میکند، ثبت نماید. برنامه کاربردی مخرب ممکن است رابط کاربری سیستم را بدون مداخله کاربر، کنترل کند."</string>
<string name="permlab_shutdown" msgid="7185747824038909016">"خاموش شدن جزئی"</string>
<string name="permdesc_shutdown" msgid="7046500838746291775">"مدیر فعالیت را در حالت خاموشی قرار میدهد. خاموشی را به صورت کامل انجام نمیدهد."</string>
<string name="permlab_stopAppSwitches" msgid="4138608610717425573">"ممانعت از جابجایی برنامه"</string>
<string name="permdesc_stopAppSwitches" msgid="8262195802582255021">"اجازه نمیدهد کاربر به برنامه دیگری برود."</string>
- <string name="permlab_runSetActivityWatcher" msgid="892239094867182656">"نظارت و کنترل راه اندازی همه برنامه"</string>
- <string name="permdesc_runSetActivityWatcher" msgid="6003603162578577406">"به برنامه اجازه میدهد تا نحوه راه اندازی فعالیتهای سیستم را کنترل کند. برنامههای مخرب میتوانند کاملا با سیستم سازگار شوند. این مجوز فقط برای توسعه نیاز است و برای استفاده عادی نیست."</string>
+ <string name="permlab_runSetActivityWatcher" msgid="892239094867182656">"نظارت و کنترل راهاندازی همه برنامه"</string>
+ <string name="permdesc_runSetActivityWatcher" msgid="6003603162578577406">"به برنامه اجازه میدهد تا نحوه راهاندازی فعالیتهای سیستم را کنترل کند. برنامههای مخرب میتوانند کاملا با سیستم سازگار شوند. این مجوز فقط برای توسعه نیاز است و برای استفاده عادی نیست."</string>
<string name="permlab_broadcastPackageRemoved" msgid="2576333434893532475">"ارسال پخش بسته حذف شده"</string>
<string name="permdesc_broadcastPackageRemoved" msgid="6621901216207931089">"به برنامه اجازه میدهد تا اعلان حذف بسته برنامه را پخش کند. برنامههای مخرب میتوانند از آن استفاده کنند تا هر برنامه در حال اجرای دیگر را از بین ببرد."</string>
<string name="permlab_broadcastSmsReceived" msgid="5689095009030336593">"ارسال پخش دریافت شده توسط پیامک"</string>
<string name="permdesc_broadcastSmsReceived" msgid="4152037720034365492">"به برنامه اجازه میدهد تا اعلان دریافت پیام کوتاه را پخش کند. برنامههای مخرب میتوانند از این برای جعل پیامهای کوتاه ورودی استفاده کنند."</string>
<string name="permlab_broadcastWapPush" msgid="3145347413028582371">"ارسال پخش دریافت شده توسط WAP-PUSH"</string>
- <string name="permdesc_broadcastWapPush" msgid="4783402525039442729">"به برنامه اجازه میدهد تا اعلانی را پخش کند که پیام WAP PUSH دریافت کرده است. برنامههای مخرب میتوانند از آن استفاده کنند تا دریافت پیام MMS را جعل کنند یا محتوای هر صفحه وب را با انواع مخرب جایگزین کنند."</string>
+ <string name="permdesc_broadcastWapPush" msgid="4783402525039442729">"به برنامه اجازه میدهد تا اعلانی را پخش کند که پیام WAP PUSH دریافت کرده است. برنامههای مخرب میتوانند از آن استفاده کنند تا دریافت پیام MMS را جعل کنند یا محتوای هر صفحهٔ وب را با انواع مخرب جایگزین کنند."</string>
<string name="permlab_setProcessLimit" msgid="2451873664363662666">"محدود کردن تعداد فرآیندهای در حال اجرا"</string>
<string name="permdesc_setProcessLimit" msgid="7318061314040879542">"به برنامه اجازه میدهد تا حداکثر تعداد پردازشهایی را که اجرا خواهد شد کنترل کند. هرگز برای برنامههای عادی لازم نیست."</string>
<string name="permlab_setAlwaysFinish" msgid="550958507798796965">"بستن اجباری برنامههای پسزمینه"</string>
<string name="permdesc_setAlwaysFinish" msgid="7471310652868841499">"به برنامه اجازه میدهد تا به محض اینکه فعالیتها به پسزمینه رفتند تمام شوند. برای برنامههای عادی نیازی نیست."</string>
<string name="permlab_batteryStats" msgid="7863923071360031652">"اصلاح کردن آمار مربوط به باتری"</string>
- <string name="permdesc_batteryStats" msgid="6835186932305744068">"به برنامه اجازه میدهد تا آمار جمع آوری شده باتری را تغییر دهد. برای استفاده برنامههای عادی نیست."</string>
+ <string name="permdesc_batteryStats" msgid="6835186932305744068">"به برنامه اجازه میدهد تا آمار جمعآوری شده باتری را تغییر دهد. برای استفاده برنامههای عادی نیست."</string>
<string name="permlab_backup" msgid="470013022865453920">"کنترل نسخهٔ پشتیبان سیستم و بازیابی"</string>
<string name="permdesc_backup" msgid="6912230525140589891">"به برنامه اجازه میدهد پشتیبان سیستم را کنترل کند و مکانیستم را بازیابی کند. برای استفاده برنامههای عادی نیست."</string>
<string name="permlab_confirm_full_backup" msgid="5557071325804469102">"تهیه نسخهٔ پشتیبان کامل را تأیید کرده یا عملیات را بازیابی کنید"</string>
@@ -278,7 +278,7 @@
<string name="permlab_manageAppTokens" msgid="1286505717050121370">"مدیریت نشانههای برنامه"</string>
<string name="permdesc_manageAppTokens" msgid="8043431713014395671">"به برنامه اجازه میدهد با ایجاد کنارگذر از سفارش عادی Z، نشانههای خود را ایجاد و مدیریت کند. برای برنامههای عادی مورد نیاز است."</string>
<string name="permlab_injectEvents" msgid="1378746584023586600">"کلیدها و دکمههای کنترل را فشار دهید"</string>
- <string name="permdesc_injectEvents" product="tablet" msgid="206352565599968632">"به برنامه اجازه میدهد تا رویدادهای ورودی خود (فشردن کلیدها و غیره) را تحویل دهد. برنامههای مخرب میتوانند از آن استفاده کنند تا کارکرد رایانه لوحی را کنترل کنند."</string>
+ <string name="permdesc_injectEvents" product="tablet" msgid="206352565599968632">"به برنامه اجازه میدهد تا رویدادهای ورودی خود (فشردن کلیدها و غیره) را تحویل دهد. برنامههای مخرب میتوانند از آن استفاده کنند تا کارکرد رایانهٔ لوحی را کنترل کنند."</string>
<string name="permdesc_injectEvents" product="default" msgid="653128057572326253">"به برنامه اجازه میدهد تا رویدادهای ورودی خود را به برنامههای دیگر تحویل دهد (فشردن کلیدها و غیره). برنامههای مخرب میتوانند از آن برای کنترل کارکرد تلفن استفاده کنند."</string>
<string name="permlab_readInputState" msgid="469428900041249234">"مواردی که مینویسید و کارهایی که انجام میدهید را ضبط کنید"</string>
<string name="permdesc_readInputState" msgid="8387754901688728043">"به برنامه اجازه میدهد تا کلیدهایی را که هنگام تعامل با برنامهٔ دیگر فشار میدهید ببیند (مانند تایپ کردن گذرواژه). برای برنامههای عادی مورد نیاز نیست."</string>
@@ -300,42 +300,42 @@
<string name="permdesc_setOrientation" msgid="3046126619316671476">"به برنامه اجازه میدهد تا چرخش صفحه را هر وقت بخواهد تغییر دهد. برای برنامههای عادی نیاز نیست."</string>
<string name="permlab_setPointerSpeed" msgid="9175371613322562934">"تغییر سرعت اشارهگر"</string>
<string name="permdesc_setPointerSpeed" msgid="6866563234274104233">"به برنامه اجازه میدهد تا سرعت ماوس و پد کنترل را هر وقت خواست تغییر دهد. برای برنامههای عادی نیاز نیست."</string>
- <string name="permlab_setKeyboardLayout" msgid="4778731703600909340">"تغییر چیدمان صفحه کلید"</string>
- <string name="permdesc_setKeyboardLayout" msgid="8480016771134175879">"به برنامه اجازه میدهد تا چیدمان صفحه کلید را تغییر دهد. این کار هیچگاه برای برنامههای عادی نیاز نیست."</string>
+ <string name="permlab_setKeyboardLayout" msgid="4778731703600909340">"تغییر چیدمان صفحهکلید"</string>
+ <string name="permdesc_setKeyboardLayout" msgid="8480016771134175879">"به برنامه اجازه میدهد تا چیدمان صفحهکلید را تغییر دهد. این کار هیچگاه برای برنامههای عادی نیاز نیست."</string>
<string name="permlab_signalPersistentProcesses" msgid="4539002991947376659">"ارسال سیگنالهای Linux به برنامهها"</string>
<string name="permdesc_signalPersistentProcesses" msgid="4896992079182649141">"به برنامه اجازه میدهد تا درخواست کند سیگنال ارائه شده به همه مراحل دائم ارسال شود."</string>
<string name="permlab_persistentActivity" msgid="8841113627955563938">"همیشه برنامه اجرا شود"</string>
- <string name="permdesc_persistentActivity" product="tablet" msgid="8525189272329086137">"به برنامه امکان میدهد قسمتهایی از خود را در حافظه دائمی کند. این کار حافظه موجود را برای سایر برنامهها محدود کرده و باعث کندی رایانه لوحی میشود."</string>
+ <string name="permdesc_persistentActivity" product="tablet" msgid="8525189272329086137">"به برنامه امکان میدهد قسمتهایی از خود را در حافظه دائمی کند. این کار حافظه موجود را برای سایر برنامهها محدود کرده و باعث کندی رایانهٔ لوحی میشود."</string>
<string name="permdesc_persistentActivity" product="default" msgid="4384760047508278272">"به برنامه امکان میدهد قسمتهایی از خود را در حافظه دائمی کند. این کار حافظه موجود را برای سایر برنامهها محدود کرده و باعث کندی تلفن میشود."</string>
<string name="permlab_deletePackages" msgid="184385129537705938">"حذف برنامهها"</string>
<string name="permdesc_deletePackages" msgid="7411480275167205081">"به برنامه اجازه میدهد تا بستههای Android را پاک کند. برنامههای مخرب میتوانند از آن استفاده کنند تا برنامههای مهم را حذف کنند."</string>
<string name="permlab_clearAppUserData" msgid="274109191845842756">"حذف دادههای برنامههای دیگر"</string>
<string name="permdesc_clearAppUserData" msgid="4625323684125459488">"به برنامه اجازه میدهد تا دادههای کاربر را پاک کند."</string>
- <string name="permlab_deleteCacheFiles" msgid="3128665571837408675">"حذف حافظه پنهان برنامههای دیگر"</string>
- <string name="permdesc_deleteCacheFiles" msgid="3812998599006730196">"به برنامه اجازه میدهد تا فایلهای حافظه پنهان را پاک کند."</string>
+ <string name="permlab_deleteCacheFiles" msgid="3128665571837408675">"حذف حافظهٔ پنهان برنامههای دیگر"</string>
+ <string name="permdesc_deleteCacheFiles" msgid="3812998599006730196">"به برنامه اجازه میدهد تا فایلهای حافظهٔ پنهان را پاک کند."</string>
<string name="permlab_getPackageSize" msgid="7472921768357981986">"اندازه گیری فضای حافظه برنامه"</string>
- <string name="permdesc_getPackageSize" msgid="3921068154420738296">"به برنامه اجازه میدهد تا کدها، دادهها و اندازههای حافظه پنهان خود را بازیابی کند"</string>
+ <string name="permdesc_getPackageSize" msgid="3921068154420738296">"به برنامه اجازه میدهد تا کدها، دادهها و اندازههای حافظهٔ پنهان خود را بازیابی کند"</string>
<string name="permlab_installPackages" msgid="2199128482820306924">"نصب مستقیم برنامه"</string>
<string name="permdesc_installPackages" msgid="5628530972548071284">"به برنامه اجازه میدهد تا بستههای Android به روز شده یا جدید را نصب کند. برنامههای مخرب میتوانند از این استفاده کنند تا برنامههای جدید را با مجوزهای قوی اختیاری اضافه کنند."</string>
- <string name="permlab_clearAppCache" msgid="7487279391723526815">"حذف تمام دادههای حافظه پنهان برنامه"</string>
- <string name="permdesc_clearAppCache" product="tablet" msgid="3523396284474042284">"به برنامه اجازه میدهد تا حافظه رایانه لوحی را با حذف فایلها در فهرست حافظه پنهان برنامه آزاد کند. معمولا دسترسی برای پردازش سیستم بسیار محدود است."</string>
- <string name="permdesc_clearAppCache" product="default" msgid="5067988373366292186">"به برنامه اجازه میدهد تا با حذف فایلها در فهرست حافظه پنهان برنامه حافظه تلفن را آزاد کند. معمولا دسترسی به پردازش سیستم بسیار محدود است."</string>
+ <string name="permlab_clearAppCache" msgid="7487279391723526815">"حذف تمام دادههای حافظهٔ پنهان برنامه"</string>
+ <string name="permdesc_clearAppCache" product="tablet" msgid="3523396284474042284">"به برنامه اجازه میدهد تا حافظه رایانهٔ لوحی را با حذف فایلها در فهرست حافظهٔ پنهان برنامه آزاد کند. معمولا دسترسی برای پردازش سیستم بسیار محدود است."</string>
+ <string name="permdesc_clearAppCache" product="default" msgid="5067988373366292186">"به برنامه اجازه میدهد تا با حذف فایلها در فهرست حافظهٔ پنهان برنامه حافظه تلفن را آزاد کند. معمولا دسترسی به پردازش سیستم بسیار محدود است."</string>
<string name="permlab_movePackage" msgid="3289890271645921411">"انتقال منابع برنامه"</string>
<string name="permdesc_movePackage" msgid="319562217778244524">"به برنامه اجازه میدهد تا منابع برنامه را از رسانه داخلی به رسانه خارجی و بالعکس منتقل کند."</string>
<string name="permlab_readLogs" msgid="6615778543198967614">"مطالعه دادههای گزارش حساس"</string>
- <string name="permdesc_readLogs" product="tablet" msgid="82061313293455151">"به برنامه اجازه میدهد فایلهای مختلف گزارش سیستم را بخواند. با این کار، برنامه اطلاعات کلی مربوط به کاری که با رایانه لوحی انجام میدهید را کشف میکند، که ممکن است حاوی اطلاعات شخصی و خصوصی باشند."</string>
+ <string name="permdesc_readLogs" product="tablet" msgid="82061313293455151">"به برنامه اجازه میدهد فایلهای مختلف گزارش سیستم را بخواند. با این کار، برنامه اطلاعات کلی مربوط به کاری که با رایانهٔ لوحی انجام میدهید را کشف میکند، که ممکن است حاوی اطلاعات شخصی و خصوصی باشند."</string>
<string name="permdesc_readLogs" product="default" msgid="2063438140241560443">"به برنامه اجازه میدهد تا فایلهای گزارش مختلف سیستم را بخواند. این کار به برنامه اجازه میدهد اطلاعات عمومی کاری که با تلفن انجام میدهید مثلا اطلاعات خصوصی و شخصی را کشف کند."</string>
<string name="permlab_anyCodecForPlayback" msgid="715805555823881818">"استفاده از هر رمزگشای رسانهای برای بازپخش"</string>
<string name="permdesc_anyCodecForPlayback" msgid="8283912488433189010">"اجازه میدهد برنامه از هر رمزگشای رسانه نصب شدهای استفاده کند تا برای پخش رمزگشایی شود."</string>
<string name="permlab_diagnostic" msgid="8076743953908000342">"خواندن/نوشتن منابع متعلق به تشخیص"</string>
<string name="permdesc_diagnostic" msgid="6608295692002452283">"به برنامه اجازه میدهد هر منبعی را که متعلق به گروه تشخیص است بخواند و در آن بنویسد؛ بهعنوان مثال، فایلهای /dev. این امر بهصورت بالقوه میتواند بر پایدار بودن و امنیت سیستم تأثیر بگذارد. این تنها باید برای تشخیصهای مختص سختافزار توسط تولیدکننده یا اپراتور استفاده شود."</string>
<string name="permlab_changeComponentState" msgid="6335576775711095931">"فعال یا غیر فعال کردن اجزای برنامه"</string>
- <string name="permdesc_changeComponentState" product="tablet" msgid="8887435740982237294">"به برنامه اجازه میدهد تا فعال بودن یا نبودن اجزای برنامهٔ دیگر را تغییر دهد. برنامههای مخرب میتوانند از آن استفاده کنند تا قابلیتهای مهم رایانه لوحی را غیرفعال کنند. باید دقت کرد که با این مجوز ممکن است وضعیت اجزای برنامه ناپایدار، ناهماهنگ یا غیرقابل استفاده شود."</string>
+ <string name="permdesc_changeComponentState" product="tablet" msgid="8887435740982237294">"به برنامه اجازه میدهد تا فعال بودن یا نبودن اجزای برنامهٔ دیگر را تغییر دهد. برنامههای مخرب میتوانند از آن استفاده کنند تا قابلیتهای مهم رایانهٔ لوحی را غیرفعال کنند. باید دقت کرد که با این مجوز ممکن است وضعیت اجزای برنامه ناپایدار، ناهماهنگ یا غیرقابل استفاده شود."</string>
<string name="permdesc_changeComponentState" product="default" msgid="1827232484416505615">"به برنامه اجازه میدهد تا فعال بودن یا غیرفعال بودن جزئیات برنامهٔ دیگر را تغییر دهد. برنامههای مخرب میتوانند از آن استفاده کنند تا ویژگیهای مهم را غیرفعال کنند. برای این مجوز باید دقت کنید چون ممکن است وضعیت جزئیات برنامه ناپایدار، بیثبات یا غیرقابل استفاده شود."</string>
<string name="permlab_grantRevokePermissions" msgid="4627315351093508795">"ارائه یا لغو مجوزها"</string>
- <string name="permdesc_grantRevokePermissions" msgid="4088642654085850662">"به یک برنامه کاربردی اجازه میدهد تا مجوزهای خاصی را برای خود یا دیگر برنامهها ارائه کرده یا آنها را لغو کند. برنامههای مضر از این حالت برای دسترسی به ویژگیهایی استفاده میکنند که شما اجازه آن را در اختیارشان قرار ندادهاید."</string>
+ <string name="permdesc_grantRevokePermissions" msgid="4088642654085850662">"به یک برنامهٔ کاربردی اجازه میدهد تا مجوزهای خاصی را برای خود یا دیگر برنامهها ارائه کرده یا آنها را لغو کند. برنامههای مضر از این حالت برای دسترسی به ویژگیهایی استفاده میکنند که شما اجازه آن را در اختیارشان قرار ندادهاید."</string>
<string name="permlab_setPreferredApplications" msgid="8463181628695396391">"تنظیم برنامههای ترجیحی"</string>
- <string name="permdesc_setPreferredApplications" msgid="4973986762241783712">"به برنامه اجازه میدهد تا برنامههای ترجیحی شما را تغییر دهد. برنامههای مخرب میتوانند بدون اعلان برنامههایی را که اجرا میشوند، تغییر دهند خود را به جای برنامههای کنونی قلمداد کنند تا دادههای شخصی را از شما جمع آوری کنند."</string>
+ <string name="permdesc_setPreferredApplications" msgid="4973986762241783712">"به برنامه اجازه میدهد تا برنامههای ترجیحی شما را تغییر دهد. برنامههای مخرب میتوانند بدون اعلان برنامههایی را که اجرا میشوند، تغییر دهند خود را به جای برنامههای کنونی قلمداد کنند تا دادههای شخصی را از شما جمعآوری کنند."</string>
<string name="permlab_writeSettings" msgid="2226195290955224730">"اصلاح تنظیمات سیستم"</string>
<string name="permdesc_writeSettings" msgid="7775723441558907181">"به برنامه اجازه میدهد تا دادههای تنظیم سیستم را تغییر دهد. برنامههای مخرب میتوانند پیکربندی سیستم شما را خراب کنند."</string>
<string name="permlab_writeSecureSettings" msgid="204676251876718288">"اصلاح کردن تنظیمات سیستم ایمن"</string>
@@ -343,36 +343,36 @@
<string name="permlab_writeGservices" msgid="2149426664226152185">"اصلاح کردن نقشه سرویسهای Google"</string>
<string name="permdesc_writeGservices" msgid="1287309437638380229">"به برنامه اجازه میدهد تا نقشه سرویسهای Google را تغییر دهد. برای استفاده برنامههای عادی نیست."</string>
<string name="permlab_receiveBootCompleted" msgid="5312965565987800025">"اجرا شدن در هنگام راهاندازی"</string>
- <string name="permdesc_receiveBootCompleted" product="tablet" msgid="7390304664116880704">"به برنامه اجازه میدهد تا به محض اتمام راهاندازی سیستم خودبخود شروع به کار کند. این کار ممکن است باعث شود مدت زمان بیشتری صرف شدوع به کار رایانه لوحی شود و به برنامه اجازه میدهد تا با اجرای همیشگی رایانه لوحی را کند کند."</string>
+ <string name="permdesc_receiveBootCompleted" product="tablet" msgid="7390304664116880704">"به برنامه اجازه میدهد تا به محض اتمام راهاندازی سیستم خودبخود شروع به کار کند. این کار ممکن است باعث شود مدت زمان بیشتری صرف شدوع به کار رایانهٔ لوحی شود و به برنامه اجازه میدهد تا با اجرای همیشگی رایانهٔ لوحی را کند کند."</string>
<string name="permdesc_receiveBootCompleted" product="default" msgid="513950589102617504">"به برنامه اجازه میدهد تا به محض اینکه سیستم راهاندازی شد خودبخود شروع به کار کند. این کار باعث میشود مدت زمان بیشتری صرف شود تا تلفن شروع به کار کند و به برنامه اجازه میدهد تا کل تلفن کند شود چون همیشه در حال اجرا شدن است."</string>
<string name="permlab_broadcastSticky" msgid="7919126372606881614">"ارسال پخش چسبنده"</string>
- <string name="permdesc_broadcastSticky" product="tablet" msgid="7749760494399915651">"به برنامه اجازه میدهد تا پخشهای ماندگار را که پس از اتمام پخش باقی میمانند ارسال کند. استفاده بیش از حد این ویژگی ممکن است باعث مصرف بیش از حد حافظه و در نتیجه کندی یا ناپایداری رایانه لوحی شود."</string>
+ <string name="permdesc_broadcastSticky" product="tablet" msgid="7749760494399915651">"به برنامه اجازه میدهد تا پخشهای ماندگار را که پس از اتمام پخش باقی میمانند ارسال کند. استفاده بیش از حد این ویژگی ممکن است باعث مصرف بیش از حد حافظه و در نتیجه کندی یا ناپایداری رایانهٔ لوحی شود."</string>
<string name="permdesc_broadcastSticky" product="default" msgid="2825803764232445091">"به برنامه اجازه میدهد تا پخشهای ماندگار را که پس از اتمام پخش باقی میمانند ارسال کند. استفاده بیش از حد این ویژگی ممکن است باعث مصرف بیش از حد حافظه و در نتیجه کندی یا ناپایداری تلفن شود."</string>
<string name="permlab_readContacts" msgid="8348481131899886131">"خواندن مخاطبین شما"</string>
- <string name="permdesc_readContacts" product="tablet" msgid="5294866856941149639">"به برنامه اجازه میدهد دادههای مربوط به مخاطبین ذخیره شده در رایانه لوحی شما را بخواند از جمله، تعداد دفعات تماسهایی که برقرار کردهاید، ایمیلهایی که ارسال کردهاید یا به روشهای دیگری به افراد خاصی ارتباط برقرار کردهاید. این با برنامهها امکان میدهد دادههای مخاطب شما را ذخیره کنند و برنامههای مخرب ممکن است دادههای مخاطب را بدون اطلاع شما به اشتراک بگذارند."</string>
+ <string name="permdesc_readContacts" product="tablet" msgid="5294866856941149639">"به برنامه اجازه میدهد دادههای مربوط به مخاطبین ذخیره شده در رایانهٔ لوحی شما را بخواند از جمله، تعداد دفعات تماسهایی که برقرار کردهاید، ایمیلهایی که ارسال کردهاید یا به روشهای دیگری به افراد خاصی ارتباط برقرار کردهاید. این با برنامهها امکان میدهد دادههای مخاطب شما را ذخیره کنند و برنامههای مخرب ممکن است دادههای مخاطب را بدون اطلاع شما به اشتراک بگذارند."</string>
<string name="permdesc_readContacts" product="default" msgid="8440654152457300662">"به برنامه اجازه میدهد دادههای مربوط به مخاطبین ذخیره شده در تلفن شما را بخواند از جمله، تعداد دفعات تماسهایی که برقرار کردهاید، ایمیلهایی که ارسال کردهاید یا به روشهای دیگری با افراد خاصی ارتباط برقرار کردهاید. این به برنامهها امکان میدهد دادههای مخاطب شما را ذخیره کنند و برنامههای مخرب ممکن است دادههای مخاطب را بدون اطلاع شما به اشتراک بگذارند."</string>
<string name="permlab_writeContacts" msgid="5107492086416793544">"اصلاح مخاطبین شما"</string>
- <string name="permdesc_writeContacts" product="tablet" msgid="897243932521953602">"به برنامه اجازه میدهد دادههای مربوط به مخاطبین ذخیره شده در رایانه لوحی شما را از جمله تعداد تماسهایی که برقرار کردهاید، ایمیلهایی که ارسال کردهاید یا ارتباطاتی را که به هر شکل با مخاطبین خاصی برقرار کردید تغییر دهد. این مجوز به برنامه اجازه میدهد دادههای مخاطب را حذف نماید."</string>
+ <string name="permdesc_writeContacts" product="tablet" msgid="897243932521953602">"به برنامه اجازه میدهد دادههای مربوط به مخاطبین ذخیره شده در رایانهٔ لوحی شما را از جمله تعداد تماسهایی که برقرار کردهاید، ایمیلهایی که ارسال کردهاید یا ارتباطاتی را که به هر شکل با مخاطبین خاصی برقرار کردید تغییر دهد. این مجوز به برنامه اجازه میدهد دادههای مخاطب را حذف نماید."</string>
<string name="permdesc_writeContacts" product="default" msgid="589869224625163558">"به برنامه اجازه میدهد دادههای مربوط به مخاطبین ذخیره شده در تلفن شما را از جمله تعداد تماسهایی که برقرار کردهاید، ایمیلهایی که ارسال کردهاید یا ارتباطاتی را که به هر شکل با مخاطبین خاصی برقرار کردید تغییر دهد. این مجوز به برنامه اجازه میدهد دادههای مخاطب را حذف نماید."</string>
<string name="permlab_readCallLog" msgid="3478133184624102739">"خواندن گزارش تماس"</string>
- <string name="permdesc_readCallLog" product="tablet" msgid="3700645184870760285">"به برنامه اجازه میدهد گزارش تماس رایانه لوحی شما را بخواند از جمله دادههای مربوط به تماسهای ورودی و خروجی. این مجوز به برنامهها اجازه میدهد دادههای گزارش تماس شما را ذخیره کنند و برنامههای مخرب ممکن است دادههای گزارش تماس شما را بدون اطلاع شما به اشتراک بگذارند."</string>
+ <string name="permdesc_readCallLog" product="tablet" msgid="3700645184870760285">"به برنامه اجازه میدهد گزارش تماس رایانهٔ لوحی شما را بخواند از جمله دادههای مربوط به تماسهای ورودی و خروجی. این مجوز به برنامهها اجازه میدهد دادههای گزارش تماس شما را ذخیره کنند و برنامههای مخرب ممکن است دادههای گزارش تماس شما را بدون اطلاع شما به اشتراک بگذارند."</string>
<string name="permdesc_readCallLog" product="default" msgid="5777725796813217244">"به برنامه اجازه میدهد گزارش تماس تلفنی شما را بخواند از جمله دادههای مربوط به تماسهای ورودی و خروجی. این مجوز به برنامهها اجازه میدهد دادههای گزارش تماس شما را ذخیره کنند و برنامههای مخرب ممکن است دادههای گزارش تماس شما را بدون اطلاع شما به اشتراک بگذارند."</string>
<string name="permlab_writeCallLog" msgid="8552045664743499354">"نوشتن گزارش تماس"</string>
- <string name="permdesc_writeCallLog" product="tablet" msgid="6661806062274119245">"به برنامه اجازه میدهد گزارشات تماس رایانه لوحی شما، از جمله دادههایی درمورد تماسهای ورودی و خروجی را تغییر دهد. برنامههای مخرب ممکن است از این ویژگی برای پاک کردن یا تغییر گزارش تماس شما استفاده کنند."</string>
+ <string name="permdesc_writeCallLog" product="tablet" msgid="6661806062274119245">"به برنامه اجازه میدهد گزارشات تماس رایانهٔ لوحی شما، از جمله دادههایی درمورد تماسهای ورودی و خروجی را تغییر دهد. برنامههای مخرب ممکن است از این ویژگی برای پاک کردن یا تغییر گزارش تماس شما استفاده کنند."</string>
<string name="permdesc_writeCallLog" product="default" msgid="683941736352787842">"به برنامه اجازه میدهد گزارشات تماس تلفنی شما، از جمله دادههایی درمورد تماسهای ورودی و خروجی را تغییر دهد. برنامههای مخرب ممکن است از این ویژگی برای پاک کردن یا تغییر گزارش تماس شما استفاده کنند."</string>
<string name="permlab_readProfile" msgid="4701889852612716678">"خواندن کارت تماس شما"</string>
- <string name="permdesc_readProfile" product="default" msgid="5462475151849888848">"به برنامه اجازه میدهد اطلاعات نمایه شخصی ذخیره شده در دستگاه شما، مانند نام و اطلاعات تماس شما را بخواند. یعنی برنامه میتواند شما را شناسایی کند و ممکن است اطلاعات نمایه شما را به دیگران ارسال کند."</string>
+ <string name="permdesc_readProfile" product="default" msgid="5462475151849888848">"به برنامه اجازه میدهد اطلاعات نمایه شخصی ذخیره شده در دستگاه شما، مانند نام و اطلاعات تماس شما را بخواند. یعنی برنامه میتواند شما را شناسایی کند و ممکن است اطلاعات نمایهٔ شما را به دیگران ارسال کند."</string>
<string name="permlab_writeProfile" msgid="907793628777397643">"اصلاح کارت تماس شما"</string>
- <string name="permdesc_writeProfile" product="default" msgid="5552084294598465899">"به برنامه اجازه میدهد تا اطلاعات نمایه شخصی ذخیره شده در دستگاه شما، مانند نام و اطلاعات تماس شما را تغییر دهد یا اضافه کند. یعنی برنامه میتواند شما را شناسایی کند و ممکن است اطلاعات نمایه شما را برای دیگران ارسال کند."</string>
+ <string name="permdesc_writeProfile" product="default" msgid="5552084294598465899">"به برنامه اجازه میدهد تا اطلاعات نمایه شخصی ذخیره شده در دستگاه شما، مانند نام و اطلاعات تماس شما را تغییر دهد یا اضافه کند. یعنی برنامه میتواند شما را شناسایی کند و ممکن است اطلاعات نمایهٔ شما را برای دیگران ارسال کند."</string>
<string name="permlab_readSocialStream" product="default" msgid="1268920956152419170">"خواندن جریان اجتماعی شما"</string>
<string name="permdesc_readSocialStream" product="default" msgid="4255706027172050872">"به برنامه اجازه میدهد به بهروزرسانیهای اجتماعی از طرف شما و دوستان شما دسترسی پیدا کرده و آنها را همگامسازی کند. دقت کنید که هنگام اشتراکگذاری -- این ویژگی به برنامه اجازه میدهد ارتباطات بین شما و دوستان شما را در شبکههای اجتماعی، صرفنظر از محرمانه بودن آنها بخواند. توجه: این مجوز ممکن است در همه شبکههای اجتماعی اجرا نشود."</string>
<string name="permlab_writeSocialStream" product="default" msgid="3504179222493235645">"نوشتن در جریان اجتماعی شما"</string>
<string name="permdesc_writeSocialStream" product="default" msgid="3086557552204114849">"به برنامه اجازه میدهد بهروزرسانیهای اجتماعی از طرف دوستان شما را نمایش دهد. دقت کنید هنگام اشتراکگذاری اطلاعات -- این ویژگی به برنامه اجازه میدهد پیامهایی را که به نظر میرسد از طرف یکی از دوستان شما باشد ایجاد کند. توجه: این مجوز در همه شبکههای اجتماعی قابل اجرا نیست."</string>
<string name="permlab_readCalendar" msgid="5972727560257612398">"خواندن رویدادهای تقویم به همراه اطلاعات محرمانه"</string>
- <string name="permdesc_readCalendar" product="tablet" msgid="4216462049057658723">"به برنامه امکان میدهد همه رویدادهای تقویم ذخیره شده در رایانه لوحی شما را بخواند، از جمله رویدادهای دوستان یا همکاران. این ممکن است به برنامه امکان دهد دادههای تقویم شما را صرفنظر از محرمانه یا حساس بودن آنها به اشتراک گذاشته یا ذخیره کند."</string>
+ <string name="permdesc_readCalendar" product="tablet" msgid="4216462049057658723">"به برنامه امکان میدهد همه رویدادهای تقویم ذخیره شده در رایانهٔ لوحی شما را بخواند، از جمله رویدادهای دوستان یا همکاران. این ممکن است به برنامه امکان دهد دادههای تقویم شما را صرفنظر از محرمانه یا حساس بودن آنها به اشتراک گذاشته یا ذخیره کند."</string>
<string name="permdesc_readCalendar" product="default" msgid="7434548682470851583">"به برنامه امکان میدهد همه رویدادهای تقویم ذخیره شده در تلفن شما را بخواند، از جمله رویدادهای دوستان یا همکاران. این ممکن است به برنامه امکان دهد دادههای تقویم شما را صرفنظر از محرمانه یا حساس بودن آنها به اشتراک گذاشته یا ذخیره کند."</string>
<string name="permlab_writeCalendar" msgid="8438874755193825647">"افزودن یا تغییر رویدادهای تقویم و ارسال ایمیل به مهمانان بدون دخالت مالک"</string>
- <string name="permdesc_writeCalendar" product="tablet" msgid="6679035520113668528">"به برنامه اجازه میدهد رویدادهایی را که میتوانید در رایانه لوحی خود اصلاح نمایید، از جمله رویدادهای دوستان یا همکاران خود را، اضافه یا حذف کرده یا تغییر دهد. این ویژگی ممکن است به برنامه اجازه دهد پیامهایی را که به نظر میرسد از مالکین تقویم رسیده است ارسال نموده یا رویدادها را بدون اطلاع مالک اصلاح کنند."</string>
+ <string name="permdesc_writeCalendar" product="tablet" msgid="6679035520113668528">"به برنامه اجازه میدهد رویدادهایی را که میتوانید در رایانهٔ لوحی خود اصلاح نمایید، از جمله رویدادهای دوستان یا همکاران خود را، اضافه یا حذف کرده یا تغییر دهد. این ویژگی ممکن است به برنامه اجازه دهد پیامهایی را که به نظر میرسد از مالکین تقویم رسیده است ارسال نموده یا رویدادها را بدون اطلاع مالک اصلاح کنند."</string>
<string name="permdesc_writeCalendar" product="default" msgid="2324469496327249376">"به برنامه اجازه میدهد رویدادهایی را که میتوانید در تلفن خود اصلاح نمایید، از جمله رویدادهای دوستان یا همکاران خود را، اضافه یا حذف کرده یا تغییر دهد. این ویژگی ممکن است به برنامه اجازه دهد پیامهایی را که به نظر میرسد از مالکین تقویم رسیده است ارسال نموده یا رویدادها را بدون اطلاع مالک اصلاح کنند."</string>
<string name="permlab_accessMockLocation" msgid="8688334974036823330">"منابع مکان کاذب برای تست"</string>
<string name="permdesc_accessMockLocation" msgid="5808711039482051824">"منابع موقعیت مکانی کاذب را برای تست کردن یا نصب یک ارائهدهنده موقعیت مکانی جدید ایجاد نمایید. این کار به برنامه امکان میدهد موقعیت مکانی و/یا وضعیت گزارش داده شده توسط سایر منابع موقعیت مکانی مانند GPS یا ارائهدهندگان موقعیت مکانی را نادیده بگیرد."</string>
@@ -381,7 +381,7 @@
<string name="permlab_installLocationProvider" msgid="6578101199825193873">"مجوز برای نصب یک ارائه دهنده مکان"</string>
<string name="permdesc_installLocationProvider" msgid="9066146120470591509">"منابع موقعیت مکانی کاذب را برای تست کردن یا نصب یک ارائهدهنده موقعیت مکانی جدید ایجاد نمایید. این کار به برنامه امکان میدهد موقعیت مکانی و/یا وضعیت گزارش داده شده توسط سایر منابع موقعیت مکانی مانند GPS یا ارائهدهندگان موقعیت مکانی را نادیده بگیرد."</string>
<string name="permlab_accessFineLocation" msgid="5885550969882561436">"موقعیت مکانی دقیق (GPS)"</string>
- <string name="permdesc_accessFineLocation" product="tablet" msgid="8960597421469894181">"به منابع موقعیت مکانی دقیق مانند سیستم موقعیتیابی جهانی در رایانه لوحی خود دسترسی پیدا کنید. وقتی سرویسهای موقعیت مکانی موجود و فعال باشند، این مجوز به برنامه اجازه میدهد موقعیت مکانی دقیق شما را تعیین کند."</string>
+ <string name="permdesc_accessFineLocation" product="tablet" msgid="8960597421469894181">"به منابع موقعیت مکانی دقیق مانند سیستم موقعیتیابی جهانی در رایانهٔ لوحی خود دسترسی پیدا کنید. وقتی سرویسهای موقعیت مکانی موجود و فعال باشند، این مجوز به برنامه اجازه میدهد موقعیت مکانی دقیق شما را تعیین کند."</string>
<string name="permdesc_accessFineLocation" product="default" msgid="239268765496141815">"به منابع موقعیت مکانی دقیق مانند سیستم موقعیتیابی جهانی در تلفن خود دسترسی پیدا کنید. وقتی سرویسهای موقعیت مکانی موجود و فعال باشند، این مجوز به برنامه اجازه میدهد موقعیت مکانی دقیق شما را تعیین کند."</string>
<string name="permlab_accessCoarseLocation" msgid="7422827215441638984">"موقعیت مکانی تقریبی (مبتنی بر شبکه)"</string>
<string name="permdesc_accessCoarseLocation" msgid="5383798877137640762">"به موقعیت مکانی تقریبی ارائهدهندگان موقعیت مکانی با استفاده از منابع شبکه مانند برج مخابراتی و Wi-Fi دسترسی پیدا کنید. وقتی این سرویسهای موقعیت مکانی موجود و فعال باشند، این مجوز به برنامه امکان میدهد موقعیت مکانی تقریبی شما را تعیین کند."</string>
@@ -395,14 +395,14 @@
<string name="permdesc_recordAudio" msgid="4906839301087980680">"به برنامه اجازه میدهد صدا را با میکروفن ضبط کند. این مجوز به برنامه اجازه میدهد صدا را در هر زمان که بخواهید بدون تأیید شما ضبط کند."</string>
<string name="permlab_camera" msgid="3616391919559751192">"عکسبرداری و فیلمبرداری"</string>
<string name="permdesc_camera" msgid="8497216524735535009">"به برنامه اجازه میدهد با دوربین به عکسبرداری و فیلمبرداری بپردازد. این مجوز به برنامه اجازه میدهد از دوربین در هر زمانی بدون تأیید شما استفاده کند."</string>
- <string name="permlab_brick" product="tablet" msgid="2961292205764488304">"غیر فعال کردن دائم رایانه لوحی"</string>
+ <string name="permlab_brick" product="tablet" msgid="2961292205764488304">"غیر فعال کردن دائم رایانهٔ لوحی"</string>
<string name="permlab_brick" product="default" msgid="8337817093326370537">"تلفن بطور دائمی غیرفعال شود"</string>
- <string name="permdesc_brick" product="tablet" msgid="4334818808001699530">"به برنامه اجازه میدهد تا رایانه لوحی را به طور کلی و دائمی غیرفعال کند. این کار بسیار خطرناک است."</string>
+ <string name="permdesc_brick" product="tablet" msgid="4334818808001699530">"به برنامه اجازه میدهد تا رایانهٔ لوحی را به طور کلی و دائمی غیرفعال کند. این کار بسیار خطرناک است."</string>
<string name="permdesc_brick" product="default" msgid="5788903297627283099">"به برنامه اجازه میدهد تا گوشی را به طور کلی و دائمی غیرفعال کند. این کار بسیار خطرناک است."</string>
- <string name="permlab_reboot" product="tablet" msgid="3436634972561795002">"راه اندازی مجدد اجباری رایانه لوحی"</string>
- <string name="permlab_reboot" product="default" msgid="2898560872462638242">"اجبار برنامه برای راه اندازی مجدد"</string>
- <string name="permdesc_reboot" product="tablet" msgid="8172056180063700741">"به برنامه اجازه میدهد تا سبب راه اندازی مجدد رایانه لوحی شود."</string>
- <string name="permdesc_reboot" product="default" msgid="5326008124289989969">"به برنامه اجازه میدهد تا سبب راه اندازی مجدد گوشی شود."</string>
+ <string name="permlab_reboot" product="tablet" msgid="3436634972561795002">"راهاندازی مجدد اجباری رایانهٔ لوحی"</string>
+ <string name="permlab_reboot" product="default" msgid="2898560872462638242">"اجبار برنامه برای راهاندازی مجدد"</string>
+ <string name="permdesc_reboot" product="tablet" msgid="8172056180063700741">"به برنامه اجازه میدهد تا سبب راهاندازی مجدد رایانهٔ لوحی شود."</string>
+ <string name="permdesc_reboot" product="default" msgid="5326008124289989969">"به برنامه اجازه میدهد تا سبب راهاندازی مجدد گوشی شود."</string>
<string name="permlab_mount_unmount_filesystems" product="nosdcard" msgid="2927361537942591841">"دسترسی به سیستم فایل حافظهٔ USB"</string>
<string name="permlab_mount_unmount_filesystems" product="default" msgid="4402305049890953810">"دسترسی به سیستم فایل کارت SD"</string>
<string name="permdesc_mount_unmount_filesystems" msgid="1829290701658992347">"به برنامه اجازه میدهد تا فایلهای سیستمی در حافظه جداشدنی نصب شود یا نصب آن لغو شود."</string>
@@ -427,14 +427,14 @@
<string name="permdesc_manageUsb" msgid="7776155430218239833">"به برنامه اجازه میدهد تا تنظیمات برگزیده و مجوزهای دستگاههای USB را مدیریت کند."</string>
<string name="permlab_accessMtp" msgid="4953468676795917042">"اعمال پروتکل MTP"</string>
<string name="permdesc_accessMtp" msgid="6532961200486791570">"دسترسی به درایور کرنل MTP جهت اعمال پروتکل MTP USB را اجازه میدهد."</string>
- <string name="permlab_hardware_test" msgid="4148290860400659146">"تست سخت افزار"</string>
+ <string name="permlab_hardware_test" msgid="4148290860400659146">"تست سختافزار"</string>
<string name="permdesc_hardware_test" msgid="6597964191208016605">"به برنامه اجازه میدهد به منظور تست سختافزار، قسمتهای جانبی مختلف را کنترل کنند."</string>
<string name="permlab_callPhone" msgid="3925836347681847954">"تماس مستقیم با شماره تلفنها"</string>
<string name="permdesc_callPhone" msgid="3740797576113760827">"به برنامه اجازه میدهد بدون دخالت شما با شمارههای تلفن تماس بگیرد. این ممکن است باعث ایجاد هزینه یا تماسهای پیشبینی نشده شود. توجه داشته باشید که این به برنامه اجازه نمیدهد به برقراری تماسهای اضطراری بپردازد. برنامههای مخرب ممکن است با برقراری تماس بدون تأیید شما هزینههایی را برای شما ایجاد کنند."</string>
<string name="permlab_callPrivileged" msgid="4198349211108497879">"تماس مستقیم با هر شماره تلفنی"</string>
<string name="permdesc_callPrivileged" msgid="1689024901509996810">"به برنامه اجازه میدهد تا بدون دخالت با هر شماره تلفنی تماس بگیرد، از جمله شمارههای اضطراری. برنامههای مخرب میتوانند تماسهای غیرضروری و غیر قانونی با خدمات اضطراری بگیرند."</string>
- <string name="permlab_performCdmaProvisioning" product="tablet" msgid="4842576994144604821">"راه اندازی مستقیم تنظیم رایانه لوحی CDMA"</string>
- <string name="permlab_performCdmaProvisioning" product="default" msgid="5604848095315421425">"شروع مستقیم راه اندازی تلفن CDMA"</string>
+ <string name="permlab_performCdmaProvisioning" product="tablet" msgid="4842576994144604821">"راهاندازی مستقیم تنظیم رایانهٔ لوحی CDMA"</string>
+ <string name="permlab_performCdmaProvisioning" product="default" msgid="5604848095315421425">"شروع مستقیم راهاندازی تلفن CDMA"</string>
<string name="permdesc_performCdmaProvisioning" msgid="1994193538802314186">"به برنامه اجازه میدهد تا شرایط مقررات CDMA را شروع کند. برنامههای مخرب میتوانند شرایط مقررات CDMA را در مواقع غیرضروری شروع کند."</string>
<string name="permlab_locationUpdates" msgid="7785408253364335740">"کنترل اعلانهای بهروزرسانی مکان"</string>
<string name="permdesc_locationUpdates" msgid="1120741557891438876">"به برنامه اجازه میدهد اعلانهای بهروزرسانی موقعیت مکانی را از رادیو فعال/غیرفعال کند. برای استفاده برنامههای عادی نیست."</string>
@@ -446,17 +446,17 @@
<string name="permdesc_modifyPhoneState" msgid="1029877529007686732">"به برنامه اجازه میدهد ویژگیهای دستگاه را کنترل کند. برنامهای که این مجوز را دارد میتواند بدون اطلاع شما تعویض شبکه داشته باشد، رادیوی تلفن را روشن یا خاموش کند و کارهایی از این قبیل را انجام دهد."</string>
<string name="permlab_readPhoneState" msgid="9178228524507610486">"خواندن وضعیت تلفن و شناسه"</string>
<string name="permdesc_readPhoneState" msgid="1639212771826125528">"به برنامه اجازه میدهد به ویژگیهای تلفن دستگاه شما دسترسی پیدا کند. این مجوز به برنامه اجازه میدهد شماره تلفن و شناسههای دستگاه، فعال بودن یک تماس و شماره راه دوری که با یک تماس متصل شده است را مشخص کند."</string>
- <string name="permlab_wakeLock" product="tablet" msgid="1531731435011495015">"ممانعت از به خواب رفتن رایانه لوحی"</string>
+ <string name="permlab_wakeLock" product="tablet" msgid="1531731435011495015">"ممانعت از به خواب رفتن رایانهٔ لوحی"</string>
<string name="permlab_wakeLock" product="default" msgid="573480187941496130">"ممانعت از به خواب رفتن تلفن"</string>
- <string name="permdesc_wakeLock" product="tablet" msgid="7311319824400447868">"به برنامه اجازه میدهد تا از غیرفعال شدن رایانه لوحی جلوگیری کند."</string>
+ <string name="permdesc_wakeLock" product="tablet" msgid="7311319824400447868">"به برنامه اجازه میدهد تا از غیرفعال شدن رایانهٔ لوحی جلوگیری کند."</string>
<string name="permdesc_wakeLock" product="default" msgid="8559100677372928754">"به برنامه اجازه میدهد تا از غیرفعال شدن تلفن جلوگیری کند."</string>
- <string name="permlab_devicePower" product="tablet" msgid="2787034722616350417">"روشن/خاموش کردن رایانه لوحی"</string>
+ <string name="permlab_devicePower" product="tablet" msgid="2787034722616350417">"روشن/خاموش کردن رایانهٔ لوحی"</string>
<string name="permlab_devicePower" product="default" msgid="4928622470980943206">"روشن/خاموش کردن تلفن"</string>
- <string name="permdesc_devicePower" product="tablet" msgid="6689862878984631831">"به برنامه اجازه میدهد رایانه لوحی را روشن یا خاموش کند."</string>
+ <string name="permdesc_devicePower" product="tablet" msgid="6689862878984631831">"به برنامه اجازه میدهد رایانهٔ لوحی را روشن یا خاموش کند."</string>
<string name="permdesc_devicePower" product="default" msgid="6037057348463131032">"به برنامه اجازه میدهد گوشی را روشن یا خاموش کند."</string>
<string name="permlab_factoryTest" msgid="3715225492696416187">"اجرا در حالت تست کارخانه"</string>
- <string name="permdesc_factoryTest" product="tablet" msgid="3952059318359653091">"اجرا به عنوان تست سازنده سطح پایین، امکان دسترسی کامل به سخت افزار رایانه لوحی شما را فراهم میآورد. فقط زمانی که رایانه لوحی در حالت تست سازنده در حال اجراست قابل دسترسی است."</string>
- <string name="permdesc_factoryTest" product="default" msgid="8136644990319244802">"اجرا به عنوان تست سازنده سطح پایین، امکان دسترسی کامل به سخت افزار تلفن شما را فراهم میآورد. فقط زمانی که تلفن در حالت تست سازنده در حال اجراست قابل دسترسی است."</string>
+ <string name="permdesc_factoryTest" product="tablet" msgid="3952059318359653091">"اجرا به عنوان تست سازنده سطح پایین، امکان دسترسی کامل به سختافزار رایانهٔ لوحی شما را فراهم میآورد. فقط زمانی که رایانهٔ لوحی در حالت تست سازنده در حال اجراست قابل دسترسی است."</string>
+ <string name="permdesc_factoryTest" product="default" msgid="8136644990319244802">"اجرا به عنوان تست سازنده سطح پایین، امکان دسترسی کامل به سختافزار تلفن شما را فراهم میآورد. فقط زمانی که تلفن در حالت تست سازنده در حال اجراست قابل دسترسی است."</string>
<string name="permlab_setWallpaper" msgid="6627192333373465143">"تنظیم تصویر زمینه"</string>
<string name="permdesc_setWallpaper" msgid="7373447920977624745">"به برنامه اجازه میدهد تا تصویر زمینه سیستم را تنظیم کند."</string>
<string name="permlab_setWallpaperHints" msgid="3278608165977736538">"تنظیم اندازه تصویر زمینه"</string>
@@ -464,15 +464,15 @@
<string name="permlab_masterClear" msgid="2315750423139697397">"بازنشانی سیستم به موارد پیشفرض کارخانه"</string>
<string name="permdesc_masterClear" msgid="3665380492633910226">"به برنامه اجازه میدهد تا بطور کامل سیستم را روی تنظیمات کارخانه بازنشانی کند، همه دادهها، پیکربندی و برنامههای نصب شده را پاک کند."</string>
<string name="permlab_setTime" msgid="2021614829591775646">"تنظیم ساعت"</string>
- <string name="permdesc_setTime" product="tablet" msgid="1896341438151152881">"به برنامه اجازه میدهد تا زمان ساعت رایانه لوحی را تغییر دهد."</string>
+ <string name="permdesc_setTime" product="tablet" msgid="1896341438151152881">"به برنامه اجازه میدهد تا زمان ساعت رایانهٔ لوحی را تغییر دهد."</string>
<string name="permdesc_setTime" product="default" msgid="1855702730738020">"به برنامه اجازه میدهد تا زمان ساعت تلفن را تغییر دهد."</string>
<string name="permlab_setTimeZone" msgid="2945079801013077340">"تنظیم منطقهٔ زمانی"</string>
- <string name="permdesc_setTimeZone" product="tablet" msgid="1676983712315827645">"به برنامه اجازه میدهد تا منطقهٔ زمانی رایانه لوحی را تغییر دهد."</string>
+ <string name="permdesc_setTimeZone" product="tablet" msgid="1676983712315827645">"به برنامه اجازه میدهد تا منطقهٔ زمانی رایانهٔ لوحی را تغییر دهد."</string>
<string name="permdesc_setTimeZone" product="default" msgid="4499943488436633398">"به برنامه اجازه میدهد تا منطقهٔ زمانی تلفن را تغییر دهد."</string>
<string name="permlab_accountManagerService" msgid="4829262349691386986">"عملکرد به عنوان AccountManagerService"</string>
<string name="permdesc_accountManagerService" msgid="1948455552333615954">"به برنامه اجازه میدهد با AccountAuthenticators تماس برقرار کند."</string>
<string name="permlab_getAccounts" msgid="1086795467760122114">"یافتن حسابها در دستگاه"</string>
- <string name="permdesc_getAccounts" product="tablet" msgid="2741496534769660027">"به برنامه اجازه میدهد به لیست حسابهای شناخته شده توسط رایانه لوحی دسترسی پیدا کند. این ممکن است حسابهای ایجاد شده توسط برنامههایی را که نصب کردهاید، شامل شود."</string>
+ <string name="permdesc_getAccounts" product="tablet" msgid="2741496534769660027">"به برنامه اجازه میدهد به لیست حسابهای شناخته شده توسط رایانهٔ لوحی دسترسی پیدا کند. این ممکن است حسابهای ایجاد شده توسط برنامههایی را که نصب کردهاید، شامل شود."</string>
<string name="permdesc_getAccounts" product="default" msgid="3448316822451807382">"به برنامه اجازه میدهد به لیست حسابهای شناخته شده توسط تلفن دسترسی پیدا کند. این ممکن است حسابهای ایجاد شده توسط برنامههایی را که نصب کردهاید، شامل شود."</string>
<string name="permlab_authenticateAccounts" msgid="5265908481172736933">"ایجاد حسابها و تنظیم گذرواژهها"</string>
<string name="permdesc_authenticateAccounts" msgid="5472124296908977260">"به برنامه اجازه میدهد از امکانات تأیید کننده اعتبار حساب AccountManager از جمله ایجاد حساب و دریافت و تنظیم گذرواژهها استفاده کند."</string>
@@ -497,18 +497,18 @@
<string name="permlab_changeWifiState" msgid="6550641188749128035">"اتصال به Wi-Fi و قطع اتصال از آن"</string>
<string name="permdesc_changeWifiState" msgid="7137950297386127533">"به برنامه اجازه میدهد تا به نقاط دسترسی Wi-Fi وصل شود و ارتباط خود را با آنها قطع کند و تغییراتی را در پیکربندی دستگاه برای شبکههای Wi-Fi ایجاد کند."</string>
<string name="permlab_changeWifiMulticastState" msgid="1368253871483254784">"دریافت چندگانه Wi-Fi را مجاز میکند"</string>
- <string name="permdesc_changeWifiMulticastState" product="tablet" msgid="7969774021256336548">"به برنامه اجازه میدهد به دریافت بستههای ارسالی به همه دستگاههای موجود در شبکه Wi-Fi با استفاده از آدرسهای پخش چندگانه و نه فقط به رایانه لوحی شما بپردازند. این از توان مصرف بیشتری نسبت به حالت پخش غیرچندگانه استفاده میکند."</string>
+ <string name="permdesc_changeWifiMulticastState" product="tablet" msgid="7969774021256336548">"به برنامه اجازه میدهد به دریافت بستههای ارسالی به همه دستگاههای موجود در شبکه Wi-Fi با استفاده از آدرسهای پخش چندگانه و نه فقط به رایانهٔ لوحی شما بپردازند. این از توان مصرف بیشتری نسبت به حالت پخش غیرچندگانه استفاده میکند."</string>
<string name="permdesc_changeWifiMulticastState" product="default" msgid="6851949706025349926">"به برنامه اجازه میدهد به دریافت بستههای ارسالی به همه دستگاههای موجود در شبکه Wi-Fi با استفاده از آدرسهای پخش چندگانه و نه فقط به تلفن شما بپردازند. این از توان مصرف بیشتری نسبت به حالت پخش غیرچندگانه استفاده میکند."</string>
<string name="permlab_bluetoothAdmin" msgid="6006967373935926659">"دسترسی به تنظیمات بلوتوث"</string>
- <string name="permdesc_bluetoothAdmin" product="tablet" msgid="6921177471748882137">"به برنامه اجازه میدهد تا رایانه لوحی بلوتوث محلی را پیکربندی کرده، دستگاههای راه دور را شناسایی کرده و با آنها جفت شود."</string>
+ <string name="permdesc_bluetoothAdmin" product="tablet" msgid="6921177471748882137">"به برنامه اجازه میدهد تا رایانهٔ لوحی بلوتوث محلی را پیکربندی کرده، دستگاههای راه دور را شناسایی کرده و با آنها جفت شود."</string>
<string name="permdesc_bluetoothAdmin" product="default" msgid="8931682159331542137">"به برنامه اجازه میدهد تا تلفن بلوتوث محلی را پیکربندی کند و دستگاههای راه دور را پیدا کند و با آنها جفت شود."</string>
<string name="permlab_accessWimaxState" msgid="7436749103151096452">"مشاهدهٔ اتصالات وایمکس"</string>
<string name="permdesc_accessWimaxState" msgid="6360102877261978887">"به برنامه امکان میدهد فعال بودن وایمکس و اطلاعات مربوط به هر یک از شبکههای وایمکس متصل را مشخص کند."</string>
<string name="permlab_changeWimaxState" msgid="2405042267131496579">"تغییر وضعیت WiMAX"</string>
- <string name="permdesc_changeWimaxState" product="tablet" msgid="3156456504084201805">"به برنامه امکان میدهد رایانه لوحی را به شبکههای وایمکس متصل کرده یا اتصال آن را از این شبکهها قطع کند."</string>
+ <string name="permdesc_changeWimaxState" product="tablet" msgid="3156456504084201805">"به برنامه امکان میدهد رایانهٔ لوحی را به شبکههای وایمکس متصل کرده یا اتصال آن را از این شبکهها قطع کند."</string>
<string name="permdesc_changeWimaxState" product="default" msgid="697025043004923798">"به برنامه امکان میدهد تا تلفن را به شبکههای وایمکس متصل کرده یا اتصال آنرا از این شبکهها قطع کند."</string>
<string name="permlab_bluetooth" msgid="6127769336339276828">"مرتبط سازی با دستگاههای بلوتوث"</string>
- <string name="permdesc_bluetooth" product="tablet" msgid="3480722181852438628">"به برنامه اجازه میدهد تا پیکربندی بلوتوث در رایانه لوحی را مشاهده کند و اتصال با دستگاههای مرتبط را برقرار کرده و بپذیرد."</string>
+ <string name="permdesc_bluetooth" product="tablet" msgid="3480722181852438628">"به برنامه اجازه میدهد تا پیکربندی بلوتوث در رایانهٔ لوحی را مشاهده کند و اتصال با دستگاههای مرتبط را برقرار کرده و بپذیرد."</string>
<string name="permdesc_bluetooth" product="default" msgid="3207106324452312739">"به برنامه اجازه میدهد تا پیکربندی بلوتوث در تلفن را مشاهده کند، و اتصالات دستگاههای مرتبط را برقرار کرده و بپذیرد."</string>
<string name="permlab_nfc" msgid="4423351274757876953">"کنترل ارتباط راه نزدیک"</string>
<string name="permdesc_nfc" msgid="7120611819401789907">"به برنامه اجازه میدهد تا با تگهای ارتباط میدان نزدیک (NFC)، کارتها و فایل خوان ارتباط برقرار کند."</string>
@@ -538,8 +538,8 @@
<string name="permdesc_sdcardWrite" product="default" msgid="4337417790936632090">"به برنامه اجازه میدهد تا در کارت SD بنویسد."</string>
<string name="permlab_mediaStorageWrite" product="default" msgid="6859839199706879015">"تغییر/حذف محتواهای حافظه رسانه داخلی"</string>
<string name="permdesc_mediaStorageWrite" product="default" msgid="8189160597698529185">"به برنامه اجازه میدهد تا محتویات حافظه رسانه داخلی را تغییر دهد."</string>
- <string name="permlab_cache_filesystem" msgid="5656487264819669824">"دسترسی به سیستم فایل حافظه پنهان"</string>
- <string name="permdesc_cache_filesystem" msgid="5578967642265550955">"به برنامه اجازه میدهد تا سیستم فایل حافظه پنهان را بخواند و بنویسد."</string>
+ <string name="permlab_cache_filesystem" msgid="5656487264819669824">"دسترسی به سیستم فایل حافظهٔ پنهان"</string>
+ <string name="permdesc_cache_filesystem" msgid="5578967642265550955">"به برنامه اجازه میدهد تا سیستم فایل حافظهٔ پنهان را بخواند و بنویسد."</string>
<string name="permlab_use_sip" msgid="5986952362795870502">"علامتگذاری/دریافت تماسهای اینترنتی"</string>
<string name="permdesc_use_sip" msgid="4717632000062674294">"به برنامه اجازه میدهد تا از خدمات SIP استفاده کند و تماسهای اینترنتی بگیرد/دریافت کند."</string>
<string name="permlab_readNetworkUsageHistory" msgid="7862593283611493232">"خواندن سابقه استفاده از شبکه"</string>
@@ -551,19 +551,19 @@
<string name="policylab_limitPassword" msgid="4497420728857585791">"تنظیم قوانین رمز ورود"</string>
<string name="policydesc_limitPassword" msgid="3252114203919510394">"طول و نویسههای مجاز در گذرواژههای بازکردن قفل صفحه را کنترل کنید."</string>
<string name="policylab_watchLogin" msgid="914130646942199503">"نمایش تلاشهای قفل گشایی صفحه"</string>
- <string name="policydesc_watchLogin" product="tablet" msgid="3215729294215070072">"تعداد گذرواژههای اشتباه تایپ شده را هنگام بازکردن قفل صفحه کنترل میکند، و یا اگر دفعات زیادی گذرواژه اشتباه تایپ شود رایانه لوحی را قفل میکند و همه دادههای رایانه لوحی را پاک میکند."</string>
+ <string name="policydesc_watchLogin" product="tablet" msgid="3215729294215070072">"تعداد گذرواژههای اشتباه تایپ شده را هنگام بازکردن قفل صفحه کنترل میکند، و یا اگر دفعات زیادی گذرواژه اشتباه تایپ شود رایانهٔ لوحی را قفل میکند و همه دادههای رایانهٔ لوحی را پاک میکند."</string>
<string name="policydesc_watchLogin" product="default" msgid="5712323091846761073">"تعداد گذرواژههای نادرست تایپ شده را کنترل میکند. هنگام بازکردن قفل صفحه اگر دفعات زیادی گذرواژه نادرست تایپ کردهاید، تلفن را قفل کنید یا همه دادههای تلفن را پاک کنید."</string>
<string name="policylab_resetPassword" msgid="2620077191242688955">"تغییر رمز ورود قفل گشایی صفحه"</string>
<string name="policydesc_resetPassword" msgid="605963962301904458">"گذرواژه بازگشایی قفل صفحه را تغییر دهید."</string>
<string name="policylab_forceLock" msgid="2274085384704248431">"قفل کردن صفحه"</string>
<string name="policydesc_forceLock" msgid="1141797588403827138">"نحوه و زمان قفل شدن صفحه را کنترل کنید."</string>
<string name="policylab_wipeData" msgid="3910545446758639713">"پاک کردن تمام دادهها"</string>
- <string name="policydesc_wipeData" product="tablet" msgid="4306184096067756876">"با انجام بازنشانی به دادههای کارخانه، دادههای رایانه لوحی بدون هشدار پاک میشود."</string>
+ <string name="policydesc_wipeData" product="tablet" msgid="4306184096067756876">"با انجام بازنشانی به دادههای کارخانه، دادههای رایانهٔ لوحی بدون هشدار پاک میشود."</string>
<string name="policydesc_wipeData" product="default" msgid="5096895604574188391">"با انجام بازنشانی به دادههای کارخانه، دادههای تلفن بدون هشدار پاک میشود."</string>
<string name="policylab_setGlobalProxy" msgid="2784828293747791446">"تنظیم پروکسی جهانی دستگاه"</string>
<string name="policydesc_setGlobalProxy" msgid="6387497466660154931">"پروکسی جهانی دستگاه مورد نظر را جهت استفاده هنگام فعال بودن خط مشی تنظیم کنید. فقط اولین سرپرست دستگاه پروکسی جهانی مفید را تنظیم میکند."</string>
<string name="policylab_expirePassword" msgid="885279151847254056">"تنظیم زمان انقضای رمز ورود قفل صفحه"</string>
- <string name="policydesc_expirePassword" msgid="1729725226314691591">"کنترل کنید چند وقت یکبار باید گذرواژه صفحه قفل عوض شود."</string>
+ <string name="policydesc_expirePassword" msgid="1729725226314691591">"کنترل کنید چند وقت یک بار باید گذرواژه صفحه قفل عوض شود."</string>
<string name="policylab_encryptedStorage" msgid="8901326199909132915">"تنظیم رمزگذاری حافظه"</string>
<string name="policydesc_encryptedStorage" msgid="2637732115325316992">"باید اطلاعات ذخیره شده برنامه رمزگذاری شود."</string>
<string name="policylab_disableCamera" msgid="6395301023152297826">"غیر فعال کردن دوربین ها"</string>
@@ -707,7 +707,7 @@
<string name="lockscreen_battery_short" msgid="4477264849386850266">"<xliff:g id="NUMBER">%d</xliff:g><xliff:g id="PERCENT">%%</xliff:g>"</string>
<string name="lockscreen_low_battery" msgid="1482873981919249740">"شارژر خود را متصل کنید."</string>
<string name="lockscreen_missing_sim_message_short" msgid="7381499217732227295">"سیم کارت موجود نیست."</string>
- <string name="lockscreen_missing_sim_message" product="tablet" msgid="151659196095791474">"سیم کارت درون رایانه لوحی نیست."</string>
+ <string name="lockscreen_missing_sim_message" product="tablet" msgid="151659196095791474">"سیم کارت درون رایانهٔ لوحی نیست."</string>
<string name="lockscreen_missing_sim_message" product="default" msgid="2186920585695169078">"سیم کارت درون تلفن نیست."</string>
<string name="lockscreen_missing_sim_instructions" msgid="5372787138023272615">"سیم کارت را وارد کنید."</string>
<string name="lockscreen_missing_sim_instructions_long" msgid="3526573099019319472">"سیم کارت موجود نیست یا قابل خواندن نیست. یک سیم کارت وارد کنید."</string>
@@ -725,13 +725,13 @@
<string name="lockscreen_sim_locked_message" msgid="8066660129206001039">"سیم کارت قفل شد."</string>
<string name="lockscreen_sim_unlock_progress_dialog_message" msgid="595323214052881264">"بازگشایی قفل سیم کارت..."</string>
<string name="lockscreen_too_many_failed_attempts_dialog_message" msgid="6481623830344107222">"الگوی بازگشایی قفل خود را <xliff:g id="NUMBER_0">%d</xliff:g> بار اشتباه کشیدهاید. "\n\n"لطفاً پس از <xliff:g id="NUMBER_1">%d</xliff:g> ثانیه دوباره امتحان کنید."</string>
- <string name="lockscreen_too_many_failed_password_attempts_dialog_message" msgid="2725973286239344555">"گذرواژه خود را <xliff:g id="NUMBER_0">%d</xliff:g> بار اشتباه تایپ کردهاید. "\n\n"پس از <xliff:g id="NUMBER_1">%d</xliff:g> ثانیه دوباره امتحان کنید."</string>
+ <string name="lockscreen_too_many_failed_password_attempts_dialog_message" msgid="2725973286239344555">"گذرواژهٔ خود را <xliff:g id="NUMBER_0">%d</xliff:g> بار اشتباه تایپ کردهاید. "\n\n"پس از <xliff:g id="NUMBER_1">%d</xliff:g> ثانیه دوباره امتحان کنید."</string>
<string name="lockscreen_too_many_failed_pin_attempts_dialog_message" msgid="6216672706545696955">"پین را<xliff:g id="NUMBER_0">%d</xliff:g> بار اشتباه تایپ کردهاید. "\n\n"پس از <xliff:g id="NUMBER_1">%d</xliff:g> ثانیه دوباره امتحان کنید."</string>
- <string name="lockscreen_failed_attempts_almost_glogin" product="tablet" msgid="9191611984625460820">"شما الگوی بازگشایی قفل خود را <xliff:g id="NUMBER_0">%d</xliff:g> بار اشتباه کشیدهاید. بعد از <xliff:g id="NUMBER_1">%d</xliff:g> تلاش ناموفق، از شما خواسته میشود که برای بازگشایی قفل رایانه لوحی خود به Google وارد شوید."\n\n" لطفاً پس از <xliff:g id="NUMBER_2">%d</xliff:g> ثانیه دوباره امتحان کنید."</string>
- <string name="lockscreen_failed_attempts_almost_glogin" product="default" msgid="2590227559763762751">"شما الگوی بازگشایی قفل خود را <xliff:g id="NUMBER_0">%d</xliff:g> بار اشتباه کشیده اید. پس از <xliff:g id="NUMBER_1">%d</xliff:g> تلاش ناموفق دیگر از شما خواسته میشود که برای بازگشایی قفل گوشی خود به برنامه Google وارد شوید."\n\n" لطفاً پس از <xliff:g id="NUMBER_2">%d</xliff:g> ثانیه دوباره امتحان کنید."</string>
- <string name="lockscreen_failed_attempts_almost_at_wipe" product="tablet" msgid="6128106399745755604">"شما به اشتباه <xliff:g id="NUMBER_0">%d</xliff:g> بار اقدام به باز کردن قفل رایانه لوحی کردهاید. پس از <xliff:g id="NUMBER_1">%d</xliff:g> تلاش ناموفق دیگر، رایانه لوحی به پیشفرض کارخانه بازنشانی میشود و تمام دادههای کاربر از دست خواهد رفت."</string>
+ <string name="lockscreen_failed_attempts_almost_glogin" product="tablet" msgid="9191611984625460820">"شما الگوی بازگشایی قفل خود را <xliff:g id="NUMBER_0">%d</xliff:g> بار اشتباه کشیدهاید. بعد از <xliff:g id="NUMBER_1">%d</xliff:g> تلاش ناموفق، از شما خواسته میشود که برای بازگشایی قفل رایانهٔ لوحی خود به Google وارد شوید."\n\n" لطفاً پس از <xliff:g id="NUMBER_2">%d</xliff:g> ثانیه دوباره امتحان کنید."</string>
+ <string name="lockscreen_failed_attempts_almost_glogin" product="default" msgid="2590227559763762751">"شما الگوی بازگشایی قفل خود را <xliff:g id="NUMBER_0">%d</xliff:g> بار اشتباه کشیدهاید. پس از <xliff:g id="NUMBER_1">%d</xliff:g> تلاش ناموفق دیگر از شما خواسته میشود که برای بازگشایی قفل گوشی خود به برنامهٔ Google وارد شوید."\n\n" لطفاً پس از <xliff:g id="NUMBER_2">%d</xliff:g> ثانیه دوباره امتحان کنید."</string>
+ <string name="lockscreen_failed_attempts_almost_at_wipe" product="tablet" msgid="6128106399745755604">"شما به اشتباه <xliff:g id="NUMBER_0">%d</xliff:g> بار اقدام به باز کردن قفل رایانهٔ لوحی کردهاید. پس از <xliff:g id="NUMBER_1">%d</xliff:g> تلاش ناموفق دیگر، رایانهٔ لوحی به پیشفرض کارخانه بازنشانی میشود و تمام دادههای کاربر از دست خواهد رفت."</string>
<string name="lockscreen_failed_attempts_almost_at_wipe" product="default" msgid="8603565142156826565">"شما به اشتباه <xliff:g id="NUMBER_0">%d</xliff:g> بار اقدام به باز کردن قفل تلفن کردهاید. پس از<xliff:g id="NUMBER_1">%d</xliff:g> تلاش ناموفق دیگر، تلفن به پیشفرض کارخانه بازنشانی میشود و تمام دادههای کاربر از دست خواهد رفت."</string>
- <string name="lockscreen_failed_attempts_now_wiping" product="tablet" msgid="280873516493934365">"شما به اشتباه اقدام به باز کردن قفل <xliff:g id="NUMBER">%d</xliff:g> رایانه لوحی کردهاید. رایانه لوحی در حال حاضر به پیشفرض کارخانه بازنشانی میشود."</string>
+ <string name="lockscreen_failed_attempts_now_wiping" product="tablet" msgid="280873516493934365">"شما به اشتباه اقدام به باز کردن قفل <xliff:g id="NUMBER">%d</xliff:g> رایانهٔ لوحی کردهاید. رایانهٔ لوحی در حال حاضر به پیشفرض کارخانه بازنشانی میشود."</string>
<string name="lockscreen_failed_attempts_now_wiping" product="default" msgid="3025504721764922246">"شما به اشتباه <xliff:g id="NUMBER">%d</xliff:g> بار اقدام به باز کردن قفل تلفن کردهاید. این تلفن در حال حاضر به پیشفرض کارخانه بازنشانی میشود."</string>
<string name="lockscreen_too_many_failed_attempts_countdown" msgid="6251480343394389665">"در <xliff:g id="NUMBER">%d</xliff:g> ثانیه دوباره امتحان کنید."</string>
<string name="lockscreen_forgot_pattern_button_text" msgid="2626999449610695930">"الگو را فراموش کردهاید؟"</string>
@@ -742,7 +742,7 @@
<string name="lockscreen_glogin_password_hint" msgid="5958028383954738528">"رمز ورود"</string>
<string name="lockscreen_glogin_submit_button" msgid="7130893694795786300">"ورود به سیستم"</string>
<string name="lockscreen_glogin_invalid_input" msgid="1364051473347485908">"نام کاربر یا رمز ورود نامعتبر است."</string>
- <string name="lockscreen_glogin_account_recovery_hint" msgid="1696924763690379073">"نام کاربری یا گذرواژه خود را فراموش کردید؟"\n"از "<b>"google.com/accounts/recovery"</b>" بازدید کنید."</string>
+ <string name="lockscreen_glogin_account_recovery_hint" msgid="1696924763690379073">"نام کاربری یا گذرواژهٔ خود را فراموش کردید؟"\n"از "<b>"google.com/accounts/recovery"</b>" بازدید کنید."</string>
<string name="lockscreen_glogin_checking_password" msgid="7114627351286933867">"در حال بررسی..."</string>
<string name="lockscreen_unlock_label" msgid="737440483220667054">"بازگشایی قفل"</string>
<string name="lockscreen_sound_on_label" msgid="9068877576513425970">"صدا روشن"</string>
@@ -762,8 +762,8 @@
<string name="hour_cap_ampm" msgid="2083465992940444366">"<xliff:g id="HOUR">%-l</xliff:g><xliff:g id="AMPM">%p</xliff:g>"</string>
<string name="factorytest_failed" msgid="5410270329114212041">"تست کارخانه انجام نشد"</string>
<string name="factorytest_not_system" msgid="4435201656767276723">"عملکرد FACTORY_TEST تنها برای بستههای نصب شده در /system/app پشتیبانی میشود."</string>
- <string name="factorytest_no_action" msgid="872991874799998561">"بسته ای یافت نشد که عملکرد FACTORY_TEST را ارائه کند."</string>
- <string name="factorytest_reboot" msgid="6320168203050791643">"راه اندازی مجدد"</string>
+ <string name="factorytest_no_action" msgid="872991874799998561">"بستهای یافت نشد که عملکرد FACTORY_TEST را ارائه کند."</string>
+ <string name="factorytest_reboot" msgid="6320168203050791643">"راهاندازی مجدد"</string>
<string name="js_dialog_title" msgid="1987483977834603872">"صفحه در \"<xliff:g id="TITLE">%s</xliff:g>\" میگوید:"</string>
<string name="js_dialog_title_default" msgid="6961903213729667573">"جاوا اسکریپت"</string>
<string name="js_dialog_before_unload" msgid="730366588032430474">"از این صفحه خارج میشوید؟"\n\n"<xliff:g id="MESSAGE">%s</xliff:g>"\n\n"برای ادامه روی تأیید و برای ماندن در همین صفحه روی لغو کلیک کنید."</string>
@@ -790,7 +790,7 @@
<string name="permlab_readHistoryBookmarks" msgid="3775265775405106983">"خواندن سابقه و نشانکهای وب شما"</string>
<string name="permdesc_readHistoryBookmarks" msgid="8462378226600439658">"به برنامه اجازه میدهد سابقه نشانیهای اینترنتی را که مرورگر بازدید کرده است و همه نشانکهای مرورگر را بخواند. توجه: این مجوز توسط مرورگرهای شخص ثالث یا سایر برنامههای دارای قابلیت مرور وب قابل اجرا نیست."</string>
<string name="permlab_writeHistoryBookmarks" msgid="3714785165273314490">"نوشتن نشانکهای وب و سابقه"</string>
- <string name="permdesc_writeHistoryBookmarks" product="tablet" msgid="6825527469145760922">"به برنامه اجازه میدهد سابقه مرورگر یا نشانکهای ذخیره شده در رایانه لوحی شما را اصلاح کند. این ویژگی ممکن است به برنامه اجازه دهد دادههای مرورگر را حذف یا اصلاح کند. توجه: این مجوز ممکن است توسط مرورگرهای شخص ثالث یا سایر برنامههای دارای قابلیت مرور وب قابل اجرا نباشد."</string>
+ <string name="permdesc_writeHistoryBookmarks" product="tablet" msgid="6825527469145760922">"به برنامه اجازه میدهد سابقه مرورگر یا نشانکهای ذخیره شده در رایانهٔ لوحی شما را اصلاح کند. این ویژگی ممکن است به برنامه اجازه دهد دادههای مرورگر را حذف یا اصلاح کند. توجه: این مجوز ممکن است توسط مرورگرهای شخص ثالث یا سایر برنامههای دارای قابلیت مرور وب قابل اجرا نباشد."</string>
<string name="permdesc_writeHistoryBookmarks" product="default" msgid="8497389531014185509">"به برنامه اجازه میدهد سابقه مرورگر یا نشانکهای ذخیره شده در تلفن شما را اصلاح کند. این ویژگی ممکن است به برنامه اجازه دهد دادههای مرورگر را حذف یا اصلاح کند. توجه: این مجوز ممکن است توسط مرورگرهای شخص ثالث یا سایر برنامههای دارای قابلیت مرور وب قابل اجرا نباشد."</string>
<string name="permlab_setAlarm" msgid="1379294556362091814">"تنظیم یک هشدار"</string>
<string name="permdesc_setAlarm" msgid="316392039157473848">"به برنامه اجازه میدهد تا هشداری را در برنامه ساعت زنگدار نصب شده تنظیم کند. برخی از برنامههای ساعت زنگدار نمیتوانند این ویژگی را اعمال کنند."</string>
@@ -826,7 +826,7 @@
<string name="searchview_description_submit" msgid="2688450133297983542">"ارسال عبارت جستجو"</string>
<string name="searchview_description_voice" msgid="2453203695674994440">"جستجوی صوتی"</string>
<string name="enable_explore_by_touch_warning_title" msgid="7460694070309730149">"فعال کردن «کاوش با لمس»؟"</string>
- <string name="enable_explore_by_touch_warning_message" product="tablet" msgid="8655887539089910577">"<xliff:g id="ACCESSIBILITY_SERVICE_NAME">%1$s</xliff:g> میخواهد «کاوش با لمس» را فعال کند. وقتی «کاوش با لمس» فعال است، میتوانید توضیحاتی را برای آنچه که زیر انگشت شما است مشاهده کرده یا بشنوید یا برای استفاده از رایانه لوحی از حرکات اشاره استفاده کنید."</string>
+ <string name="enable_explore_by_touch_warning_message" product="tablet" msgid="8655887539089910577">"<xliff:g id="ACCESSIBILITY_SERVICE_NAME">%1$s</xliff:g> میخواهد «کاوش با لمس» را فعال کند. وقتی «کاوش با لمس» فعال است، میتوانید توضیحاتی را برای آنچه که زیر انگشت شما است مشاهده کرده یا بشنوید یا برای استفاده از رایانهٔ لوحی از حرکات اشاره استفاده کنید."</string>
<string name="enable_explore_by_touch_warning_message" product="default" msgid="2708199672852373195">"<xliff:g id="ACCESSIBILITY_SERVICE_NAME">%1$s</xliff:g> میخواهد «کاوش با لمس» را فعال کند. وقتی «کاوش با لمس» فعال است، میتوانید توضیحاتی را برای آنچه که زیر انگشت شما است مشاهده کرده یا بشنوید یا برای استفاده از تلفن خود از حرکات اشاره استفاده کنید."</string>
<string name="oneMonthDurationPast" msgid="7396384508953779925">"۱ ماه قبل"</string>
<string name="beforeOneMonthDurationPast" msgid="909134546836499826">"قبل از ۱ ماه گذشته"</string>
@@ -968,7 +968,7 @@
<string name="webpage_unresponsive" msgid="3272758351138122503">"این صفحه پاسخ نمیدهد."\n\n"آیا میخواهید آن را ببندید؟"</string>
<string name="launch_warning_title" msgid="1547997780506713581">"برنامه مجدداً هدایت شد"</string>
<string name="launch_warning_replace" msgid="6202498949970281412">"<xliff:g id="APP_NAME">%1$s</xliff:g> اکنون در حال اجرا است."</string>
- <string name="launch_warning_original" msgid="188102023021668683">"<xliff:g id="APP_NAME">%1$s</xliff:g> از ابتدا راه اندازی شد."</string>
+ <string name="launch_warning_original" msgid="188102023021668683">"<xliff:g id="APP_NAME">%1$s</xliff:g> از ابتدا راهاندازی شد."</string>
<string name="screen_compat_mode_scale" msgid="3202955667675944499">"مقیاس"</string>
<string name="screen_compat_mode_show" msgid="4013878876486655892">"همیشه نشان داده شود"</string>
<string name="screen_compat_mode_hint" msgid="1064524084543304459">"در تنظیمات سیستم >برنامهها > مورد دانلود شده آن را دوباره فعال کنید."</string>
@@ -1062,17 +1062,17 @@
<string name="perms_description_app" msgid="5139836143293299417">"ارائه شده توسط <xliff:g id="APP_NAME">%1$s</xliff:g> ."</string>
<string name="usb_storage_activity_title" msgid="4465055157209648641">"حافظه انبوه USB"</string>
<string name="usb_storage_title" msgid="5901459041398751495">"USB متصل شد"</string>
- <string name="usb_storage_message" product="nosdcard" msgid="3308538094316477839">"شما از طریق USB به رایانه خود متصل شدهاید. اگر میخواهید فایلها را بین رایانه خود و حافظهٔ USB در Android کپی کنید، دکمه زیر را لمس کنید."</string>
- <string name="usb_storage_message" product="default" msgid="805351000446037811">"شما از طریق USB به رایانه خود متصل شدهاید. اگر میخواهید فایلها را بین رایانه خود و کارت SD در Android کپی کنید، دکمه زیر را لمس کنید."</string>
+ <string name="usb_storage_message" product="nosdcard" msgid="3308538094316477839">"شما از طریق USB به رایانهٔ خود متصل شدهاید. اگر میخواهید فایلها را بین رایانهٔ خود و حافظهٔ USB در Android کپی کنید، دکمه زیر را لمس کنید."</string>
+ <string name="usb_storage_message" product="default" msgid="805351000446037811">"شما از طریق USB به رایانهٔ خود متصل شدهاید. اگر میخواهید فایلها را بین رایانهٔ خود و کارت SD در Android کپی کنید، دکمه زیر را لمس کنید."</string>
<string name="usb_storage_button_mount" msgid="1052259930369508235">"روشن کردن دستگاه ذخیرهسازی USB"</string>
<string name="usb_storage_error_message" product="nosdcard" msgid="3017045217365540658">"هنگام استفاده از حافظهٔ USB برای حافظه انبوه USB مشکلی بوجود آمد."</string>
<string name="usb_storage_error_message" product="default" msgid="2876018512716970313">"هنگام استفاده از کارت SD برای حافظه ذخیره انبوه USB مشکلی بوجود آمد."</string>
<string name="usb_storage_notification_title" msgid="8175892554757216525">"USB متصل شد"</string>
- <string name="usb_storage_notification_message" msgid="939822783828183763">"برای کپی کردن فایلها از/به رایانه خود لمس کنید."</string>
+ <string name="usb_storage_notification_message" msgid="939822783828183763">"برای کپی کردن فایلها از/به رایانهٔ خود لمس کنید."</string>
<string name="usb_storage_stop_notification_title" msgid="2336058396663516017">"خاموش کردن دستگاه ذخیرهسازی USB"</string>
<string name="usb_storage_stop_notification_message" msgid="1656852098555623822">"برای غیرفعال کردن حافظهٔ USB، لمس کنید."</string>
<string name="usb_storage_stop_title" msgid="660129851708775853">"دستگاه ذخیرهسازی USB در حال استفاده است"</string>
- <string name="usb_storage_stop_message" product="nosdcard" msgid="4264025280777219521">"قبل از غیرفعال کردن حافظهٔ USB، حافظهٔ USB مربوط به Android را در رایانه خود لغو نصب کنید (\"خارج کنید\")."</string>
+ <string name="usb_storage_stop_message" product="nosdcard" msgid="4264025280777219521">"قبل از غیرفعال کردن حافظهٔ USB، حافظهٔ USB مربوط به Android را در رایانهٔ خود لغو نصب کنید (\"خارج کنید\")."</string>
<string name="usb_storage_stop_message" product="default" msgid="8043969782460613114">"قبل از غیرفعال کردن حافظهٔ USB، کارت SD مربوط به Android را در رایانه لغو نصب کنید (\"خارج کنید\")."</string>
<string name="usb_storage_stop_button_mount" msgid="7060218034900696029">"خاموش کردن دستگاه ذخیرهسازی USB"</string>
<string name="usb_storage_stop_error_message" msgid="1970374898263063836">"هنگام غیرفعال کردن حافظهٔ USB مشکلی بوجود آمد. بررسی کنید میزبان USB را لغو نصب کرده باشید، سپس دوباره امتحان کنید."</string>
@@ -1080,7 +1080,7 @@
<string name="dlg_confirm_kill_storage_users_text" msgid="5100428757107469454">"در صورت فعال کردن حافظهٔ USB، برخی از برنامههایی که از آنها استفاده میکنید متوقف میشوند و تا زمانی که حافظهٔ USB را غیرفعال نکنید امکان استفاده از آنها وجود نخواهد داشت."</string>
<string name="dlg_error_title" msgid="7323658469626514207">"راهاندازی USB ناموفق بود."</string>
<string name="dlg_ok" msgid="7376953167039865701">"تأیید"</string>
- <string name="usb_mtp_notification_title" msgid="3699913097391550394">"متصل شده به عنوان دستگاه رسانه ای"</string>
+ <string name="usb_mtp_notification_title" msgid="3699913097391550394">"متصل شده به عنوان دستگاه رسانهای"</string>
<string name="usb_ptp_notification_title" msgid="1960817192216064833">"متصل شده به عنوان دوربین"</string>
<string name="usb_cd_installer_notification_title" msgid="6774712827892090754">"متصل شده به عنوان نصب کننده"</string>
<string name="usb_accessory_notification_title" msgid="7848236974087653666">"به یک وسیله جانبی USB وصل شده است"</string>
@@ -1094,10 +1094,10 @@
<string name="adb_active_notification_message" msgid="1016654627626476142">"برای غیرفعال کردن اشکال زدایی USB لمس کنید."</string>
<string name="select_input_method" msgid="4653387336791222978">"انتخاب روش ورودی"</string>
<string name="configure_input_methods" msgid="9091652157722495116">"تنظیم روشهای ورودی"</string>
- <string name="use_physical_keyboard" msgid="6203112478095117625">"صفحه کلید فیزیکی"</string>
+ <string name="use_physical_keyboard" msgid="6203112478095117625">"صفحهکلید فیزیکی"</string>
<string name="hardware" msgid="7517821086888990278">"سختافزار"</string>
- <string name="select_keyboard_layout_notification_title" msgid="1407367017263030773">"انتخاب طرحبندی صفحه کلید"</string>
- <string name="select_keyboard_layout_notification_message" msgid="4465907700449257063">"برای انتخاب یک طرحبندی صفحه کلید لمس کنید…"</string>
+ <string name="select_keyboard_layout_notification_title" msgid="1407367017263030773">"انتخاب طرحبندی صفحهکلید"</string>
+ <string name="select_keyboard_layout_notification_message" msgid="4465907700449257063">"برای انتخاب یک طرحبندی صفحهکلید لمس کنید…"</string>
<string name="fast_scroll_alphabet" msgid="5433275485499039199">" ABCDEFGHIJKLMNOPQRSTUVWXYZ"</string>
<string name="fast_scroll_numeric_alphabet" msgid="4030170524595123610">" 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"</string>
<string name="candidates_style" msgid="4333913089637062257"><u>"داوطلبین"</u></string>
@@ -1112,8 +1112,8 @@
<string name="ext_media_unmountable_notification_title" product="default" msgid="6410723906019100189">"کارت SD آسیب دیده"</string>
<string name="ext_media_unmountable_notification_message" product="nosdcard" msgid="1795917578395333280">"حافظهٔ USB خراب است. سعی کنید آنرا دوباره فرمت کنید."</string>
<string name="ext_media_unmountable_notification_message" product="default" msgid="1753898567525568253">"کارت SD خراب است. سعی کنید آنرا دوباره فرمت کنید."</string>
- <string name="ext_media_badremoval_notification_title" product="nosdcard" msgid="1661683031330951073">"حافظهٔ USB به صورت غیر منتظره جدا شد"</string>
- <string name="ext_media_badremoval_notification_title" product="default" msgid="6872152882604407837">"کارت SD به صورت غیر منتظره ای جدا شد"</string>
+ <string name="ext_media_badremoval_notification_title" product="nosdcard" msgid="1661683031330951073">"حافظهٔ USB به صورت غیرمنتظره جدا شد"</string>
+ <string name="ext_media_badremoval_notification_title" product="default" msgid="6872152882604407837">"کارت SD به صورت غیرمنتظرهای جدا شد"</string>
<string name="ext_media_badremoval_notification_message" product="nosdcard" msgid="4329848819865594241">"اتصال حافظهٔ USB را قبل از بیرون آوردن قطع کنید تا سبب از بین رفتن دادهها نشود."</string>
<string name="ext_media_badremoval_notification_message" product="default" msgid="7260183293747448241">"کارت SD را قبل از بیرون آوردن جدا کنید تا سبب از بین رفتن دادهها نشود."</string>
<string name="ext_media_safe_unmount_notification_title" product="nosdcard" msgid="3967973893270360230">"حافظهٔ USB را میتوانید با ایمنی جدا کنید"</string>
@@ -1283,7 +1283,7 @@
<string name="fingerprints" msgid="4516019619850763049">"اثر انگشت:"</string>
<string name="sha256_fingerprint" msgid="4391271286477279263">"اثر انگشت SHA-256:"</string>
<string name="sha1_fingerprint" msgid="7930330235269404581">"اثر انگشت SHA-1"</string>
- <string name="activity_chooser_view_see_all" msgid="4292569383976636200">"مشاهده همه"</string>
+ <string name="activity_chooser_view_see_all" msgid="4292569383976636200">"مشاهدهٔ همه"</string>
<string name="activity_chooser_view_dialog_title_default" msgid="4710013864974040615">"انتخاب فعالیت"</string>
<string name="share_action_provider_share_with" msgid="5247684435979149216">"اشتراکگذاری با"</string>
<string name="status_bar_device_locked" msgid="3092703448690669768">"دستگاه قفل است."</string>
@@ -1293,7 +1293,7 @@
<string name="SetupCallDefault" msgid="5834948469253758575">"تماس را میپذیرید؟"</string>
<string name="activity_resolver_use_always" msgid="8017770747801494933">"همیشه"</string>
<string name="activity_resolver_use_once" msgid="2404644797149173758">"فقط این بار"</string>
- <string name="default_audio_route_name" product="tablet" msgid="4617053898167127471">"رایانه لوحی"</string>
+ <string name="default_audio_route_name" product="tablet" msgid="4617053898167127471">"رایانهٔ لوحی"</string>
<string name="default_audio_route_name" product="default" msgid="4239291273420140123">"تلفن"</string>
<string name="default_audio_route_name_headphones" msgid="8119971843803439110">"هدفونها"</string>
<string name="default_audio_route_name_dock_speakers" msgid="6240602982276591864">"بلندگوهای جایگاه اتصال"</string>
diff --git a/core/res/res/values-sk/strings.xml b/core/res/res/values-sk/strings.xml
index 84d83cc..3488b61 100644
--- a/core/res/res/values-sk/strings.xml
+++ b/core/res/res/values-sk/strings.xml
@@ -245,7 +245,7 @@
<string name="permdesc_retrieve_window_content" msgid="3193269069469700265">"Umožňuje aplikácii načítať obsah aktívneho okna. Škodlivé aplikácie môžu získať celý obsah okna a preskúmať celý jeho text okrem hesiel."</string>
<string name="permlab_retrieve_window_info" msgid="8532295199112519378">"načítanie informácií o oknách"</string>
<string name="permdesc_retrieve_window_info" msgid="4998836370424186849">"Umožňuje aplikácii načítať informácie o oknách zo správcu okien. Škodlivé aplikácie môžu načítať informácie, ktoré sú určené pre interné využitie systému."</string>
- <string name="permlab_filter_events" msgid="8675535648807427389">"filtrovanie prenosov"</string>
+ <string name="permlab_filter_events" msgid="8675535648807427389">"filtrovanie udalostí"</string>
<string name="permdesc_filter_events" msgid="8006236315888347680">"Umožňuje aplikácii zaregistrovať vstupný filter, ktorý filtruje stream všetkých prenosov používateľa pred ich odvysielaním. Škodlivá aplikácia môže bez zásahu používateľa ovládať používateľské rozhranie systému."</string>
<string name="permlab_shutdown" msgid="7185747824038909016">"Čiastočné vypnutie"</string>
<string name="permdesc_shutdown" msgid="7046500838746291775">"Uvedie správcu činností do vypnutého stavu. Úplné vypnutie však nenastane."</string>
diff --git a/core/res/res/values-sw/strings.xml b/core/res/res/values-sw/strings.xml
index 43e22da..6fb20dd 100644
--- a/core/res/res/values-sw/strings.xml
+++ b/core/res/res/values-sw/strings.xml
@@ -244,9 +244,9 @@
<string name="permlab_retrieve_window_content" msgid="8022588608994589938">"epua maudhui ya skrini"</string>
<string name="permdesc_retrieve_window_content" msgid="3193269069469700265">"Inaruhusu programu kutoa maudhui ya dirisha amilifu. Programu hasidi zinaweza kutoa maudhui yote ya dirisha na kuchunguza maandishi yake yote isipokuwa nenosiri."</string>
<string name="permlab_retrieve_window_info" msgid="8532295199112519378">"okoa maelezo ya dirisha"</string>
- <string name="permdesc_retrieve_window_info" msgid="4998836370424186849">"Huruhusu programu kuokoa maelezo kuhusu madirisha kutoka kwenye kidhibiti dirisha. Huenda programu hasidi ikaokoa maelezo ambayo yamekusudiwa kwa matumizi ya mfumo wa ndani."</string>
+ <string name="permdesc_retrieve_window_info" msgid="4998836370424186849">"Huruhusu programu kuokoa maelezo kuhusu madirisha kutoka kwenye kidhibiti dirisha. Huenda programu hasidi ikakusanya maelezo ambayo yamekusudiwa kwa matumizi ya mfumo wa ndani."</string>
<string name="permlab_filter_events" msgid="8675535648807427389">"chuja matukio"</string>
- <string name="permdesc_filter_events" msgid="8006236315888347680">"Huruhusu programu kusajili kichujio ingizo kinachochuja mkondo wa matukio ya mtumiaji kabla ya kutumwa. Huenda programu hasidi zikadhibiti mfumo wa UI bila mtumiaji kuingilia kati."</string>
+ <string name="permdesc_filter_events" msgid="8006236315888347680">"Huruhusu programu kusajili kichujio ingizo kinachochuja mkondo wa matukio ya mtumiaji kabla ya kutumwa. Huenda programu hasidi ikadhibiti mfumo wa UI bila mtumiaji kuingilia kati."</string>
<string name="permlab_shutdown" msgid="7185747824038909016">"Zima nusu"</string>
<string name="permdesc_shutdown" msgid="7046500838746291775">"Huweka kisimamia shughuli katika hali ya kuzima. Haiadhiri uzimaji kamili"</string>
<string name="permlab_stopAppSwitches" msgid="4138608610717425573">"zuia swichi za app"</string>
@@ -474,8 +474,8 @@
<string name="permlab_getAccounts" msgid="1086795467760122114">"pata akaunti kwenye kifaa"</string>
<string name="permdesc_getAccounts" product="tablet" msgid="2741496534769660027">"Inaruhusu programu kupata orodha ya akaunti zinazojulikana kwa kompyuta kibao. Hii inaweza kujumuisha akaunti zozote zilizoundwa na programu ambazo umesakinisha."</string>
<string name="permdesc_getAccounts" product="default" msgid="3448316822451807382">"Inaruhusu programu kupata orodha ya akaunti zinazojulikana kwa simu. Hii inaweza kujumuisha akaunti zozote zilizoundwa na programu ambazo umesakinisha."</string>
- <string name="permlab_authenticateAccounts" msgid="5265908481172736933">"unda akaunti na weka manenosiri"</string>
- <string name="permdesc_authenticateAccounts" msgid="5472124296908977260">"Inaruhusu programu kutumia uwezo wa uthibitishaji akaunti wa KidhibitiAkaunti, pamoja na kuunda akaunti na kupata na kuweka nywila zao."</string>
+ <string name="permlab_authenticateAccounts" msgid="5265908481172736933">"fungua akaunti na weka manenosiri"</string>
+ <string name="permdesc_authenticateAccounts" msgid="5472124296908977260">"Inaruhusu programu kutumia uwezo wa uthibitishaji akaunti wa KidhibitiAkaunti, ikiwa ni pamoja na kufungua akaunti na kupata na kuweka manenosiri ya akaunti hizo."</string>
<string name="permlab_manageAccounts" msgid="4983126304757177305">"ongeza au uondoe akaunti"</string>
<string name="permdesc_manageAccounts" msgid="8698295625488292506">"Inaruhusu programu kutekeleza shughuli kama vile kuongeza na kutoa akaunti, na kufuta manenosiri yazo."</string>
<string name="permlab_useCredentials" msgid="235481396163877642">"tumia akaunti kwenye kifaa"</string>
@@ -741,7 +741,7 @@
<string name="lockscreen_glogin_username_hint" msgid="8846881424106484447">"Jina la mtumiaji (barua pepe)"</string>
<string name="lockscreen_glogin_password_hint" msgid="5958028383954738528">"Nenosiri"</string>
<string name="lockscreen_glogin_submit_button" msgid="7130893694795786300">"Ingia"</string>
- <string name="lockscreen_glogin_invalid_input" msgid="1364051473347485908">"Jina batili la mtumiaji au nywila"</string>
+ <string name="lockscreen_glogin_invalid_input" msgid="1364051473347485908">"Jina la mtumiaji au nenosiri batili."</string>
<string name="lockscreen_glogin_account_recovery_hint" msgid="1696924763690379073">"Umesahau jina lako la mtumiaji au nenosiri?"\n"Tembela "<b>"google.com/accounts/recovery"</b>"."</string>
<string name="lockscreen_glogin_checking_password" msgid="7114627351286933867">"Inakagua..."</string>
<string name="lockscreen_unlock_label" msgid="737440483220667054">"Fungua"</string>
@@ -905,7 +905,7 @@
<string name="day" msgid="8144195776058119424">"siku"</string>
<string name="days" msgid="4774547661021344602">"siku"</string>
<string name="hour" msgid="2126771916426189481">"saa"</string>
- <string name="hours" msgid="894424005266852993">"masaa"</string>
+ <string name="hours" msgid="894424005266852993">"saa"</string>
<string name="minute" msgid="9148878657703769868">"dakika"</string>
<string name="minutes" msgid="5646001005827034509">"Dakika"</string>
<string name="second" msgid="3184235808021478">"sekunde"</string>
diff --git a/core/res/res/values-zh-rCN/strings.xml b/core/res/res/values-zh-rCN/strings.xml
index c7fc993..12f80da 100644
--- a/core/res/res/values-zh-rCN/strings.xml
+++ b/core/res/res/values-zh-rCN/strings.xml
@@ -243,14 +243,10 @@
<string name="permdesc_dump" msgid="1778299088692290329">"允许应用检索系统的内部状态。恶意应用可能会检索一般情况下绝不需要检索的多种私人信息和安全信息。"</string>
<string name="permlab_retrieve_window_content" msgid="8022588608994589938">"检索屏幕内容"</string>
<string name="permdesc_retrieve_window_content" msgid="3193269069469700265">"允许应用检索活动窗口的内容。恶意应用可能会检索整个窗口的内容,并检查其中除密码以外的所有文字。"</string>
- <!-- no translation found for permlab_retrieve_window_info (8532295199112519378) -->
- <skip />
- <!-- no translation found for permdesc_retrieve_window_info (4998836370424186849) -->
- <skip />
- <!-- no translation found for permlab_filter_events (8675535648807427389) -->
- <skip />
- <!-- no translation found for permdesc_filter_events (8006236315888347680) -->
- <skip />
+ <string name="permlab_retrieve_window_info" msgid="8532295199112519378">"检索窗口信息"</string>
+ <string name="permdesc_retrieve_window_info" msgid="4998836370424186849">"允许应用通过窗口管理器检索窗口信息。恶意应用可能会检索供内部系统使用的信息。"</string>
+ <string name="permlab_filter_events" msgid="8675535648807427389">"过滤活动"</string>
+ <string name="permdesc_filter_events" msgid="8006236315888347680">"允许应用注册输入过滤器,这类过滤器会在所有用户活动分派之前对这些用户活动的信息流进行过滤。恶意应用可能会在没有用户干预的情况下控制系统用户界面。"</string>
<string name="permlab_shutdown" msgid="7185747824038909016">"部分关机"</string>
<string name="permdesc_shutdown" msgid="7046500838746291775">"使活动管理器进入关闭状态。不执行彻底关机。"</string>
<string name="permlab_stopAppSwitches" msgid="4138608610717425573">"禁止切换应用"</string>
diff --git a/core/res/res/values-zh-rTW/strings.xml b/core/res/res/values-zh-rTW/strings.xml
index a1c20ce..8a8cb8e 100644
--- a/core/res/res/values-zh-rTW/strings.xml
+++ b/core/res/res/values-zh-rTW/strings.xml
@@ -244,9 +244,9 @@
<string name="permlab_retrieve_window_content" msgid="8022588608994589938">"擷取螢幕內容"</string>
<string name="permdesc_retrieve_window_content" msgid="3193269069469700265">"允許應用程式擷取使用中的視窗內容。請注意,惡意應用程式可能利用此功能擷取完整視窗內容,並檢視密碼之外的所有文字。"</string>
<string name="permlab_retrieve_window_info" msgid="8532295199112519378">"擷取視窗資訊"</string>
- <string name="permdesc_retrieve_window_info" msgid="4998836370424186849">"允許應用程式透過視窗管理程式擷取視窗的相關資訊。惡意應用程式可能藉此擷取僅限內部系統使用的資訊。"</string>
+ <string name="permdesc_retrieve_window_info" msgid="4998836370424186849">"允許應用程式透過視窗管理程式擷取視窗的相關資訊。請注意,惡意應用程式可能藉此擷取僅限內部系統使用的資訊。"</string>
<string name="permlab_filter_events" msgid="8675535648807427389">"篩選活動"</string>
- <string name="permdesc_filter_events" msgid="8006236315888347680">"允許應用程式註冊輸入篩選器,在分派所有使用者活動的串流前先行篩選。惡意應用程式可能藉此擅自控制系統使用者介面。"</string>
+ <string name="permdesc_filter_events" msgid="8006236315888347680">"允許應用程式註冊輸入篩選器,在分派所有使用者活動的串流前先行篩選。請注意,惡意應用程式可能藉此擅自控制系統使用者介面。"</string>
<string name="permlab_shutdown" msgid="7185747824038909016">"部分關機"</string>
<string name="permdesc_shutdown" msgid="7046500838746291775">"讓活動管理員進入關機狀態,而不執行完整的關機程序。"</string>
<string name="permlab_stopAppSwitches" msgid="4138608610717425573">"防止切換應用程式"</string>
diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml
index 0477eca..258914b 100755
--- a/core/res/res/values/attrs.xml
+++ b/core/res/res/values/attrs.xml
@@ -3634,6 +3634,24 @@
<!-- If set to true, the parent will be used as the anchor when the anchor cannot be
be found for layout_toLeftOf, layout_toRightOf, etc. -->
<attr name="layout_alignWithParentIfMissing" format="boolean" />
+ <!-- Positions the end edge of this view to the start of the given anchor view ID.
+ Accommodates end margin of this view and start margin of anchor view. -->
+ <attr name="layout_toStartOf" format="reference" />
+ <!-- Positions the start edge of this view to the end of the given anchor view ID.
+ Accommodates start margin of this view and end margin of anchor view. -->
+ <attr name="layout_toEndOf" format="reference" />
+ <!-- Makes the start edge of this view match the start edge of the given anchor view ID.
+ Accommodates start margin. -->
+ <attr name="layout_alignStart" format="reference" />
+ <!-- Makes the end edge of this view match the end edge of the given anchor view ID.
+ Accommodates end margin. -->
+ <attr name="layout_alignEnd" format="reference" />
+ <!-- If true, makes the start edge of this view match the start edge of the parent.
+ Accommodates start margin. -->
+ <attr name="layout_alignParentStart" format="boolean" />
+ <!-- If true, makes the end edge of this view match the end edge of the parent.
+ Accommodates end margin. -->
+ <attr name="layout_alignParentEnd" format="boolean" />
</declare-styleable>
<declare-styleable name="VerticalSlider_Layout">
<attr name="layout_scale" format="float" />
diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml
index 85c4503..9bc3c89 100644
--- a/core/res/res/values/public.xml
+++ b/core/res/res/values/public.xml
@@ -3670,5 +3670,11 @@
<public type="attr" name="paddingEnd"/>
<public type="attr" name="layout_marginStart"/>
<public type="attr" name="layout_marginEnd"/>
+ <public type="attr" name="layout_toStartOf" />
+ <public type="attr" name="layout_toEndOf" />
+ <public type="attr" name="layout_alignStart" />
+ <public type="attr" name="layout_alignEnd" />
+ <public type="attr" name="layout_alignParentStart" />
+ <public type="attr" name="layout_alignParentEnd" />
</resources>
diff --git a/core/tests/coretests/src/android/util/TimeUtilsTest.java b/core/tests/coretests/src/android/util/TimeUtilsTest.java
index 8d9f8e5..74c8e04 100644
--- a/core/tests/coretests/src/android/util/TimeUtilsTest.java
+++ b/core/tests/coretests/src/android/util/TimeUtilsTest.java
@@ -18,8 +18,6 @@
import junit.framework.TestCase;
-import android.util.TimeUtils;
-
import java.util.Calendar;
import java.util.TimeZone;
@@ -442,6 +440,13 @@
assertFormatDuration("+10s24ms", 10024);
}
+ public void testFormatHugeDuration() {
+ //assertFormatDuration("+15542d1h11m11s555ms", 1342833071555L);
+ // TODO: improve formatDuration() API
+ assertFormatDuration("+999d23h59m59s999ms", 1342833071555L);
+ assertFormatDuration("-999d23h59m59s999ms", -1342833071555L);
+ }
+
private void assertFormatDuration(String expected, long duration) {
StringBuilder sb = new StringBuilder();
TimeUtils.formatDuration(duration, sb);
diff --git a/docs/html/develop/index.jd b/docs/html/develop/index.jd
index 6e541ee..eaa70e21d 100644
--- a/docs/html/develop/index.jd
+++ b/docs/html/develop/index.jd
@@ -24,6 +24,7 @@
</div>
</div>
+
<div class="wrap">
<!-- Slideshow -->
<div class="slideshow-container slideshow-develop col-16">
@@ -34,6 +35,24 @@
<li class="item carousel-home">
<div class="col-8">
<img
+src="http://4.bp.blogspot.com/-g05If_eKKRQ/UAcrVLI-OYI/AAAAAAAAAr8/AWvunVb5S-w/s320/nexus7.png"
+class="play no-shadow no-transform" />
+ </div>
+ <div class="content-right col-6">
+ <p class="title-intro">From the blog:</p>
+ <h2>Getting Your App Ready for Jelly Bean and Nexus 7</h2>
+ <p>For many people, their first taste of Jelly Bean will be on the beautiful
+ Nexus 7. While most applications will run just fine on Nexus 7, who wants
+ their app to be just fine? Here are some tips for optimizing your application
+ to make the most of this device.</p>
+ <p><a
+href="http://android-developers.blogspot.com/2012/07/getting-your-app-ready-for-jelly-bean.html" class="button">Read
+more</a></p>
+ </div>
+ </li>
+ <li class="item carousel-home">
+ <div class="col-8">
+ <img
src="http://1.bp.blogspot.com/-6qyjPxTuzv0/T6lde-Oq_fI/AAAAAAAABXc/zle7OFEGP44/s400/fddns%2Bcopy.png"
class="play no-shadow no-transform" />
</div>
@@ -93,6 +112,12 @@
<div class="feed-frame">
<!-- DEVELOPER NEWS -->
<ul>
+ <li><a href="http://android-developers.blogspot.com/2012/06/android-sdk-tools-revision-20.html">
+ <div class="feed-image" style="background:url('http://1.bp.blogspot.com/-Kp1qE5du6l8/T-xurIjfPgI/AAAAAAAABAM/kuWQwPgi0rw/s640/newactivity+(1).png') no-repeat 0 0">
+ </div>
+ <h4>Android SDK Tools, Revision 20</h4>
+ <p>Along with the preview of the Android 4.1 (Jelly Bean) platform, we launched Android SDK Tools R20 and ADT 20.0.0. Here are a few things...</p>
+ </a></li>
<li><a href="http://android-developers.blogspot.com/2012/04/faster-emulator-with-better-hardware.html">
<div class="feed-image" style="background:url('../images/emulator-wvga800l.png') no-repeat 0 0">
</div>
@@ -112,13 +137,7 @@
<h4>Accessibility</h4>
<p>We recently published some new resources to help developers make their Android applications more accessible... </p>
</a></li>
- <li><a href="http://android-developers.blogspot.com/2012/04/new-seller-countries-in-google-play.html">
- <div class="feed-image" style="background:url('http://developer.android.com/images/home/play_logo.png') no-repeat 0 0" >
- </div>
- <h4>New Seller Countries in Google Play</h4>
- <p>Over the past year we’ve been working to expand the list of
- countries and currencies from which Android developers...</p>
- </a></li>
+
</ul>
<!-- FEATURED DOCS -->
<ul>
@@ -294,7 +313,7 @@
*/
var playlists = {
'googleio' : {
- 'ids': ["734A052F802C96B9"]
+ 'ids': ["4C6BCDE45E05F49E"]
},
'fridayreview' : {
'ids': ["B7B9B23D864A55C3"]
diff --git a/docs/html/distribute/googleplay/publish/preparing.jd b/docs/html/distribute/googleplay/publish/preparing.jd
index ab8fadf..6ea0f53 100644
--- a/docs/html/distribute/googleplay/publish/preparing.jd
+++ b/docs/html/distribute/googleplay/publish/preparing.jd
@@ -435,7 +435,6 @@
<tr>
<td><p>Related resources:</p>
<ul style="margin-top:-.5em;">
-<li><strong><a href="{@docRoot}distribute/googleplay/promote/product-pages.html">Your Product Page</a></strong> — Tips and details on creating your product details page.</li>
<li><strong><a href="http://support.google.com/googleplay/android-developer/bin/answer.py?hl=en&answer=113475&topic=2365760&ctx=topic">Category types
</a></strong> — Help Center document listing available categories for apps.</li>
<li><strong><a href="http://support.google.com/googleplay/android-developer/bin/answer.py?hl=en&answer=1078870&topic=2365760&ctx=topic">Graphic Assets for your Application
diff --git a/docs/html/distribute/index.jd b/docs/html/distribute/index.jd
index c27bc62..c0ed6a8 100644
--- a/docs/html/distribute/index.jd
+++ b/docs/html/distribute/index.jd
@@ -13,10 +13,10 @@
<img src="/images/home/google-play.png">
</div>
<div class="copy" style="position:relative;left:480px;width:360;">
- <h1>Your Apps on Google Play</h1>
+ <h1 style="margin-bottom:10px;">Your Apps on Google Play</h1>
<p>The most visited store in the world for Android apps. Cloud-connected and always synced, it's never been easier for users to find and download your apps.</p>
- <p><a class="landing-page-link" href="http://youtu.be/g5SzWc8-X0M">Watch a video</a></p>
+ <p><a class="button" href="https://play.google.com/apps/publish/">Go to Developer Console »</a></p>
</div> </div>
</div>
<div class="distribute-features col-13" style="clear:both;margin-top:246px;">
diff --git a/docs/html/guide/google/gcm/adv.jd b/docs/html/guide/google/gcm/adv.jd
index 39e946e..5cb433f 100644
--- a/docs/html/guide/google/gcm/adv.jd
+++ b/docs/html/guide/google/gcm/adv.jd
@@ -203,7 +203,7 @@
<p>GCM allows a maximum of 4 different collapse keys to be used by the GCM server at any given time. In other words, the GCM server can simultaneously store 4 different send-to-sync messages, each with a different collapse key. If you exceed this number GCM will only keep 4 collapse keys, with no guarantees about which ones they will be.</p>
<h3 id="payload">Messages with payload</h3>
-<p>Unlike a send-to-sync message, every "message with payload" (non-collapsible message) is delivered. The payload the message contains can be up to 4K. For example, here is a JSON-formatted message in an IM application in which spectators are discussing a sporting event:</p>
+<p>Unlike a send-to-sync message, every "message with payload" (non-collapsible message) is delivered. The payload the message contains can be up to 4kb. For example, here is a JSON-formatted message in an IM application in which spectators are discussing a sporting event:</p>
<pre class="prettyprint pretty-json">{
"registration_id" : "APA91bHun4MxP5egoKMwt2KZFBaFUH-1RYqx...",
diff --git a/docs/html/guide/google/gcm/gcm.jd b/docs/html/guide/google/gcm/gcm.jd
index 79edb9f..1b95520 100644
--- a/docs/html/guide/google/gcm/gcm.jd
+++ b/docs/html/guide/google/gcm/gcm.jd
@@ -651,8 +651,8 @@
<tr>
<td><code>data</code></td>
<td>A JSON object whose fields represents the key-value pairs of the message's payload data. If present, the payload data it will be
-included in the Intent as application data, with the key being the extra's name. For instance, <code>"data":{"score":"3x1"}</code> would result in an intent extra named <code>score</code> whose value is the string <code>3x1</code>
-There is no limit on the number of key/value pairs, though there is a limit on the total size of the message. Optional.</td>
+included in the Intent as application data, with the key being the extra's name. For instance, <code>"data":{"score":"3x1"}</code> would result in an intent extra named <code>score</code> whose value is the string <code>3x1</code>.
+There is no limit on the number of key/value pairs, though there is a limit on the total size of the message (4kb). Note that the values <em>must be enclosed by strings</em>. If you want to include objects or other non-string data types (such as integers or booleans), you have to do the conversion to string yourself. Optional.</td>
</tr>
<tr>
<td><code>delay_while_idle</code></td>
diff --git a/docs/html/guide/practices/index.jd b/docs/html/guide/practices/index.jd
index e218b50..04a43c5 100644
--- a/docs/html/guide/practices/index.jd
+++ b/docs/html/guide/practices/index.jd
@@ -10,7 +10,7 @@
<div class="col-12">
<h3>Blog Articles</h3>
- <a href="android-developers.blogspot.com/2010/10/improving-app-quality.html">
+ <a href="http://android-developers.blogspot.com/2010/10/improving-app-quality.html">
<h4>Improving App Quality</h4>
<p>One way of improving your app’s visibility in the ecosystem is by deploying well-targeted
mobile advertising campaigns and cross-app promotions. However, there’s another time-tested method
@@ -23,7 +23,7 @@
your designs to the action bar in order to promote a consistent Android user experience.</p>
</a>
- <a href="android-developers.blogspot.com/2011/07/new-tools-for-managing-screen-sizes.html">
+ <a href="http://android-developers.blogspot.com/2011/07/new-tools-for-managing-screen-sizes.html">
<h4>New Tools For Managing Screen Sizes</h4>
<p>Android 3.2 includes new tools for supporting devices with a wide range of screen sizes.
One important result is better support for a new size of screen; what is typically called a “7-inch”
@@ -31,7 +31,7 @@
different screen sizes.</p>
</a>
- <a href="android-developers.blogspot.com/2011/03/identifying-app-installations.html">
+ <a href="http://android-developers.blogspot.com/2011/03/identifying-app-installations.html">
<h4>Identifying App Installations</h4>
<p>It is very common, and perfectly reasonable, for a developer to want to track individual
installations of their apps. It sounds plausible just to call TelephonyManager.getDeviceId() and use
diff --git a/docs/html/guide/topics/manifest/application-element.jd b/docs/html/guide/topics/manifest/application-element.jd
index 8a91ec8..2105a504 100644
--- a/docs/html/guide/topics/manifest/application-element.jd
+++ b/docs/html/guide/topics/manifest/application-element.jd
@@ -57,9 +57,9 @@
<dt><a name="reparent"></a>{@code android:allowTaskReparenting}</dt>
<dd>Whether or not activities that the application defines can move from
the task that started them to the task they have an affinity for when that task
-is next brought to the front — "{@code true}" if they can move, and
-"{@code false}" if they must remain with the task where they started.
-The default value is "{@code false}".
+is next brought to the front — {@code "true"} if they can move, and
+{@code "false"} if they must remain with the task where they started.
+The default value is {@code "false"}.
<p>
The
@@ -73,9 +73,9 @@
<dt><a name="agent"></a>{@code android:backupAgent}</dt>
<dd>The name of the class that implement's the application's backup agent,
a subclass of {@link android.app.backup.BackupAgent}. The attribute value should be
-a fully qualified class name (such as, "{@code com.example.project.MyBackupAgent}").
+a fully qualified class name (such as, {@code "com.example.project.MyBackupAgent"}).
However, as a shorthand, if the first character of the name is a period
-(for example, "{@code .MyBackupAgent}"), it is appended to the
+(for example, {@code ".MyBackupAgent"}), it is appended to the
package name specified in the
<code><a href="{@docRoot}guide/topics/manifest/manifest-element.html"><manifest></a></code>
element.
@@ -86,29 +86,29 @@
<dt><a name="debug"></a>{@code android:debuggable}</dt>
<dd>Whether or not the application can be debugged, even when running
-on a device in user mode — "{@code true}" if it can be, and "{@code false}"
-if not. The default value is "{@code false}".</dd>
+on a device in user mode — {@code "true"} if it can be, and {@code "false"}
+if not. The default value is {@code "false"}.</dd>
<dt><a name="desc"></a>{@code android:description}</dt>
<dd>User-readable text about the application, longer and more descriptive than the application label. The value must be set as a reference to a string resource. Unlike the label, it cannot be a raw string. There is no default value.</dd>
<dt><a name="enabled"></a>{@code android:enabled}</dt>
<dd>Whether or not the Android system can instantiate components of
-the application — "{@code true}" if it can, and "{@code false}"
-if not. If the value is "{@code true}", each component's
+the application — {@code "true"} if it can, and {@code "false"}
+if not. If the value is {@code "true"}, each component's
{@code enabled} attribute determines whether that component is enabled
-or not. If the value is "{@code false}", it overrides the
+or not. If the value is {@code "false"}, it overrides the
component-specific values; all components are disabled.
<p>
-The default value is "{@code true}".
+The default value is {@code "true"}.
</p></dd>
<dt><a name="code"></a>{@code android:hasCode}</dt>
-<dd>Whether or not the application contains any code — "{@code true}"
-if it does, and "{@code false}" if not. When the value is "{@code false}",
+<dd>Whether or not the application contains any code — {@code "true"}
+if it does, and {@code "false"} if not. When the value is {@code "false"},
the system does not try to load any application code when launching components.
-The default value is "{@code true}".
+The default value is {@code "true"}.
<p>
An application would not have any code of its own only if it's using nothing
@@ -118,10 +118,14 @@
<dt><a name="hwaccel"></a>{@code android:hardwareAccelerated}</dt>
<dd>Whether or not hardware-accelerated rendering should be enabled for all
-Activities and Views in this application — "{@code true}" if it
-should be enabled, and "{@code false}" if not. The default value is "{@code false}".
+activities and views in this application — {@code "true"} if it
+should be enabled, and {@code "false"} if not. The default value is {@code "true"} if you've set
+either <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code minSdkVersion}</a>
+or <a
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code targetSdkVersion}</a>
+to {@code "14"} or higher; otherwise, it's {@code "false"}.
-<p>Starting from Android 3.0, a hardware-accelerated OpenGL renderer is
+<p>Starting from Android 3.0 (API level 11), a hardware-accelerated OpenGL renderer is
available to applications, to improve performance for many common 2D graphics
operations. When the hardware-accelerated renderer is enabled, most operations
in Canvas, Paint, Xfermode, ColorFilter, Shader, and Camera are accelerated.
@@ -132,6 +136,9 @@
<p>Note that not all of the OpenGL 2D operations are accelerated. If you enable
the hardware-accelerated renderer, test your application to ensure that it can
make use of the renderer without errors.</p>
+
+<p>For more information, read the <a href="{@docRoot}guide/topics/graphics/hardware-accel.html"
+>Hardware Acceleration</a> guide.</p>
</dd>
<dt><a name="icon"></a>{@code android:icon}</dt>
@@ -146,7 +153,7 @@
<p>
This attribute must be set as a reference to a drawable resource containing
-the image (for example {@code "@drawable/icon"}). There is no default icon.
+the image (for example {@code "@drawable/icon"}). There is no default icon.
</p></dd>
<dt><a name="killrst"></a>{@code android:killAfterRestore}</dt>
@@ -233,8 +240,8 @@
<dt><a name="persistent"></a>{@code android:persistent}</dt>
<dd>Whether or not the application should remain running at all times —
-"{@code true}" if it should, and "{@code false}" if not. The default value
-is "{@code false}". Applications should not normally set this flag;
+{@code "true"} if it should, and {@code "false"} if not. The default value
+is {@code "false"}. Applications should not normally set this flag;
persistence mode is intended only for certain system applications.</dd>
<dt><a name="proc"></a>{@code android:process}</dt>
diff --git a/docs/html/guide/topics/manifest/uses-sdk-element.jd b/docs/html/guide/topics/manifest/uses-sdk-element.jd
index 29dcb56..61f03b9 100644
--- a/docs/html/guide/topics/manifest/uses-sdk-element.jd
+++ b/docs/html/guide/topics/manifest/uses-sdk-element.jd
@@ -230,7 +230,13 @@
<table>
<tr><th>Platform Version</th><th>API Level</th><th>VERSION_CODE</th><th>Notes</th></tr>
- <tr><td><a href="{@docRoot}about/versions/android-4.0.3.html">Android 4.0.3</a></td>
+ <tr><td><a href="{@docRoot}about/versions/android-4.1.html">Android 4.1, 4.1.1</a></td>
+ <td><a href="{@docRoot}sdk/api_diff/16/changes.html" title="Diff Report">16</a></td>
+ <td>{@link android.os.Build.VERSION_CODES#JELLY_BEAN}</td>
+ <td><a href="{@docRoot}about/versions/jelly-bean.html">Platform
+Highlights</a></td></tr>
+
+ <tr><td><a href="{@docRoot}about/versions/android-4.0.3.html">Android 4.0.3, 4.0.4</a></td>
<td><a href="{@docRoot}sdk/api_diff/15/changes.html" title="Diff Report">15</a></td>
<td>{@link android.os.Build.VERSION_CODES#ICE_CREAM_SANDWICH_MR1}</td>
<td rowspan="2"><a href="{@docRoot}about/versions/android-4.0-highlights.html">Platform
diff --git a/docs/html/guide/topics/resources/layout-resource.jd b/docs/html/guide/topics/resources/layout-resource.jd
index 5643075..c653b0c 100644
--- a/docs/html/guide/topics/resources/layout-resource.jd
+++ b/docs/html/guide/topics/resources/layout-resource.jd
@@ -161,11 +161,10 @@
supported by the root element in the included layout and they will override those defined in the
root element.</p>
- <p class="caution"><strong>Caution:</strong> If you want to override the layout dimensions,
-you must override both <code>android:layout_height</code> and
-<code>android:layout_width</code>—you cannot override only the height or only the width.
-If you override only one, it will not take effect. (Other layout properties, such as weight,
-are still inherited from the source layout.)</p>
+ <p class="caution"><strong>Caution:</strong> If you want to override layout attributes using
+ the <code><include></code> tag, you must override both
+ <code>android:layout_height</code> and <code>android:layout_width</code> in order for
+ other layout attributes to take effect.</p>
<p>Another way to include a layout is to use {@link android.view.ViewStub}. It is a lightweight
View that consumes no layout space until you explicitly inflate it, at which point, it includes a
diff --git a/docs/html/guide/topics/resources/localization.jd b/docs/html/guide/topics/resources/localization.jd
index 41961a3..983aef8 100755
--- a/docs/html/guide/topics/resources/localization.jd
+++ b/docs/html/guide/topics/resources/localization.jd
@@ -48,8 +48,6 @@
<h2>See also</h2>
<ol>
- <li><a
-href="{@docRoot}resources/tutorials/localization/index.html">Hello, L10N Tutorial</a></li>
<li><a href="{@docRoot}guide/topics/resources/providing-resources.html">Providing Resources</a></li>
<li><a href="{@docRoot}guide/topics/ui/declaring-layout.html">Layouts</a></li>
<li><a href="{@docRoot}reference/android/app/Activity.html#ActivityLifecycle">Activity Lifecycle</a></li>
@@ -87,11 +85,8 @@
</li>
</ul>
-<p>The <a
-href="{@docRoot}resources/tutorials/localization/index.html">Hello, L10N
-</a> tutorial takes you through the steps of creating a simple localized
-application that uses locale-specific resources in the way described in this
-document. </p>
+<p>For a short guide to localizing strings in your app, see the training lesson, <a
+href="{@docRoot}training/basics/supporting-devices/languages.html">Supporting Different Languages</a>. </p>
<h2 id="resource-switching">Overview: Resource-Switching in Android</h2>
diff --git a/docs/html/images/tools/avd_manager.png b/docs/html/images/tools/avd_manager.png
new file mode 100644
index 0000000..f8a173c
--- /dev/null
+++ b/docs/html/images/tools/avd_manager.png
Binary files differ
diff --git a/docs/html/images/tools/eclipse-new.png b/docs/html/images/tools/eclipse-new.png
new file mode 100644
index 0000000..d918427
--- /dev/null
+++ b/docs/html/images/tools/eclipse-new.png
Binary files differ
diff --git a/docs/html/images/tools/eclipse-run.png b/docs/html/images/tools/eclipse-run.png
new file mode 100644
index 0000000..925f0b9
--- /dev/null
+++ b/docs/html/images/tools/eclipse-run.png
Binary files differ
diff --git a/docs/html/images/tools/new_adt_project.png b/docs/html/images/tools/new_adt_project.png
new file mode 100644
index 0000000..0f0e883
--- /dev/null
+++ b/docs/html/images/tools/new_adt_project.png
Binary files differ
diff --git a/docs/html/images/tools/sdk_manager.png b/docs/html/images/tools/sdk_manager.png
new file mode 100644
index 0000000..08ffda8
--- /dev/null
+++ b/docs/html/images/tools/sdk_manager.png
Binary files differ
diff --git a/docs/html/images/training/firstapp/adt-firstapp-setup.png b/docs/html/images/training/firstapp/adt-firstapp-setup.png
index c092562..daf02b25 100644
--- a/docs/html/images/training/firstapp/adt-firstapp-setup.png
+++ b/docs/html/images/training/firstapp/adt-firstapp-setup.png
Binary files differ
diff --git a/docs/html/images/training/firstapp/adt-new-activity.png b/docs/html/images/training/firstapp/adt-new-activity.png
new file mode 100644
index 0000000..2d579d3
--- /dev/null
+++ b/docs/html/images/training/firstapp/adt-new-activity.png
Binary files differ
diff --git a/docs/html/index.jd b/docs/html/index.jd
index 8930c7f..1d47ed7 100644
--- a/docs/html/index.jd
+++ b/docs/html/index.jd
@@ -43,11 +43,11 @@
<img src="{@docRoot}images/home/google-io.png">
</div>
<div class="content-right col-5">
- <h1>Watch Android at <br/>Google I/O!</h1>
- <p>See the keynote and more than 40 Android developer sessions streamed live from Moscone Center in San Francisco.</p>
- <p>Begins June 27, 9AM PDT (UTC-7).</p>
- <p><a href="https://developers.google.com/events/io/sessions#android"
-class="button">See the Android Sessions</a></p>
+ <h1>Android videos<br/> from Google I/O!</h1>
+ <p>If you couldn't make it to Google I/O this year or want to review some of the material,
+ all of the Android sessions are now available for viewing online.</p>
+ <p><a href="http://www.youtube.com/playlist?list=PL4C6BCDE45E05F49E&feature=plcp"
+class="button">Watch the Android sessions</a></p>
</div>
</li>
<li class="item carousel-home">
@@ -68,7 +68,6 @@
<!-- /End slideshow -->
-
</div>
<div class="wrap" style="padding-bottom:20px">
<!-- Section links -->
diff --git a/docs/html/sdk/index.jd b/docs/html/sdk/index.jd
index 0038fac..df97855 100644
--- a/docs/html/sdk/index.jd
+++ b/docs/html/sdk/index.jd
@@ -2,21 +2,21 @@
header.hide=1
page.metaDescription=Download the official Android SDK to develop apps for Android-powered devices.
-sdk.win_installer=installer_r20-windows.exe
-sdk.win_installer_bytes=70497095
-sdk.win_installer_checksum=0f25321554e2f88b247320d6a3bc1a7a
+sdk.win_installer=installer_r20.0.1-windows.exe
+sdk.win_installer_bytes=70486979
+sdk.win_installer_checksum=a8df28a29c7b8598e4c50f363692256d
-sdk.win_download=android-sdk_r20-windows.zip
-sdk.win_bytes=90353014
-sdk.win_checksum=b62b0f80f559c0ac670e9f058a21f0df
+sdk.win_download=android-sdk_r20.0.1-windows.zip
+sdk.win_bytes=90370975
+sdk.win_checksum=5774f536892036f87d3bf6502862cea5
-sdk.mac_download=android-sdk_r20-macosx.zip
-sdk.mac_bytes=58203018
-sdk.mac_checksum=b6b6035ccec55ec2aa057438eb1db1f4
+sdk.mac_download=android-sdk_r20.0.1-macosx.zip
+sdk.mac_bytes=58217336
+sdk.mac_checksum=cc132d04bc551b23b0c507cf5943df57
-sdk.linux_download=android-sdk_r20-linux.tgz
-sdk.linux_bytes=82589455
-sdk.linux_checksum=22a81cf1d4a951c62f71a8758290e9bb
+sdk.linux_download=android-sdk_r20.0.1-linux.tgz
+sdk.linux_bytes=82607616
+sdk.linux_checksum=cd7176831087f53e46123dd91551be32
@jd:body
diff --git a/docs/html/sdk/installing/adding-packages.jd b/docs/html/sdk/installing/adding-packages.jd
index 7765343..65c5d94 100644
--- a/docs/html/sdk/installing/adding-packages.jd
+++ b/docs/html/sdk/installing/adding-packages.jd
@@ -4,8 +4,9 @@
@jd:body
-<p>The Android SDK separates different parts of the SDK into separately downloadable packages. The
-SDK starter package that you've installed includes only the SDK Tools. To develop an Android app,
+<p>The Android SDK separates tools, platforms, and other components into packages you can
+ download using the Android SDK Manager. The original
+SDK package you've downloaded includes only the SDK Tools. To develop an Android app,
you also need to download at least one Android platform and the latest SDK Platform-tools.</p>
<p>You can update and install SDK packages at any time using the Android SDK Manager.</p>
@@ -48,28 +49,32 @@
<dd><strong>Required.</strong> You must install this package when you install the SDK for
the first time.</dd>
<dt>SDK Platform</dt>
- <dd><strong>Required.</strong>You need to download <strong
-style="color:red">at least one platform</strong> into your environment so you're
-able to compile your application. In order to provide the best user experience on the latest
-devices, we recommend that you use the latest platform version as your build target. You'll
-still be able to run your app on older versions, but you must build against the latest version
-in order to use new features when running on devices with the latest version of Android.</dd>
+ <dd><strong>Required.</strong>You must download <em>at least one platform</em> into your
+environment so you're able to compile your application. In order to provide the best user experience
+on the latest devices, we recommend that you use the latest platform version as your build target.
+You'll still be able to run your app on older versions, but you must build against the latest
+version in order to use new features when running on devices with the latest version of Android.
+ <p>To get started, download the latest Android version, plus the lowest version you plan
+ to support (we recommend Android 2.2 for your lowest version).</p></dd>
<dt>System Image</dt>
<dd>Recommended. Although you might have one or more Android-powered devices on which to test
your app, it's unlikely you have a device for every version of Android your app supports. It's
-a good practice to download a system image for each version of Android you support and use them
-to test your app on the Android emulator.</dd>
+a good practice to download system images for all versions of Android your app supports and test
+your app running on them with the <a href="{@docRoot}tools/devices/emulator.html">Android emulator</a>.</dd>
+ <dt>Android Support</dt>
+ <dd>Recommended. Includes a static library that allows you to use some of the latest
+Android APIs (such as <a href="{@docRoot}guide/components/fragments.html">fragments</a>,
+plus others not included in the framework at all) on devices running
+a platform version as old as Android 1.6. All of the activity templates available when creating
+a new project with the <a href="{@docRoot}tools/sdk/eclipse-adt.html">ADT Plugin</a>
+require this. For more information, read <a
+href="{@docRoot}tools/extras/support-library.html">Support Library</a>.</dd>
<dt>SDK Samples</dt>
<dd>Recommended. The samples give you source code that you can use to learn about
Android, load as a project and run, or reuse in your own app. Note that multiple
samples packages are available — one for each Android platform version. When
you are choosing a samples package to download, select the one whose API Level
matches the API Level of the Android platform that you plan to use.</dd>
- <dt>Android Support</dt>
- <dd>Recommended. The APIs available in this static library allow you to use a variety of new
-framework features (including some not available in even the latest version) on devices running
-a platform version as old as Android 1.6. For more information, read <a
-href="{@docRoot}tools/extras/support-library.html">Support Library</a>.</dd>
</dl>
diff --git a/docs/html/sdk/installing/installing-adt.jd b/docs/html/sdk/installing/installing-adt.jd
index b276da4..60f67a2 100644
--- a/docs/html/sdk/installing/installing-adt.jd
+++ b/docs/html/sdk/installing/installing-adt.jd
@@ -1,9 +1,9 @@
page.title=Installing the Eclipse Plugin
walkthru=1
-adt.zip.version=20.0.0
-adt.zip.download=ADT-20.0.0.zip
-adt.zip.bytes=12387628
-adt.zip.checksum=ea0fc934af3b6b89097f0146c7822ed0
+adt.zip.version=20.0.1
+adt.zip.download=ADT-20.0.1.zip
+adt.zip.bytes=12387574
+adt.zip.checksum=6ebd7f8566bfd2cd031b07d56d49542d
@jd:body
diff --git a/docs/html/tools/revisions/platforms.jd b/docs/html/tools/revisions/platforms.jd
index db0cbab..6163fbc 100644
--- a/docs/html/tools/revisions/platforms.jd
+++ b/docs/html/tools/revisions/platforms.jd
@@ -36,6 +36,107 @@
+
+<h2 id="4.1">Android 4.1</h2>
+
+
+<p class="caution"><strong>Important:</strong> To download the new Android
+4.0.x system components from the Android SDK Manager, you must first update the
+SDK tools to revision 20 or later and restart the Android SDK Manager. If you do not,
+the Android 4.1 system components will not be available for download.</p>
+
+<div class="toggle-content opened">
+
+ <p><a href="#" onclick="return toggleContent(this)">
+ <img src="{@docRoot}assets/images/triangle-opened.png"
+class="toggle-content-img" alt="" />Revision 2</a> <em>(July 2012)</em>
+ </p>
+
+ <div class="toggle-content-toggleme">
+
+ <p>Maintenance update. The system version is 4.1.1.</p>
+ <dl>
+ <dt>Dependencies:</dt>
+ <dd>SDK Tools r20 or higher is required.</dd>
+ </dl>
+
+ </div>
+</div>
+
+<div class="toggle-content closed" >
+
+ <p><a href="#" onclick="return toggleContent(this)">
+ <img src="{@docRoot}assets/images/triangle-closed.png"
+class="toggle-content-img" alt="" />Revision 1</a> <em>(June 2012)</em>
+ </p>
+
+ <div class="toggle-content-toggleme">
+
+ <p>Initial release. The system version is 4.1.0.</p>
+ <dl>
+ <dt>Dependencies:</dt>
+ <dd>SDK Tools r20 or higher is required.</dd>
+ </dl>
+
+ </div>
+</div>
+
+<h3>Emulator Skins</h3>
+
+<p>The downloadable platform includes the following emulator skins:</p>
+
+<ul>
+ <li>
+ QVGA (240x320, low density, small screen)
+ </li>
+ <li>
+ WQVGA400 (240x400, low density, normal screen)
+ </li>
+ <li>
+ WQVGA432 (240x432, low density, normal screen)
+ </li>
+ <li>
+ HVGA (320x480, medium density, normal screen)
+ </li>
+ <li>
+ WVGA800 (480x800, high density, normal screen)
+ </li>
+ <li>
+ WVGA854 (480x854 high density, normal screen)
+ </li>
+ <li>
+ WXGA720 (1280x720, extra-high density, normal screen)
+ </li>
+ <li>
+ WSVGA (1024x600, medium density, large screen)
+ </li>
+ <li>
+ WXGA800-7in (1280x800, high density, large screen) <span class="new">new</span>
+ </li>
+ <li>
+ WXGA800 (1280x800, medium density, xlarge screen)
+ </li>
+</ul>
+
+<p>To test your application on an emulator that represents the <a
+href="http://play.google.com/nexus7">Nexus 7</a> tablet device, you can create an AVD with
+the new WXGA800-7in skin. For best performance, make sure to enable <a
+href="{@docRoot}tools/devices/emulator.html#accel-graphics">graphics acceleration</a> in the
+emulator configuration.</p>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
<h2 id="4.0.3">Android 4.0.3</h2>
@@ -44,10 +145,10 @@
SDK tools to revision 14 or later and restart the Android SDK Manager. If you do not,
the Android 4.0.x system components will not be available for download.</p>
-<div class="toggle-content opened">
+<div class="toggle-content closed">
<p><a href="#" onclick="return toggleContent(this)">
- <img src="{@docRoot}assets/images/triangle-opened.png"
+ <img src="{@docRoot}assets/images/triangle-closed.png"
class="toggle-content-img" alt="" />Revision 3</a> <em>(March 2012)</em>
</p>
@@ -135,15 +236,6 @@
</li>
</ul>
-<p>To test your application on an emulator that represents the latest Android device, you can create
-an AVD with the new WXGA720 skin (it's an xhdpi, normal screen device). Note that the emulator
-currently doesn't support the new on-screen navigation bar for devices without hardware navigation
-buttons, so when using this skin, you must use keyboard keys <em>Home</em> for the Home button,
-<em>ESC</em> for the Back button, and <em>F2</em> or <em>Page-up</em> for the Menu button.</p>
-
-<p>However, due to performance issues in the emulator when running high-resolution screens such as
-the one for the WXGA720 skin, we recommend that you primarily use the traditional WVGA800 skin
-(hdpi, normal screen) to test your application.</p>
diff --git a/docs/html/tools/sdk/eclipse-adt.jd b/docs/html/tools/sdk/eclipse-adt.jd
index aa21423..947e463 100644
--- a/docs/html/tools/sdk/eclipse-adt.jd
+++ b/docs/html/tools/sdk/eclipse-adt.jd
@@ -95,7 +95,47 @@
<div class="toggleable opened">
<a href="#" onclick="return toggleDiv(this)">
- <img src="{@docRoot}assets/images/triangle-opened.png" class="toggle-img" height="9px"
+ <img src="{@docRoot}assets/images/triangle-opened.png" class="toggle-img" height="9px"
+ width="9px" />
+ADT 20.0.1</a> <em>(June 2012)</em>
+ <div class="toggleme">
+<dl>
+ <dt>Dependencies:</dt>
+
+ <dd>
+ <ul>
+ <li>Java 1.6 or higher is required for ADT 20.0.1.</li>
+ <li>Eclipse Helios (Version 3.6.2) or higher is required for ADT 20.0.1.</li>
+ <li>ADT 20.0.1 is designed for use with <a href="{@docRoot}tools/sdk/tools-notes.html">SDK
+ Tools r20.0.1</a>. If you haven't already installed SDK Tools r20.0.1 into your SDK, use the
+ Android SDK Manager to do so.</li>
+ </ul>
+ </dd>
+
+ <dt>Bug fixes:</dt>
+ <dd>
+ <ul>
+ <li>Fixed issue in the New Project Wizard related to installation of the Support Library.</li>
+ <li>Fixed several issues with New Project Wizard related to templates.</li>
+ <li>Fixed issue with the text-based launcher icon in New Project Wizard.</li>
+ <li>Fixed issue with sticky error markers in Java files.</li>
+ <li>Fixed problem with manifest merger when exporting release {@code .apk} files.</li>
+ <li>Fixed NDK support to automatically find include path on Windows.</li>
+ <li>Fixed editor startup exception for new configurations where editor would come up blank.</li>
+ <li>Added support for {@code xxhdpi} density, which was included in API Level 16.</li>
+ <li>Fixed a bug in the {@code lint} check for unprotected broadcast receivers to ignore
+unprotected receivers for default Android actions.</li>
+ </ul>
+ </dd>
+
+</dl>
+
+</div>
+</div>
+
+<div class="toggleable closed">
+ <a href="#" onclick="return toggleDiv(this)">
+ <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-img" height="9px"
width="9px" />
ADT 20.0.0</a> <em>(June 2012)</em>
<div class="toggleme">
@@ -325,7 +365,7 @@
<ul>
<li>Fixed problem using Layout Editor with {@link android.widget.SlidingDrawer} which could
not be dragged into the layout on some platforms.</li>
- <li>Fixed preview rendering for {@link android.widget.SlidingDrawer} and
+ <li>Fixed preview rendering for {@link android.widget.SlidingDrawer} and
{@link android.widget.TabHost}.
(<a href="http://code.google.com/p/android/issues/detail?id=23022">Issue 23022</a>).</li>
<li>Fixed issues that could prevent layout rendering due to unresolvable resources.
diff --git a/docs/html/tools/sdk/ndk/index.jd b/docs/html/tools/sdk/ndk/index.jd
index 6be3168..216a304 100644
--- a/docs/html/tools/sdk/ndk/index.jd
+++ b/docs/html/tools/sdk/ndk/index.jd
@@ -1,16 +1,16 @@
ndk=true
-ndk.win_download=android-ndk-r8-windows.zip
-ndk.win_bytes=109928336
-ndk.win_checksum=37b1a2576f28752fcc09e1b9c07e3f14
+ndk.win_download=android-ndk-r8b-windows.zip
+ndk.win_bytes=188724991
+ndk.win_checksum=6d290d4f2729ef2063c5ae5b1e335622
-ndk.mac_download=android-ndk-r8-darwin-x86.tar.bz2
-ndk.mac_bytes=96650992
-ndk.mac_checksum=81ce5de731f945692123b377afe0bad9
+ndk.mac_download=android-ndk-r8b-darwin-x86.tar.bz2
+ndk.mac_bytes=181255568
+ndk.mac_checksum=94fe392194ea41f8a70cfce0dee3870f
-ndk.linux_download=android-ndk-r8-linux-x86.tar.bz2
-ndk.linux_bytes=88310791
-ndk.linux_checksum=5c9afc9695ad67c61f82fbf896803c05
+ndk.linux_download=android-ndk-r8b-linux-x86.tar.bz2
+ndk.linux_bytes=160466240
+ndk.linux_checksum=6694ccc04d543500f0661a75f6c46526
page.title=Android NDK
@@ -41,7 +41,7 @@
</ol>
</div>
</div>
-
+
<p>The NDK is a toolset that allows you to implement parts
of your app using native-code languages such as C and C++. For certain types of apps,
this can be helpful so that you may reuse existing code libraries written in these
@@ -62,12 +62,12 @@
<h2 id="Downloads">Downloads</h2>
-
+
<script>
$('#Downloads').after($('#download-table'));
</script>
-
-
+
+
<h2 id="Revisions">Revisions</h2>
<p>The sections below provide information and notes about successive releases of
@@ -115,12 +115,204 @@
<div class="toggleable open">
<a href="#" onclick="return toggleDiv(this)"><img src=
"{@docRoot}assets/images/triangle-opened.png" class="toggle-img" height="9px" width="9px">
+ Android NDK, Revision 8b</a> <em>(July 2012)</em>
+
+ <div class="toggleme">
+ <p>The main features of this release are a new GNU Compiler Collection (GCC) 4.6 toolchain and
+GNU Debugger (GDB) 7.3.x which adds debugging support for the Android 4.1 (API Level 16) system
+image.</p>
+
+ <dl>
+ <dt>Important bug fixes:</dt>
+
+ <dd>
+ <ul>
+ <li>Fixed {@code LOCAL_SHORT_COMMANDS} issues on Mac OS, Windows Cygwin environments for
+static libraries. List file generation is faster, and it is not regenerated to avoid repeated
+project rebuilds.</li>
+ <li>Fixed several issues in {@code ndk-gdb}:
+ <ul>
+ <li>Updated tool to pass flags {@code -e}, {@code -d} and {@code -s} to adb more
+consistently.</li>
+ <li>Updated tool to accept device serial names containing spaces.</li>
+ <li>Updated tool to retrieve {@code /system/bin/link} information, so {@code gdb} on
+the host can set a breakpoint in {@code __dl_rtld_db_dlactivity} and be aware of linker activity
+(e.g., rescan {@code solib} symbols when {@code dlopen()} is called).</li>
+ </ul>
+ </li>
+ <li>Fixed {@code ndk-build clean} on Windows, which was failing to remove
+{@code ./libs/*/lib*.so}.</li>
+ <li>Fixed {@code ndk-build.cmd} to return a non-zero {@code ERRORLEVEL} when {@code make}
+fails.</li>
+ <li>Fixed {@code libc.so} to stop incorrectly exporting the {@code __exidx_start} and
+{@code __exidx_end} symbols.</li>
+ <li>Fixed {@code SEGV} when unwinding the stack past {@code __libc_init} for ARM and
+MIPS.</li>
+ </ul>
+ </dd>
+ </dl>
+
+ <dl>
+ <dt>Important changes:</dt>
+
+ <dd>
+ <ul>
+ <li>Added GCC 4.6 toolchain ({@code binutils} 2.21 with {@code gold} and GDB 7.3.x) to
+co-exist with the original GCC 4.4.3 toolchain ({@code binutils} 2.19 and GDB 6.6).</p>
+ <ul>
+ <li>GCC 4.6 is now the default toolchain. You may set {@code
+NDK_TOOLCHAIN_VERSION=4.4.3} in {@code Android.mk} to select the original one.</li>
+ <li>Support for the {@code gold} linker is only available for ARM and x86
+architectures on Linux and Mac OS hosts. This support is disabled by default. Add {@code
+LOCAL_C_FLAGS += -fuse-ld=gold} in {@code Android.mk} to enable it.</li>
+ <li>Programs compiled with {@code -fPIE} require the new {@code GDB} for debugging,
+including binaries in Android 4.1 (API Level 16) system images.</li>
+ <li>The {@code binutils} 2.21 {@code ld} tool contains back-ported fixes from
+version 2.22:
+ <ul>
+ <li>Fixed {@code ld --gc-sections}, which incorrectly retains zombie references to
+external libraries. (<a href="http://sourceware.org/bugzilla/show_bug.cgi?id=13177">more
+info</a>).</li>
+ <li>Fixed ARM {@code strip} command to preserve the original {@code p_align} and
+{@code p_flags} in {@code GNU_RELRO} section if they are valid. Without this fix, programs
+built with {@code -fPIE} could not be debugged. (<a
+href="http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/elf.c.diff?cvsroot=src&r1=1.552&r2=1.553">more info</a>)</li>
+ </ul>
+ </li>
+ <li>Disabled {@code sincos()} optimization for compatibility with older
+ platforms.</li>
+ </ul>
+ </li>
+
+ <li>Updated build options to enable the Never eXecute (NX) bit and {@code relro}/{@code
+bind_now} protections by default:
+ <ul>
+ <li>Added {@code --noexecstack} to assembler and {@code -z noexecstack} to linker
+that provides NX protection against buffer overflow attacks by enabling NX bit on stack and
+heap.</li>
+ <li>Added {@code -z relro} and {@code -z now} to linker for hardening of internal
+data sections after linking to guard against security vulnerabilities caused by memory corruption.
+(more info: <a href="http://www.akkadia.org/drepper/nonselsec.pdf">1</a>,
+<a href="http://tk-blog.blogspot.com/2009/02/relro-not-so-well-known-memory.html">2</a>)</li>
+
+ <li>These features can be disabled using the following options:
+ <ol>
+ <li>Disable NX protection by setting the {@code --execstack} option for the
+assembler and {@code -z execstack} for the linker.</li>
+ <li>Disable hardening of internal data by setting the {@code -z norelro} and
+{@code -z lazy} options for the linker.</li>
+ <li>Disable these protections in the NDK {@code jni/Android.mk} by setting the
+following options:
+<pre>
+LOCAL_DISABLE_NO_EXECUTE=true # disable "--noexecstack" and "-z noexecstack"
+DISABLE_RELRO=true # disable "-z relro" and "-z now"</li>
+</pre>
+ </ol>
+ <p>See {@code docs/ANDROID-MK.html} for more details.</p>
+ </li>
+ </ul>
+ </li>
+
+ <li>Added branding for Android executables with the {@code .note.ABI-tag} section (in
+{@code crtbegin_static/dynamic.o}) so that debugging tools can act accordingly. The structure
+member and values are defined as follows:</p>
+<pre>
+static const struct {
+ int32_t namesz; /* = 4, sizeof ("GNU") */
+ int32_t descsz; /* = 6 * sizeof(int32_t) */
+ int32_t type; /* = 1 */
+ char name[sizeof "GNU"]; /* = "GNU" */
+ int32_t os; /* = 0 */
+ int32_t major; /* = 2 */
+ int32_t minor; /* = 6 */
+ int32_t teeny; /* = 15 */
+ int32_t os_variant; /* = 1 */
+ int32_t android_api; /* = 3, 4, 5, 8, 9, 14 */
+}</pre>
+ </li>
+ </ul>
+ </dd>
+ </dl>
+
+ <dl>
+ <dt>Other bug fixes:</dt>
+
+ <dd>
+ <ul>
+ <li>Fixed {@code mips-linux-gnu} relocation truncated to fit {@code R_MIPS_TLS_LDM} issue.
+ (<a href="http://sourceware.org/bugzilla/show_bug.cgi?id=12637">more info</a>)</li>
+ <li>Fixed {@code ld} tool segfaults when using {@code --gc-sections}.
+ (<a href="http://sourceware.org/bugzilla/show_bug.cgi?id=12845">more info</a>)
+ </li>
+ <li>Fixed MIPS {@code GOT_PAGE} counting issue.
+ (<a href="http://sourceware.org/ml/binutils/2011-05/msg00198.html">more info</a>)</li>
+ <li>Fixed follow warning symbol link for {@code mips_elf_count_got_symbols}.</li>
+ <li>Fixed follow warning symbol link for {@code mips_elf_allocate_lazy_stub}.</li>
+ <li>Moved MIPS {@code .dynamic} to the data segment, so that it is writable.</li>
+ <li>Replaced hard-coded values for symbols with correct segment sizes for MIPS.</li>
+ <li>Removed the {@code -mno-shared} option from the defaults in the MIPS toolchain.
+The default for Android toolchain is {@code -fPIC} (or {@code -fpic} if supported). If you do not
+explicitly specify {@code -mshared}, {@code -fpic}, {@code -fPIC}, {@code -fpie}, or {@code -fPIE},
+the MIPS compiler adds {@code -mno-shared} that turns off PIC. Fixed compiler not to add
+{@code -mno-shared} in this case.</li>
+ <li>Fixed wrong package names in samples {@code hello-jni} and {@code two-libs} so that
+the {@code tests} project underneath it can compile.</li>
+ </ul>
+ </dd>
+ </dl>
+
+ <dl>
+ <dt>Other Changes:</dt>
+
+ <dd>
+ <ul>
+ <li>Changed locations of binaries:
+ <ul>
+ <li>Moved {@code gdbserver} from
+{@code toolchain/<arch-os-ver>/prebuilt/gdbserver} to
+{@code prebuilt/android-<arch>/gdbserver/gdbserver}.</li>
+ <li>Renamed x86 toolchain prefix from {@code i686-android-linux-} to
+{@code i686-linux-android-}.</li>
+ <li>Moved {@code sources/cxx-stl/gnu-libstdc++/include} and {@code lib} to
+{@code sources/cxx-stl/gnu-libstdc++/4.6} when compiled with GCC 4.6, or
+{@code sources/cxx-stl/gnu-libstdc++/4.4.3} when compiled with GCC 4.4.3.</li>
+ <li>Moved {@code libbfd.a} and {@code libintl.a} from {@code lib/} to {@code
+lib32/}.</li>
+ </ul>
+ </li>
+
+ <li>Added and improved various scripts in the rebuild and test NDK toolchain:
+ <ul>
+ <li>Added {@code build-mingw64-toolchain.sh} to generate a new Linux-hosted toolchain
+that generates Win32 and Win64 executables.</li>
+ <li>Improved speed of {@code download-toolchain-sources.sh} by using the {@code
+clone} command and only using {@code checkout} for the directories that are needed to build the NDK
+toolchain binaries.</li>
+ <li>Added {@code build-host-gcc.sh} and {@code build-host-gdb.sh} scripts.</li>
+ <li>Added {@code tests/check-release.sh} to check the content of a given NDK
+installation directory, or an existing NDK package.</li>
+ <li>Rewrote the {@code tests/standalone/run.sh} standalone tests .</li>
+ </ul>
+ </li>
+ <li>Removed {@code if_dl.h} header from all platforms and architectures. The {@code
+AF_LINK} and {@code sockaddr_dl} elements it describes are specific to BSD (i.e., they don't exist
+in Linux).</li>
+ </ul>
+ </dd>
+ </dl>
+
+ </div>
+</div>
+
+<div class="toggleable closed">
+ <a href="#" onclick="return toggleDiv(this)"><img src=
+ "{@docRoot}assets/images/triangle-closed.png" class="toggle-img" height="9px" width="9px">
Android NDK, Revision 8</a> <em>(May 2012)</em>
<div class="toggleme">
<p>This release of the NDK includes support for MIPS ABI and a few additional fixes.</p>
- </dl>
+ <dl>
<dt>New features:</dt>
<dd>
@@ -910,7 +1102,7 @@
as well as control over platform audio effects</li>
<li>Access to assets packaged in an <code>.apk</code> file.</li>
-
+
</ul>
</li>
@@ -927,7 +1119,7 @@
<li>Provides a default C++ STL implementation (based on STLport) as a helper module. It can be used either
as a static or shared library (details and usage examples are in sources/android/stlport/README). Prebuilt
binaries for STLport (static or shared) and GNU libstdc++ (static only) are also provided if you choose to
- compile against those libraries instead of the default C++ STL implementation.
+ compile against those libraries instead of the default C++ STL implementation.
C++ Exceptions and RTTI are not supported in the default STL implementation. For more information, see
docs/CPLUSPLUS-SUPPORT.HTML.</li>
@@ -938,8 +1130,8 @@
<li>Adds an EGL library that lets you create and manage OpenGL ES textures and
services.</li>
-
- <li>Adds new sample applications, <code>native-plasma</code> and <code>native-activity</code>,
+
+ <li>Adds new sample applications, <code>native-plasma</code> and <code>native-activity</code>,
to demonstrate how to write a native activity.</li>
<li>Includes many bugfixes and other small improvements; see docs/CHANGES.html for a more
@@ -1103,25 +1295,25 @@
</dl>
</div>
</div>
-
-
-
-
-
+
+
+
+
+
<!-- ####################### END OF RELEASE NOTES ####################### -->
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1287,32 +1479,32 @@
android:minSdkVersion="8" /></code> attribute value in its manifest.</li>
</ul>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
<h2 id="Installing">Installing the NDK</h2>
<p>Installing the NDK on your development computer is straightforward and involves extracting the
NDK from its download package.</p>
@@ -1339,7 +1531,7 @@
<p>You are now ready to start working with the NDK.</p>
-
+
<h2 id="GetStarted">Getting Started with the NDK</h2>
<p>Once you've installed the NDK successfully, take a few minutes to read the documentation
@@ -1402,13 +1594,13 @@
to use them or any other framework API, you can still write JNI code to do so.</p>
</li>
</ul>
-
-
-
-
-
+
+
+
+
+
<h2 id="Contents">Contents of the NDK</h2>
-
+
<p>The NDK contains the APIs, documentation, and sample
applications that help you write your native code. Specifically:</p>
@@ -1478,9 +1670,9 @@
<li>libjnigraphics (Pixel buffer access) header (for Android 2.2 and above).</li>
<li>A Minimal set of headers for C++ support</li>
-
+
<li>OpenSL ES native audio libraries</li>
-
+
<li>Android native application APIS</li>
</ul>
@@ -1510,13 +1702,13 @@
system</li>
<li>OVERVIEW.HTML — provides an overview of the NDK capabilities and usage</li>
-
+
<li>ANDROID-MK.HTML — describes the use of the Android.mk file, which defines the native
sources you want to compile</li>
-
+
<li>APPLICATION-MK.HTML — describes the use of the Application.mk file, which describes
- the native sources required by your Android application</li>
- <li>CPLUSPLUS-SUPPORT.HTML — describes the C++ support provided in the Android NDK</li>
+ the native sources required by your Android application</li>
+ <li>CPLUSPLUS-SUPPORT.HTML — describes the C++ support provided in the Android NDK</li>
<li>CPU-ARCH-ABIS.HTML — a description of supported CPU architectures and how to target
them.</li>
@@ -1527,15 +1719,15 @@
<li>CHANGES.HTML — a complete list of changes to the NDK across all releases.</li>
<li>DEVELOPMENT.HTML — describes how to modify the NDK and generate release packages for it</li>
-
+
<li>HOWTO.HTML — information about common tasks associated with NDK development</li>
-
+
<li>IMPORT-MODULE.HTML — describes how to share and reuse modules</li>
-
+
<li>LICENSES.HTML — information about the various open source licenses that govern the Android NDK</li>
-
+
<li>NATIVE-ACTIVITY.HTML — describes how to implement native activities</li>
-
+
<li>NDK-BUILD.HTML — describes the usage of the ndk-build script</li>
<li>NDK-GDB.HTML — describes how to use the native code debugger</li>
@@ -1544,13 +1736,13 @@
<li>STANDALONE-TOOLCHAIN.HTML — describes how to use Android NDK toolchain as a standalone
compiler (still in beta).</li>
-
+
<li>SYSTEM-ISSUES.HTML — known issues in the Android system images that you should be
aware of, if you are developing using the NDK.</li>
<li>STABLE-APIS.HTML — a complete list of the stable APIs exposed by headers in the
NDK.</li>
-
+
</ul>
<p>Additionally, the package includes detailed information about the "bionic" C library provided
@@ -1562,10 +1754,10 @@
offers.</li>
</ul>
-
-
-
-
+
+
+
+
<h3 id="Samples">Sample apps</h3>
<p>The NDK includes sample applications that illustrate how to use native code in your Android
@@ -1624,10 +1816,10 @@
<li>If you are developing with Ant, use the <code>android</code> tool to create the build file
for each of the sample projects at <code><ndk>/samples/<name>/</code>.
Then set up an AVD, if necessary, build your project in the usual way, and run it in the
- emulator.</li>
-
+ emulator.</li>
+
</ul>
-
+
<p>For more information about developing with the Android SDK tools and what
you need to do to create, build, and run your applications, see
the <a href="{@docRoot}tools/workflow/index.html">Overview</a>
diff --git a/docs/html/tools/sdk/tools-notes.jd b/docs/html/tools/sdk/tools-notes.jd
index 14d1aa4..039c4b5 100644
--- a/docs/html/tools/sdk/tools-notes.jd
+++ b/docs/html/tools/sdk/tools-notes.jd
@@ -24,51 +24,51 @@
<p>For a summary of all known issues in SDK Tools, see <a
href="http://tools.android.com/knownissues">http://tools.android.com/knownissues</a>.</p>
-<script type="text/javascript">
-function toggleDiv(link) {
- var toggleable = $(link).parent();
- if (toggleable.hasClass("closed")) {
- //$(".toggleme", toggleable).slideDown("fast");
- toggleable.removeClass("closed");
- toggleable.addClass("open");
- $(".toggle-img", toggleable).attr("title", "hide").attr("src", (toRoot + "assets/images/triangle-opened.png"));
- } else {
- //$(".toggleme", toggleable).slideUp("fast");
- toggleable.removeClass("open");
- toggleable.addClass("closed");
- $(".toggle-img", toggleable).attr("title", "show").attr("src", (toRoot + "assets/images/triangle-closed.png"));
- }
- return false;
-}
-</script>
-<style>
-.toggleable {
-padding: 5px 0 0;
-}
-.toggleme {
- padding: 10px 0 0 20px;
-}
-.toggleable a {
- text-decoration:none;
-}
-.toggleme a {
- text-decoration:underline;
-}
-.toggleable.closed .toggleme {
- display:none;
-}
-#jd-content .toggle-img {
- margin:0 5px 3px 0;
-}
-</style>
-<div class="toggleable opened">
- <a href="#" onclick="return toggleDiv(this)">
- <img src="{@docRoot}assets/images/triangle-opened.png" class="toggle-img" height="9px"
- width="9px" />
- SDK Tools, Revision 20</a> <em>(June 2012)</em>
+<div class="toggle-content opened">
+ <p><a href="#" onclick="return toggleContent(this)">
+ <img src="{@docRoot}assets/images/triangle-opened.png" class="toggle-content-img"
+ alt=""/>SDK Tools, Revision 20.0.1</a> <em>(July 2012)</em>
+ </p>
- <div class="toggleme">
+ <div class="toggle-content-toggleme">
+
+ <dl>
+ <dt>Dependencies:</dt>
+ <dd>
+ <ul>
+ <li>Android SDK Platform-tools revision 12 or later.</li>
+ <li>If you are developing in Eclipse with ADT, note that the SDK Tools r20.0.1 is designed
+ for use with ADT 20.0.1 and later. If you haven't already, update your
+ <a href="{@docRoot}tools/sdk/eclipse-adt.html">ADT Plugin</a> to 20.0.1.</li>
+ <li>If you are developing outside Eclipse, you must have
+ <a href="http://ant.apache.org/">Apache Ant</a> 1.8 or later.</li>
+ </ul>
+ </dd>
+ <dt>Bug fixes:</dt>
+ <dd>
+ <ul>
+ <li>Fixed wrong check on build state that forced repetitive Java code recompilation.</li>
+ <li>Fixed problems with running more than one emulator and running multiple emulators
+with GPU acceleration.</li>
+ <li>Improved resize algorithm for better rendering on scaled emulator windows.</li>
+ <li>Fixed a bug in the {@code lint} check for unprotected broadcast receivers to ignore
+unprotected receivers for default Android actions.</li>
+ <li>Fixed build issue for projects using Renderscript.</li>
+ <li>Fixed memory leak in the emulator.</li>
+ </ul>
+ </dd>
+ </dl>
+ </div>
+</div>
+
+<div class="toggle-content closed">
+ <p><a href="#" onclick="return toggleContent(this)">
+ <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img"
+ alt=""/>SDK Tools, Revision 20</a> <em>(June 2012)</em>
+ </p>
+
+ <div class="toggle-content-toggleme">
<dl>
<dt>Dependencies:</dt>
<dd>
@@ -137,13 +137,13 @@
</div>
</div>
-<div class="toggleable closed">
- <a href="#" onclick="return toggleDiv(this)">
- <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-img" height="9px"
- width="9px" />
- SDK Tools, Revision 19</a> <em>(April 2012)</em>
+<div class="toggle-content closed">
+ <p><a href="#" onclick="return toggleContent(this)">
+ <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img"
+ alt=""/>SDK Tools, Revision 19</a> <em>(April 2012)</em>
+ </p>
- <div class="toggleme">
+ <div class="toggle-content-toggleme">
<p class="note"><strong>Note:</strong> This update of SDK Tools is only available through
the <a href="{@docRoot}sdk/exploring.html">Android SDK Manager</a>. Use this tool to
download and install this update.</p>
@@ -171,13 +171,13 @@
</div>
</div>
-<div class="toggleable closed">
- <a href="#" onclick="return toggleDiv(this)">
- <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-img" height="9px"
- width="9px" />
- SDK Tools, Revision 18</a> <em>(April 2012)</em>
+<div class="toggle-content closed">
+ <p><a href="#" onclick="return toggleContent(this)">
+ <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img"
+ alt=""/>SDK Tools, Revision 18</a> <em>(April 2012)</em>
+ </p>
- <div class="toggleme">
+ <div class="toggle-content-toggleme">
<p class="caution"><strong>Important:</strong> To download the new Android
4.0 system components from the Android SDK Manager, you must first update the
SDK tools to revision 14 or later and restart the Android SDK Manager. If you do not,
@@ -213,13 +213,13 @@
</div>
</div>
-<div class="toggleable closed">
- <a href="#" onclick="return toggleDiv(this)">
- <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-img" height="9px"
- width="9px" />
- SDK Tools, Revision 17</a> <em>(March 2012)</em>
+<div class="toggle-content closed">
+ <p><a href="#" onclick="return toggleContent(this)">
+ <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img"
+ alt=""/>SDK Tools, Revision 17</a> <em>(March 2012)</em>
+ </p>
- <div class="toggleme">
+ <div class="toggle-content-toggleme">
<p class="caution"><strong>Important:</strong> To download the new Android
4.0 system components from the Android SDK Manager, you must first update the
SDK tools to revision 14 or later and restart the Android SDK Manager. If you do not,
@@ -317,13 +317,13 @@
</div>
</div>
-<div class="toggleable closed">
- <a href="#" onclick="return toggleDiv(this)">
- <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-img" height="9px"
- width="9px" />
- SDK Tools, Revision 16</a> <em>(December 2011)</em>
+<div class="toggle-content closed">
+ <p><a href="#" onclick="return toggleContent(this)">
+ <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img"
+ alt=""/>SDK Tools, Revision 16</a> <em>(December 2011)</em>
+ </p>
- <div class="toggleme">
+ <div class="toggle-content-toggleme">
<p class="caution"><strong>Important:</strong> To download the new Android
4.0 system components from the Android SDK Manager, you must first update the
SDK tools to revision 14 or later and restart the Android SDK Manager. If you do not,
@@ -367,13 +367,13 @@
</div>
</div>
-<div class="toggleable closed">
- <a href="#" onclick="return toggleDiv(this)">
- <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-img" height="9px"
- width="9px" />
- SDK Tools, Revision 15</a> <em>(October 2011)</em>
+<div class="toggle-content closed">
+ <p><a href="#" onclick="return toggleContent(this)">
+ <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img"
+ alt=""/>SDK Tools, Revision 15</a> <em>(October 2011)</em>
+ </p>
- <div class="toggleme">
+ <div class="toggle-content-toggleme">
<p class="caution"><strong>Important:</strong> To download the new Android
4.0 system components from the Android SDK Manager, you must first update the
SDK tools to revision 14 or later and restart the Android SDK Manager. If you do not,
@@ -415,13 +415,13 @@
</div>
</div>
-<div class="toggleable closed">
- <a href="#" onclick="return toggleDiv(this)">
- <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-img" height="9px"
- width="9px" />
- SDK Tools, Revision 14</a> <em>(October 2011)</em>
+<div class="toggle-content closed">
+ <p><a href="#" onclick="return toggleContent(this)">
+ <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img"
+ alt=""/>SDK Tools, Revision 14</a> <em>(October 2011)</em>
+ </p>
- <div class="toggleme">
+ <div class="toggle-content-toggleme">
<p class="note"><strong>Important:</strong> To download the new Android
4.0 system components from the Android SDK Manager, you must first update the
SDK tools to revision 14 and restart the Android SDK Manager. If you do not,
@@ -470,12 +470,13 @@
</div>
</div>
-<div class="toggleable closed">
- <a href="#" onclick="return toggleDiv(this)">
- <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-img" height="9px"
- width="9px" />
-SDK Tools, Revision 13</a> <em>(September 2011)</em>
- <div class="toggleme">
+<div class="toggle-content closed">
+ <p><a href="#" onclick="return toggleContent(this)">
+ <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img"
+ alt=""/>SDK Tools, Revision 13</a> <em>(September 2011)</em>
+ </p>
+
+ <div class="toggle-content-toggleme">
<dl>
<dt>Dependencies:</dt>
<dd>
@@ -500,11 +501,13 @@
</div>
-<div class="toggleable closed">
- <a href="#" onclick="return toggleDiv(this)">
- <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-img" height="9px" width="9px" />
-SDK Tools, Revision 12</a> <em>(July 2011)</em>
- <div class="toggleme">
+<div class="toggle-content closed">
+ <p><a href="#" onclick="return toggleContent(this)">
+ <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img"
+ alt=""/>SDK Tools, Revision 12</a> <em>(July 2011)</em>
+ </p>
+
+ <div class="toggle-content-toggleme">
<dl>
<dt>Dependencies:</dt>
<dd>
@@ -526,11 +529,13 @@
</div>
</div>
-<div class="toggleable closed">
- <a href="#" onclick="return toggleDiv(this)">
- <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-img" height="9px" width="9px" />
-SDK Tools, Revision 11</a> <em>(May 2011)</em>
- <div class="toggleme">
+<div class="toggle-content closed">
+ <p><a href="#" onclick="return toggleContent(this)">
+ <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img"
+ alt=""/>SDK Tools, Revision 11</a> <em>(May 2011)</em>
+ </p>
+
+ <div class="toggle-content-toggleme">
<dl>
<dt>Dependencies:</dt>
<dd>
@@ -552,12 +557,13 @@
</div>
-<div class="toggleable closed">
- <a href="#" onclick="return toggleDiv(this)">
- <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-img" height="9px"
-width="9px" />
-SDK Tools, Revision 10</a> <em>(February 2011)</em>
- <div class="toggleme">
+<div class="toggle-content closed">
+ <p><a href="#" onclick="return toggleContent(this)">
+ <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img"
+ alt=""/>SDK Tools, Revision 10</a> <em>(February 2011)</em>
+ </p>
+
+ <div class="toggle-content-toggleme">
<dl>
<dt>Dependencies:</dt>
<dd>
@@ -582,11 +588,13 @@
-<div class="toggleable closed">
- <a href="#" onclick="return toggleDiv(this)">
- <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-img" height="9px" width="9px" />
-SDK Tools, Revision 9</a> <em>(January 2011)</em>
- <div class="toggleme">
+<div class="toggle-content closed">
+ <p><a href="#" onclick="return toggleContent(this)">
+ <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img"
+ alt=""/>SDK Tools, Revision 9</a> <em>(January 2011)</em>
+ </p>
+
+ <div class="toggle-content-toggleme">
<dl>
<dt>Dependencies:</dt>
<dd>
@@ -639,12 +647,13 @@
</div>
</div>
-<div class="toggleable closed">
- <a href="#" onclick="return toggleDiv(this)">
- <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-img" height="9px" width="9px" />
-SDK Tools, Revision 8</a> <em>(December 2010)</em>
- <div class="toggleme">
+<div class="toggle-content closed">
+ <p><a href="#" onclick="return toggleContent(this)">
+ <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img"
+ alt=""/>SDK Tools, Revision 8</a> <em>(December 2010)</em>
+ </p>
+ <div class="toggle-content-toggleme">
<dl>
<dt>Dependencies:</dt>
<dd>
@@ -706,12 +715,13 @@
</div>
</div>
-<div class="toggleable closed">
- <a href="#" onclick="return toggleDiv(this)">
- <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-img" height="9px" width="9px" />
-SDK Tools, Revision 7</a> <em>(September 2010)</em>
- <div class="toggleme">
+<div class="toggle-content closed">
+ <p><a href="#" onclick="return toggleContent(this)">
+ <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img"
+ alt=""/>SDK Tools, Revision 7</a> <em>(September 2010)</em>
+ </p>
+ <div class="toggle-content-toggleme">
<dl>
<dt>Dependencies:</dt>
<dd>
@@ -739,12 +749,13 @@
</div>
</div>
-<div class="toggleable closed">
- <a href="#" onclick="return toggleDiv(this)">
- <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-img" height="9px" width="9px" />
-SDK Tools, Revision 6</a> <em>(May 2010)</em>
- <div class="toggleme">
+<div class="toggle-content closed">
+ <p><a href="#" onclick="return toggleContent(this)">
+ <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img"
+ alt=""/>SDK Tools, Revision 6</a> <em>(May 2010)</em>
+ </p>
+ <div class="toggle-content-toggleme">
<dl>
<dt>Dependencies:</dt>
<dd>
@@ -769,12 +780,13 @@
</div>
</div>
-<div class="toggleable closed">
- <a href="#" onclick="return toggleDiv(this)">
- <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-img" height="9px" width="9px" />
-SDK Tools, Revision 5</a> <em>(March 2010)</em>
- <div class="toggleme">
+<div class="toggle-content closed">
+ <p><a href="#" onclick="return toggleContent(this)">
+ <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img"
+ alt=""/>SDK Tools, Revision 5</a> <em>(March 2010)</em>
+ </p>
+ <div class="toggle-content-toggleme">
<dl>
<dt>Dependencies:</dt>
<dd><ul>
@@ -817,12 +829,13 @@
</div>
</div>
-<div class="toggleable closed">
- <a href="#" onclick="return toggleDiv(this)">
- <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-img" height="9px" width="9px" />
-SDK Tools, Revision 4</a> <em>(December 2009)</em>
- <div class="toggleme">
+<div class="toggle-content closed">
+ <p><a href="#" onclick="return toggleContent(this)">
+ <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img"
+ alt=""/>SDK Tools, Revision 4</a> <em>(December 2009)</em>
+ </p>
+ <div class="toggle-content-toggleme">
<dl>
<dt>Dependencies:</dt>
<dd><p>SDK Tools r4 is compatible with ADT 0.9.5 and later, but not
@@ -866,12 +879,13 @@
</div>
</div>
-<div class="toggleable closed">
- <a href="#" onclick="return toggleDiv(this)">
- <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-img" height="9px" width="9px" />
-SDK Tools, Revision 3</a> <em>(October 2009)</em>
- <div class="toggleme">
+<div class="toggle-content closed">
+ <p><a href="#" onclick="return toggleContent(this)">
+ <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img"
+ alt=""/>SDK Tools, Revision 3</a> <em>(October 2009)</em>
+ </p>
+ <div class="toggle-content-toggleme">
<dl>
<dt>Dependencies:</dt>
<dd><p>SDK Tools r3 is compatible with ADT 0.9.4 and later, but not
diff --git a/docs/html/training/basics/firstapp/building-ui.jd b/docs/html/training/basics/firstapp/building-ui.jd
index f0ec79e..bc6c47c 100644
--- a/docs/html/training/basics/firstapp/building-ui.jd
+++ b/docs/html/training/basics/firstapp/building-ui.jd
@@ -18,7 +18,7 @@
<h2>This lesson teaches you to</h2>
<ol>
- <li><a href="#LinearLayout">Use a Linear Layout</a></li>
+ <li><a href="#LinearLayout">Create a Linear Layout</a></li>
<li><a href="#TextInput">Add a Text Field</a></li>
<li><a href="#Strings">Add String Resources</a></li>
<li><a href="#Button">Add a Button</a></li>
@@ -28,10 +28,9 @@
<h2>You should also read</h2>
<ul>
- <li><a href="{@docRoot}guide/topics/ui/declaring-layout.html">XML Layouts</a></li>
+ <li><a href="{@docRoot}guide/topics/ui/declaring-layout.html">Layouts</a></li>
</ul>
-
-
+
</div>
</div>
@@ -39,63 +38,68 @@
<p>The graphical user interface for an Android app is built using a hierarchy of {@link
android.view.View} and {@link android.view.ViewGroup} objects. {@link android.view.View} objects are
-usually UI widgets such as a button or text field and {@link android.view.ViewGroup} objects are
+usually UI widgets such as <a href="{@docRoot}guide/topics/ui/controls/button.html">buttons</a> or
+<a href="{@docRoot}guide/topics/ui/controls/text.html">text fields</a> and {@link
+android.view.ViewGroup} objects are
invisible view containers that define how the child views are laid out, such as in a
grid or a vertical list.</p>
<p>Android provides an XML vocabulary that corresponds to the subclasses of {@link
-android.view.View} and {@link android.view.ViewGroup} so you can define your UI in XML with a
-hierarchy of view elements.</p>
+android.view.View} and {@link android.view.ViewGroup} so you can define your UI in XML using
+a hierarchy of UI elements.</p>
<div class="sidebox-wrapper">
<div class="sidebox">
<h2>Alternative Layouts</h2>
- <p>Separating the UI layout into XML files is important for several reasons,
-but it's especially important on Android because it allows you to define alternative layouts for
+ <p>Declaring your UI layout in XML rather than runtime code is useful for several reasons,
+but it's especially important so you can create different layouts for
different screen sizes. For example, you can create two versions of a layout and tell
the system to use one on "small" screens and the other on "large" screens. For more information,
see the class about <a
href="{@docRoot}training/basics/supporting-devices/index.html">Supporting Different
-Hardware</a>.</p>
+Devices</a>.</p>
</div>
</div>
-<img src="{@docRoot}images/viewgroup.png" alt="" width="440" />
+<img src="{@docRoot}images/viewgroup.png" alt="" width="400" />
<p class="img-caption"><strong>Figure 1.</strong> Illustration of how {@link
-android.view.ViewGroup} objects form branches in the layout and contain {@link
+android.view.ViewGroup} objects form branches in the layout and contain other {@link
android.view.View} objects.</p>
-<p>In this lesson, you'll create a layout in XML that includes a text input field and a
+<p>In this lesson, you'll create a layout in XML that includes a text field and a
button. In the following lesson, you'll respond when the button is pressed by sending the
content of the text field to another activity.</p>
-<h2 id="LinearLayout">Use a Linear Layout</h2>
+<h2 id="LinearLayout">Create a Linear Layout</h2>
-<p>Open the <code>main.xml</code> file from the <code>res/layout/</code>
-directory (every new Android project includes this file by default).</p>
+<p>Open the <code>activity_main.xml</code> file from the <code>res/layout/</code>
+directory.</p>
<p class="note"><strong>Note:</strong> In Eclipse, when you open a layout file, you’re first shown
-the ADT Layout Editor. This is an editor that helps you build layouts using WYSIWYG tools. For this
-lesson, you’re going to work directly with the XML, so click the <em>main.xml</em> tab at
+the Graphical Layout editor. This is an editor that helps you build layouts using WYSIWYG tools. For this
+lesson, you’re going to work directly with the XML, so click the <em>activity_main.xml</em> tab at
the bottom of the screen to open the XML editor.</p>
-<p>By default, the <code>main.xml</code> file includes a layout with a {@link
-android.widget.LinearLayout} root view group and a {@link android.widget.TextView} child view.
-You’re going to re-use the {@link android.widget.LinearLayout} in this lesson, but change its
-contents and layout orientation.</p>
+<p>The BlankActivity template you used to start this project creates the
+<code>activity_main.xml</code> file with a {@link
+android.widget.RelativeLayout} root view and a {@link android.widget.TextView} child view.</p>
-<p>First, delete the {@link android.widget.TextView} element and change the value
+<p>First, delete the {@link android.widget.TextView <TextView>} element and change the {@link
+ android.widget.RelativeLayout <RelativeLayout>} element to {@link
+ android.widget.LinearLayout <LinearLayout>}. Then add the
<a href="{@docRoot}reference/android/widget/LinearLayout.html#attr_android:orientation">{@code
-android:orientation}</a> to be <code>"horizontal"</code>. The result looks like this:</p>
+android:orientation}</a> attribute and set it to <code>"horizontal"</code>.
+The result looks like this:</p>
<pre>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
android:orientation="horizontal" >
</LinearLayout>
</pre>
@@ -116,26 +120,18 @@
<p>Because the {@link android.widget.LinearLayout} is the root view in the layout, it should fill
the entire screen area that's
available to the app by setting the width and height to
-<code>"fill_parent"</code>.</p>
-
-<p class="note"><strong>Note:</strong> Beginning with Android 2.2 (API level 8),
-<code>"fill_parent"</code> has been renamed <code>"match_parent"</code> to better reflect the
-behavior. The reason is that if you set a view to <code>"fill_parent"</code> it does not expand to
-fill the remaining space after sibling views are considered, but instead expands to
-<em>match</em> the size of the parent view no matter what—it will overlap any sibling
-views.</p>
+<code>"match_parent"</code>. This value declares that the view should expand its width
+or height to <em>match</em> the width or height of the parent view.</p>
<p>For more information about layout properties, see the <a
-href="{@docRoot}guide/topics/ui/declaring-layout.html">XML Layout</a> guide.</p>
+href="{@docRoot}guide/topics/ui/declaring-layout.html">Layout</a> guide.</p>
<h2 id="TextInput">Add a Text Field</h2>
<p>To create a user-editable text field, add an {@link android.widget.EditText
-<EditText>} element inside the {@link android.widget.LinearLayout <LinearLayout>}. The {@link
-android.widget.EditText} class is a subclass of {@link android.view.View} that displays an editable
-text field.</p>
+<EditText>} element inside the {@link android.widget.LinearLayout <LinearLayout>}.</p>
<p>Like every {@link android.view.View} object, you must define certain XML attributes to specify
the {@link android.widget.EditText} object's properties. Here’s how you should declare it
@@ -164,6 +160,8 @@
which allows you to reference that view from other code.</p>
<p>The SDK tools generate the {@code R.java} each time you compile your app. You should never
modify this file by hand.</p>
+ <p>For more information, read the guide to <a
+href="{@docRoot}guide/topics/resources/providing-resources.html">Providing Resources</a>.</p>
</div>
</div>
@@ -175,17 +173,18 @@
from your app code, such as to read and manipulate the object (you'll see this in the next
lesson).
-<p>The at-symbol (<code>@</code>) is required when you want to refer to a resource object from
-XML, followed by the resource type ({@code id} in this case), then the resource name ({@code
-edit_message}). (Other resources can use the same name as long as they are not the same
-resource type—for example, the string resource uses the same name.)</p>
+<p>The at sign (<code>@</code>) is required when you're referring to any resource object from
+XML. It is followed by the resource type ({@code id} in this case), a slash, then the resource name
+({@code edit_message}).</p>
-<p>The plus-symbol (<code>+</code>) is needed only when you're defining a resource ID for the
-first time. It tells the SDK tools that the resource ID needs to be created. Thus, when the app is
-compiled, the SDK tools use the ID value, <code>edit_message</code>, to create a new identifier in
-your project's {@code gen/R.java} file that is now associated with the {@link
-android.widget.EditText} element. Once the resource ID is created, other references to the ID do not
-need the plus symbol. This is the only attribute that may need the plus-symbol. See the sidebox for
+<p>The plus sign (<code>+</code>) before the resource type is needed only when you're defining a
+resource ID for the first time. When you compile the app,
+the SDK tools use the ID name to create a new resource ID in
+your project's {@code gen/R.java} file that refers to the {@link
+android.widget.EditText} element. Once the resource ID is declared once this way,
+other references to the ID do not
+need the plus sign. Using the plus sign is necessary only when specifying a new resource ID and not
+needed for concrete resources such as strings or layouts. See the sidebox for
more information about resource objects.</p></dd>
<dt><a
@@ -195,39 +194,42 @@
android:layout_height}</a></dt>
<dd>Instead of using specific sizes for the width and height, the <code>"wrap_content"</code> value
specifies that the view should be only as big as needed to fit the contents of the view. If you
-were to instead use <code>"fill_parent"</code>, then the {@link android.widget.EditText}
-element would fill the screen, because it'd match the size of the parent {@link
+were to instead use <code>"match_parent"</code>, then the {@link android.widget.EditText}
+element would fill the screen, because it would match the size of the parent {@link
android.widget.LinearLayout}. For more information, see the <a
-href="{@docRoot}guide/topics/ui/declaring-layout.html">XML Layouts</a> guide.</dd>
+href="{@docRoot}guide/topics/ui/declaring-layout.html">Layouts</a> guide.</dd>
<dt><a
href="{@docRoot}reference/android/widget/TextView.html#attr_android:hint">{@code
android:hint}</a></dt>
<dd>This is a default string to display when the text field is empty. Instead of using a hard-coded
-string as the value, the {@code "@string/edit_message"} value refers to a string resource defined
-in a separate file. Because this value refers to an existing resource, it does not need the
-plus-symbol. However, because you haven't defined the string resource yet, you’ll see a compiler
-error when you add the {@code "@string/edit_message"} value. You'll fix this in the next section by
-defining the string resource.</dd>
+string as the value, the {@code "@string/edit_message"} value refers to a string resource defined in
+a separate file. Because this refers to a concrete resource (not just an identifier), it does not
+need the plus sign. However, because you haven't defined the string resource yet, you’ll see a
+compiler error at first. You'll fix this in the next section by defining the string.
+<p class="note"><strong>Note:</strong> This string resource has the same name as the element ID:
+{@code edit_message}. However, references
+to resources are always scoped by the resource type (such as {@code id} or {@code string}), so using
+the same name does not cause collisions.</p>
+</dd>
</dl>
<h2 id="Strings">Add String Resources</h2>
-<p>When you need to add text in the user interface, you should always specify each string of text in
-a resource file. String resources allow you to maintain a single location for all string
-values, which makes it easier to find and update text. Externalizing the strings also allows you to
+<p>When you need to add text in the user interface, you should always specify each string as
+a resource. String resources allow you to manage all UI text in a single location,
+which makes it easier to find and update text. Externalizing the strings also allows you to
localize your app to different languages by providing alternative definitions for each
-string.</p>
+string resource.</p>
<p>By default, your Android project includes a string resource file at
-<code>res/values/strings.xml</code>. Open this file, delete the existing <code>"hello"</code>
-string, and add one for the
-<code>"edit_message"</code> string used by the {@link android.widget.EditText <EditText>}
-element.</p>
+<code>res/values/strings.xml</code>. Open this file and delete the {@code <string>} element
+named <code>"hello_world"</code>. Then add a new one named
+<code>"edit_message"</code> and set the value to "Enter a message."</p>
-<p>While you’re in this file, also add a string for the button you’ll soon add, called
+<p>While you’re in this file, also add a "Send" string for the button you’ll soon add, called
<code>"button_send"</code>.</p>
<p>The result for <code>strings.xml</code> looks like this:</p>
@@ -238,12 +240,14 @@
<string name="app_name">My First App</string>
<string name="edit_message">Enter a message</string>
<string name="button_send">Send</string>
+ <string name="menu_settings">Settings</string>
+ <string name="title_activity_main">MainActivity</string>
</resources>
</pre>
-<p>For more information about using string resources to localize your app for several languages,
+<p>For more information about using string resources to localize your app for other languages,
see the <a
-href="{@docRoot}training/basics/supporting-devices/index.html">Supporting Various Devices</a>
+href="{@docRoot}training/basics/supporting-devices/index.html">Supporting Different Devices</a>
class.</p>
@@ -280,23 +284,26 @@
<code>"wrap_content"</code>.</p>
<p>This works fine for the button, but not as well for the text field, because the user might type
-something longer and there's extra space left on the screen. So, it'd be nice to fill that width
-using the text field.
-{@link android.widget.LinearLayout} enables such a design with the <em>weight</em> property, which
+something longer. So, it would be nice to fill the unused screen width
+with the text field. You can do this inside a
+{@link android.widget.LinearLayout} with the <em>weight</em> property, which
you can specify using the <a
href="{@docRoot}reference/android/widget/LinearLayout.LayoutParams.html#weight">{@code
android:layout_weight}</a> attribute.</p>
-<p>The weight value allows you to specify the amount of remaining space each view should consume,
-relative to the amount consumed by sibling views, just like the ingredients in a drink recipe: "2
+<p>The weight value is a number that specifies the amount of remaining space each view should
+consume,
+relative to the amount consumed by sibling views. This works kind of like the
+amount of ingredients in a drink recipe: "2
parts vodka, 1 part coffee liqueur" means two-thirds of the drink is vodka. For example, if you give
-one view a weight of 2 and another one a weight of 1, the sum is 3, so the first view gets 2/3 of
-the remaining space and the second view gets the rest. If you give a third view a weight of 1,
-then the first view now gets 1/2 the remaining space, while the remaining two each get 1/4.</p>
+one view a weight of 2 and another one a weight of 1, the sum is 3, so the first view fills 2/3 of
+the remaining space and the second view fills the rest. If you add a third view and give it a weight
+of 1, then the first view (with weight of 2) now gets 1/2 the remaining space, while the remaining
+two each get 1/4.</p>
<p>The default weight for all views is 0, so if you specify any weight value
-greater than 0 to only one view, then that view fills whatever space remains after each view is
-given the space it requires. So, to fill the remaining space with the {@link
+greater than 0 to only one view, then that view fills whatever space remains after all views are
+given the space they require. So, to fill the remaining space in your layout with the {@link
android.widget.EditText} element, give it a weight of 1 and leave the button with no weight.</p>
<pre>
@@ -331,8 +338,9 @@
<pre>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
android:orientation="horizontal">
<EditText android:id="@+id/edit_message"
android:layout_weight="1"
@@ -351,7 +359,8 @@
results:</p>
<ul>
- <li>In Eclipse, click <strong>Run</strong> from the toolbar.</li>
+ <li>In Eclipse, click Run <img src="{@docRoot}images/tools/eclipse-run.png"
+ style="vertical-align:baseline;margin:0" /> from the toolbar.</li>
<li>Or from a command line, change directories to the root of your Android project and
execute:
<pre>
diff --git a/docs/html/training/basics/firstapp/creating-project.jd b/docs/html/training/basics/firstapp/creating-project.jd
index 4fbfe34..97f2a5d 100644
--- a/docs/html/training/basics/firstapp/creating-project.jd
+++ b/docs/html/training/basics/firstapp/creating-project.jd
@@ -34,66 +34,77 @@
<p>An Android project contains all the files that comprise the source code for your Android
app. The Android SDK tools make it easy to start a new Android project with a set of
-default project directories and files.</p>
+default project directories and files.</p>
<p>This lesson
shows how to create a new project either using Eclipse (with the ADT plugin) or using the
SDK tools from a command line.</p>
<p class="note"><strong>Note:</strong> You should already have the Android SDK installed, and if
-you're using Eclipse, you should have installed the <a
-href="{@docRoot}tools/sdk/eclipse-adt.html">ADT plugin</a> as well. If you have not installed
-these, see <a href="{@docRoot}sdk/installing/index.html">Installing the Android SDK</a> and return here
-when you've completed the installation.</p>
+you're using Eclipse, you should also have the <a
+href="{@docRoot}tools/sdk/eclipse-adt.html">ADT plugin</a> installed. If you don't have
+these, follow the guide to <a href="{@docRoot}sdk/installing/index.html">Installing the Android SDK</a>
+before you start this lesson.</p>
<h2 id="Eclipse">Create a Project with Eclipse</h2>
-<div class="figure" style="width:416px">
+<ol>
+ <li>In Eclipse, click New Android
+ App Project <img src="{@docRoot}images/tools/new_adt_project.png"
+ style="vertical-align:baseline;margin:0" />
+ in the toolbar. (If you don’t see this button,
+then you have not installed the ADT plugin—see <a
+href="{@docRoot}sdk/installing/installing-adt.html">Installing the Eclipse Plugin</a>.)
+ </li>
+
+<div class="figure" style="width:420px">
<img src="{@docRoot}images/training/firstapp/adt-firstapp-setup.png" alt="" />
-<p class="img-caption"><strong>Figure 1.</strong> The new project wizard in Eclipse.</p>
+<p class="img-caption"><strong>Figure 1.</strong> The New Android App Project wizard in Eclipse.</p>
</div>
-<ol>
- <li>In Eclipse, select <strong>File > New > Project</strong>.
-The resulting dialog should have a folder labeled <em>Android</em>. (If you don’t see the
-<em>Android</em> folder,
-then you have not installed the ADT plugin—see <a
-href="{@docRoot}tools/sdk/eclipse-adt.html#installing">Installing the ADT Plugin</a>).</li>
- <li>Open the <em>Android</em> folder, select <em>Android Project</em> and click
-<strong>Next</strong>.</li>
- <li>Enter a project name (such as "MyFirstApp") and click <strong>Next</strong>.</li>
- <li>Select a build target. This is the platform version against which you will compile your app.
-<p>We recommend that you select the latest version possible. You can still build your app to
-support older versions, but setting the build target to the latest version allows you to
-easily optimize your app for a great user experience on the latest Android-powered devices.</p>
-<p>If you don't see any built targets listed, you need to install some using the Android SDK
-Manager tool. See <a href="{@docRoot}sdk/installing/index.html#AddingComponents">step 4 in the
-installing guide</a>.</p>
-<p>Click <strong>Next</strong>.</p></li>
- <li>Specify other app details, such as the:
+ <li>Fill in the form that appears:
<ul>
- <li><em>Application Name</em>: The app name that appears to the user. Enter "My First
-App".</li>
- <li><em>Package Name</em>: The package namespace for your app (following the same
+ <li><em>Application Name</em> is the app name that appears to users.
+ For this project, use "My First App."</p></li>
+ <li><em>Project Name</em> is the name of your project directory and the name visible in Eclipse.</li>
+ <li><em>Package Name</em> is the package namespace for your app (following the same
rules as packages in the Java programming language). Your package name
-must be unique across all packages installed on the Android system. For this reason, it's important
-that you use a standard domain-style package name that’s appropriate to your company or
-publisher entity. For
-your first app, you can use something like "com.example.myapp." However, you cannot publish your
-app using the "com.example" namespace.</li>
- <li><em>Create Activity</em>: This is the class name for the primary user activity in your
-app (an activity represents a single screen in your app). Enter "MyFirstActivity".</li>
- <li><em>Minimum SDK</em>: Select <em>4 (Android 1.6)</em>.
- <p>Because this version is lower than the build target selected for the app, a warning
-appears, but that's alright. You simply need to be sure that you don't use any APIs that require an
-<a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level</a> greater than the minimum SDK
-version without first using some code to verify the device's system version (you'll see this in some
-other classes).</p>
- </li>
+must be unique across all packages installed on the Android system. For this reason, it's generally
+best if you use a name that begins with the reverse domain name of your organization or
+publisher entity. For this project, you can use something like "com.example.myfirstapp."
+However, you cannot publish your app on Google Play using the "com.example" namespace.</li>
+ <li><em>Build SDK</em> is the platform version against which you will compile your app.
+ By default, this is set to the latest version of Android available in your SDK. (It should
+ be Android 4.1 or greater; if you don't have such a version available, you must install one
+ using the <a href="{@docRoot}sdk/installing/adding-packages.html">SDK Manager</a>).
+ You can still build your app to
+support older versions, but setting the build target to the latest version allows you to
+enable new features and optimize your app for a great user experience on the latest
+devices.</li>
+ <li><em>Minimum Required SDK</em> is the lowest version of Android that your app supports.
+ To support as many devices as possible, you should set this to the lowest version available
+ that allows your app to provide its core feature set. If any feature of your app is possible
+ only on newer versions of Android and it's not critical to the app's core feature set, you
+ can enable the feature only when running on the versions that support it.
+ <p>Leave this set to the default value for this project.</p>
</ul>
- <p>Click <strong>Finish</strong>.</p>
+ <p>Click <strong>Next</strong>.</p>
</li>
+
+ <li>The following screen provides tools to help you create a launcher icon for your app.
+ <p>You can customize an icon in several ways and the tool generates an icon for all
+ screen densities. Before you publish your app, you should be sure your icon meets
+ the specifications defined in the <a
+ href="{@docRoot}design/style/iconography.html">Iconography</a>
+ design guide.</p>
+ <p>Click <strong>Next</strong>.</p>
+ </li>
+ <li>Now you can select an activity template from which to begin building your app.
+ <p>For this project, select <strong>BlankActivity</strong> and click <strong>Next</strong>.</p>
+ </li>
+ <li>Leave all the details for the activity in their default state and click
+ <strong>Finish</strong>.</li>
</ol>
<p>Your Android project is now set up with some default files and you’re ready to begin
@@ -104,7 +115,7 @@
<h2 id="CommandLine">Create a Project with Command Line Tools</h2>
<p>If you're not using the Eclipse IDE with the ADT plugin, you can instead create your project
-using the SDK tools in a command line:</p>
+using the SDK tools from a command line:</p>
<ol>
<li>Change directories into the Android SDK’s <code>tools/</code> path.</li>
@@ -117,13 +128,13 @@
your app for the latest devices.</p>
<p>If you don't see any targets listed, you need to
install some using the Android SDK
-Manager tool. See <a href="{@docRoot}sdk/installing/index.html#AddingComponents">step 4 in the
-installing guide</a>.</p></li>
+Manager tool. See <a href="{@docRoot}sdk/installing/adding-packages.html">Adding Platforms
+ and Packages</a>.</p></li>
<li>Execute:
<pre class="no-pretty-print">
android create project --target <target-id> --name MyFirstApp \
---path <path-to-workspace>/MyFirstApp --activity MyFirstActivity \
---package com.example.myapp
+--path <path-to-workspace>/MyFirstApp --activity MainActivity \
+--package com.example.myfirstapp
</pre>
<p>Replace <code><target-id></code> with an id from the list of targets (from the previous step)
and replace
diff --git a/docs/html/training/basics/firstapp/index.jd b/docs/html/training/basics/firstapp/index.jd
index 43b289b..e2b9cff 100644
--- a/docs/html/training/basics/firstapp/index.jd
+++ b/docs/html/training/basics/firstapp/index.jd
@@ -27,39 +27,21 @@
project and run a debuggable version of the app. You'll also learn some fundamentals of Android app
design, including how to build a simple user interface and handle user input.</p>
-<p>Before you start this class, be sure that you have your development environment set up. You need
+<p>Before you start this class, be sure you have your development environment set up. You need
to:</p>
<ol>
- <li>Download the Android SDK Starter Package.</li>
+ <li>Download the Android SDK.</li>
<li>Install the ADT plugin for Eclipse (if you’ll use the Eclipse IDE).</li>
<li>Download the latest SDK tools and platforms using the SDK Manager.</li>
</ol>
-<p>If you haven't already done this setup, read <a href="{@docRoot}sdk/installing/index.html">Installing
-the SDK</a>. Once you've finished the setup, you're ready to begin this class.</p>
+<p>If you haven't already done these tasks, start by downloading the
+ <a href="{@docRoot}sdk/index.html">Android SDK</a> and following the install steps.
+ Once you've finished the setup, you're ready to begin this class.</p>
-<p>This class uses a tutorial format that incrementally builds a small Android app in order to teach
+<p>This class uses a tutorial format that incrementally builds a small Android app that teaches
you some fundamental concepts about Android development, so it's important that you follow each
step.</p>
<p><strong><a href="creating-project.html">Start the first lesson ›</a></strong></p>
-
-<h2>Lessons</h2>
-
-<dl>
- <dt><b><a href="creating-project.html">Creating an Android Project</a></b></dt>
- <dd>Shows how to create a project for an Android app, which includes a set of default
-app files.</dd>
-
- <dt><b><a href="running-app.html">Running Your Application</a></b></dt>
- <dd>Shows how to run your app on an Android-powered device or the Android
-emulator.</dd>
-
- <dt><b><a href="building-ui.html">Building a Simple User Interface</a></b></dt>
- <dd>Shows how to create a new user interface using an XML file.</dd>
-
- <dt><b><a href="starting-activity.html">Starting Another Activity</a></b></dt>
- <dd>Shows how to respond to a button press, start another activity, send it some
-data, then receive the data in the subsequent activity.</dd>
-</dl>
diff --git a/docs/html/training/basics/firstapp/running-app.jd b/docs/html/training/basics/firstapp/running-app.jd
index 5105a3b..552d5fa 100644
--- a/docs/html/training/basics/firstapp/running-app.jd
+++ b/docs/html/training/basics/firstapp/running-app.jd
@@ -37,7 +37,7 @@
<p>If you followed the <a href="creating-project.html">previous lesson</a> to create an
Android project, it includes a default set of "Hello World" source files that allow you to
-run the app right away.</p>
+immediately run the app.</p>
<p>How you run your app depends on two things: whether you have a real Android-powered device and
whether you’re using Eclipse. This lesson shows you how to install and run your app on a
@@ -49,14 +49,16 @@
<dl>
<dt><code>AndroidManifest.xml</code></dt>
- <dd>This manifest file describes the fundamental characteristics of the app and defines each of
+ <dd>The <a href="{@docRoot}guide/topics/manifest/manifest-intro.html">manifest file</a> describes
+the fundamental characteristics of the app and defines each of
its components. You'll learn about various declarations in this file as you read more training
classes.</dd>
<dt><code>src/</code></dt>
<dd>Directory for your app's main source files. By default, it includes an {@link
android.app.Activity} class that runs when your app is launched using the app icon.</dd>
<dt><code>res/</code></dt>
- <dd>Contains several sub-directories for app resources. Here are just a few:
+ <dd>Contains several sub-directories for <a
+href="{@docRoot}guide/topics/resources/overview.html">app resources</a>. Here are just a few:
<dl style="margin-top:1em">
<dt><code>drawable-hdpi/</code></dt>
<dd>Directory for drawable objects (such as bitmaps) that are designed for high-density
@@ -70,30 +72,30 @@
</dd>
</dl>
-<p>When you build and run the default Android project, the default {@link android.app.Activity}
-class in the <code>src/</code> directory starts and loads a layout file from the
-<code>layout/</code> directory, which includes a "Hello World" message. Not real exciting, but it's
-important that you understand how to build and run your app before adding real functionality to
-the app.</p>
+<p>When you build and run the default Android app, the default {@link android.app.Activity}
+class starts and loads a layout file
+that says "Hello World." The result is nothing exciting, but it's
+important that you understand how to run your app before you start developing.</p>
<h2 id="RealDevice">Run on a Real Device</h2>
-<p>Whether you’re using Eclipse or the command line, you need to:</p>
+<p>If you have a real Android-powered device, here's how you can install and run your app:</p>
<ol>
- <li>Plug in your Android-powered device to your machine with a USB cable.
+ <li>Plug in your device to your development machine with a USB cable.
If you’re developing on Windows, you might need to install the appropriate USB driver for your
device. For help installing drivers, see the <a href="{@docRoot}tools/extras/oem-usb.html">OEM USB
Drivers</a> document.</li>
<li>Ensure that <strong>USB debugging</strong> is enabled in the device Settings (open Settings
-and navitage to <strong>Applications > Development</strong> on most devices, or select
+and navitage to <strong>Applications > Development</strong> on most devices, or click
<strong>Developer options</strong> on Android 4.0 and higher).</li>
</ol>
<p>To run the app from Eclipse, open one of your project's files and click
-<strong>Run</strong> from the toolbar. Eclipse installs the app on your connected device and starts
+Run <img src="{@docRoot}images/tools/eclipse-run.png" style="vertical-align:baseline;margin:0" />
+from the toolbar. Eclipse installs the app on your connected device and starts
it.</p>
@@ -108,18 +110,18 @@
<li>On your device, locate <em>MyFirstActivity</em> and open it.</li>
</ol>
-<p>To start adding stuff to the app, continue to the <a href="building-ui.html">next
+<p>That's how you build and run your Android app on a device!
+ To start developing, continue to the <a href="building-ui.html">next
lesson</a>.</p>
<h2 id="Emulator">Run on the Emulator</h2>
-<p>Whether you’re using Eclipse or the command line, you need to first create an <a
-href="{@docRoot}tools/devices/index.html">Android Virtual
-Device</a> (AVD). An AVD is a
-device configuration for the Android emulator that allows you to model
-different device configurations.</p>
+<p>Whether you’re using Eclipse or the command line, to run your app on the emulator you need to
+first create an <a href="{@docRoot}tools/devices/index.html">Android Virtual Device</a> (AVD). An
+AVD is a device configuration for the Android emulator that allows you to model different
+devices.</p>
<div class="figure" style="width:457px">
<img src="{@docRoot}images/screens_support/avds-config.png" alt="" />
@@ -131,13 +133,14 @@
<ol>
<li>Launch the Android Virtual Device Manager:
<ol type="a">
- <li>In Eclipse, select <strong>Window > AVD Manager</strong>, or click the <em>AVD
-Manager</em> icon in the Eclipse toolbar.</li>
- <li>From the command line, change directories to <code><sdk>/tools/</code> and execute:
-<pre class="no-pretty-print">./android avd</pre></li>
+ <li>In Eclipse, AVD Manager <img src="{@docRoot}images/tools/avd_manager.png"
+style="vertical-align:baseline;margin:0" /> in the toolbar.</li>
+ <li>From the command line, change
+directories to <code><sdk>/tools/</code> and execute:
+<pre class="no-pretty-print">android avd</pre></li>
</ol>
</li>
- <li>In the <em>Android Virtual Device Device Manager</em> panel, click <strong>New</strong>.</li>
+ <li>In the <em>Android Virtual Device Manager</em> panel, click <strong>New</strong>.</li>
<li>Fill in the details for the AVD.
Give it a name, a platform target, an SD card size, and a skin (HVGA is default).</li>
<li>Click <strong>Create AVD</strong>.</li>
@@ -147,7 +150,8 @@
</ol>
<p>To run the app from Eclipse, open one of your project's files and click
-<strong>Run</strong> from the toolbar. Eclipse installs the app on your AVD and starts it.</p>
+Run <img src="{@docRoot}images/tools/eclipse-run.png" style="vertical-align:baseline;margin:0" />
+from the toolbar. Eclipse installs the app on your AVD and starts it.</p>
<p>Or to run your app from the command line:</p>
@@ -163,7 +167,8 @@
</ol>
-<p>To start adding stuff to the app, continue to the <a href="building-ui.html">next
+<p>That's how you build and run your Android app on the emulator!
+ To start developing, continue to the <a href="building-ui.html">next
lesson</a>.</p>
diff --git a/docs/html/training/basics/firstapp/starting-activity.jd b/docs/html/training/basics/firstapp/starting-activity.jd
index 37bc871..cbd063a 100644
--- a/docs/html/training/basics/firstapp/starting-activity.jd
+++ b/docs/html/training/basics/firstapp/starting-activity.jd
@@ -43,8 +43,8 @@
<p>After completing the <a href="building-ui.html">previous lesson</a>, you have an app that
shows an activity (a single screen) with a text field and a button. In this lesson, you’ll add some
-code to <code>MyFirstActivity</code> that
-starts a new activity when the user selects the Send button.</p>
+code to <code>MainActivity</code> that
+starts a new activity when the user clicks the Send button.</p>
<h2 id="RespondToButton">Respond to the Send Button</h2>
@@ -64,13 +64,13 @@
<p>The <a
href="{@docRoot}reference/android/view/View.html#attr_android:onClick">{@code
-android:onClick}</a> attribute’s value, <code>sendMessage</code>, is the name of a method in your
-activity that you want to call when the user selects the button.</p>
+android:onClick}</a> attribute’s value, <code>"sendMessage"</code>, is the name of a method in your
+activity that the system calls when the user clicks the button.</p>
-<p>Add the corresponding method inside the <code>MyFirstActivity</code> class:</p>
+<p>Open the <code>MainActivity</code> class and add the corresponding method:</p>
<pre>
-/** Called when the user selects the Send button */
+/** Called when the user clicks the Send button */
public void sendMessage(View view) {
// Do something in response to button
}
@@ -79,7 +79,7 @@
<p class="note"><strong>Tip:</strong> In Eclipse, press Ctrl + Shift + O to import missing classes
(Cmd + Shift + O on Mac).</p>
-<p>Note that, in order for the system to match this method to the method name given to <a
+<p>In order for the system to match this method to the method name given to <a
href="{@docRoot}reference/android/view/View.html#attr_android:onClick">{@code android:onClick}</a>,
the signature must be exactly as shown. Specifically, the method must:</p>
@@ -99,11 +99,11 @@
<p>An {@link android.content.Intent} is an object that provides runtime binding between separate
components (such as two activities). The {@link android.content.Intent} represents an
-app’s "intent to do something." You can use an {@link android.content.Intent} for a wide
+app’s "intent to do something." You can use intents for a wide
variety of tasks, but most often they’re used to start another activity.</p>
<p>Inside the {@code sendMessage()} method, create an {@link android.content.Intent} to start
-an activity called {@code DisplayMessageActvity}:</p>
+an activity called {@code DisplayMessageActivity}:</p>
<pre>
Intent intent = new Intent(this, DisplayMessageActivity.class);
@@ -127,7 +127,7 @@
can also be <em>implicit</em>, in which case the {@link android.content.Intent} does not specify
the desired component, but allows any app installed on the device to respond to the intent
as long as it satisfies the meta-data specifications for the action that's specified in various
-{@link android.content.Intent} parameters. For more informations, see the class about <a
+{@link android.content.Intent} parameters. For more information, see the class about <a
href="{@docRoot}training/basics/intents/index.html">Interacting with Other Apps</a>.</p>
</div>
</div>
@@ -136,9 +136,9 @@
will raise an error if you’re using an IDE such as Eclipse because the class doesn’t exist yet.
Ignore the error for now; you’ll create the class soon.</p>
-<p>An intent not only allows you to start another activity, but can carry a bundle of data to the
+<p>An intent not only allows you to start another activity, but it can carry a bundle of data to the
activity as well. So, use {@link android.app.Activity#findViewById findViewById()} to get the
-{@link android.widget.EditText} element and add its message to the intent:</p>
+{@link android.widget.EditText} element and add its text value to the intent:</p>
<pre>
Intent intent = new Intent(this, DisplayMessageActivity.class);
@@ -148,37 +148,36 @@
</pre>
<p>An {@link android.content.Intent} can carry a collection of various data types as key-value
-pairs called <em>extras</em>. The {@link android.content.Intent#putExtra putExtra()} method takes a
-string as the key and the value in the second parameter.</p>
+pairs called <em>extras</em>. The {@link android.content.Intent#putExtra putExtra()} method takes the
+key name in the first parameter and the value in the second parameter.</p>
-<p>In order for the next activity to query the extra data, you should define your keys using a
+<p>In order for the next activity to query the extra data, you should define your key using a
public constant. So add the {@code EXTRA_MESSAGE} definition to the top of the {@code
-MyFirstActivity} class:</p>
+MainActivity} class:</p>
<pre>
-public class MyFirstActivity extends Activity {
- public final static String EXTRA_MESSAGE = "com.example.myapp.MESSAGE";
+public class MainActivity extends Activity {
+ public final static String EXTRA_MESSAGE = "com.example.myfirstapp.MESSAGE";
...
}
</pre>
-<p>It's generally a good practice to define keys for extras with your app's package name as a prefix
-to ensure it's unique, in case your app interacts with other apps.</p>
+<p>It's generally a good practice to define keys for intent extras using your app's package name
+as a prefix. This ensures they are unique, in case your app interacts with other apps.</p>
<h2 id="StartActivity">Start the Second Activity</h2>
<p>To start an activity, you simply need to call {@link android.app.Activity#startActivity
-startActivity()} and pass it your {@link android.content.Intent}.</p>
-
-<p>The system receives this call and starts an instance of the {@link android.app.Activity}
+startActivity()} and pass it your {@link android.content.Intent}. The system receives this call
+and starts an instance of the {@link android.app.Activity}
specified by the {@link android.content.Intent}.</p>
-<p>With this method included, the complete {@code sendMessage()} method that's invoked by the Send
+<p>With this new code, the complete {@code sendMessage()} method that's invoked by the Send
button now looks like this:</p>
<pre>
-/** Called when the user selects the Send button */
+/** Called when the user clicks the Send button */
public void sendMessage(View view) {
Intent intent = new Intent(this, DisplayMessageActivity.class);
EditText editText = (EditText) findViewById(R.id.edit_message);
@@ -195,20 +194,48 @@
<h2 id="CreateActivity">Create the Second Activity</h2>
-<p>In your project, create a new class file under the <code>src/<package-name>/</code>
-directory called <code>DisplayMessageActivity.java</code>.</p>
+<div class="figure" style="width:400px">
+<img src="{@docRoot}images/training/firstapp/adt-new-activity.png" alt="" />
+<p class="img-caption"><strong>Figure 1.</strong> The new activity wizard in Eclipse.</p>
+</div>
-<p class="note"><strong>Tip:</strong> In Eclipse, right-click the package name under the
-<code>src/</code> directory and select <strong>New > Class</strong>.
-Enter "DisplayMessageActivity" for the name and {@code android.app.Activity} for the superclass.</p>
+<p>To create a new activity using Eclipse:</p>
-<p>Inside the class, add the {@link android.app.Activity#onCreate onCreate()} callback method:</p>
+<ol>
+ <li>Click New <img src="{@docRoot}images/tools/eclipse-new.png"
+ style="vertical-align:baseline;margin:0" /> in the toolbar.</li>
+ <li>In the window that appears, open the <strong>Android</strong> folder
+ and select <strong>Android Activity</strong>. Click <strong>Next</strong>.</li>
+ <li>Select <strong>BlankActivity</strong> and click <strong>Next</strong>.</li>
+ <li>Fill in the activity details:
+ <ul>
+ <li><em>Project</em>: MyFirstApp</li>
+ <li><em>Activity Name</em>: DisplayMessageActivity</li>
+ <li><em>Layout Name</em>: activity_display_message</li>
+ <li><em>Navigation Type</em>: None</li>
+ <li><em>Hierarchial Parent</em>: com.example.myfirstapp.MainActivity</li>
+ <li><em>Title</em>: My Message</li>
+ </ul>
+ <p>Click <strong>Finish</strong>.</p>
+ </li>
+</ol>
+
+<p>If you're using a different IDE or the command line tools, create a new file named
+{@code DisplayMessageActivity.java} in the project's <code>src/</code> directory, next to
+the original {@code MainActivity.java} file.</p>
+
+<p>Open the {@code DisplayMessageActivity.java} file. If you used Eclipse to create it, the class
+already includes an implementation of the required {@link android.app.Activity#onCreate onCreate()}
+method. There's also an implemtation of the {@link android.app.Activity#onCreateOptionsMenu
+onCreateOptionsMenu()} method, but
+you won't need it for this app so you can remove it. The class should look like this:</p>
<pre>
public class DisplayMessageActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_display_message);
}
}
</pre>
@@ -216,7 +243,7 @@
<p>All subclasses of {@link android.app.Activity} must implement the {@link
android.app.Activity#onCreate onCreate()} method. The system calls this when creating a new
instance of the activity. It is where you must define the activity layout and where you should
-initialize essential activity components.</p>
+perform initial setup for the activity components.</p>
@@ -226,22 +253,39 @@
<a
href="{@docRoot}guide/topics/manifest/activity-element.html">{@code <activity>}</a> element.</p>
-<p>Because {@code DisplayMessageActivity} is invoked using an explicit intent, it does not require
-any intent filters (such as those you can see in the manifest for <code>MyFirstActivity</code>). So
-the declaration for <code>DisplayMessageActivity</code> can be simply one line of code inside the <a
-href="{@docRoot}guide/topics/manifest/application-element.html">{@code <application>}</a>
-element:</p>
+<p>When you use the Eclipse tools to create the activity, it creates a default entry. It should
+look like this:</p>
<pre>
<application ... >
- <activity android:name="com.example.myapp.DisplayMessageActivity" />
...
+ <activity
+ android:name=".DisplayMessageActivity"
+ android:label="@string/title_activity_display_message" >
+ <meta-data
+ android:name="android.support.PARENT_ACTIVITY"
+ android:value="com.example.myfirstapp.MainActivity" />
+ </activity>
</application>
</pre>
+<p>The <a href="{@docRoot}guide/topics/manifest/meta-data-element.html">{@code
+ <meta-data>}</a> element declares the name of this activity's parent activity
+ within the app's logical hierarchy. The Android <a
+href="{@docRoot}tools/extras/support-library.html">Support Library</a> uses this information
+ to implement default navigation behaviors, such as <a
+ href="{@docRoot}design/patterns/navigation.html">Up navigation</a>.</p>
+
+<p class="note"><strong>Note:</strong> During <a
+href="{@docRoot}sdk/installing/adding-packages.html">installation</a>, you should have downloaded
+the latest Support Library. Eclipse automatically includes this library in your app project (you
+can see the library's JAR file listed under <em>Android Dependencies</em>). If you're not using
+Eclipse, you may need to manually add the library to your project—follow this guide for <a
+href="{@docRoot}tools/extras/support-library.html#SettingUp">setting up the Support Library</a>.</p>
+
<p>The app is now runnable because the {@link android.content.Intent} in the
first activity now resolves to the {@code DisplayMessageActivity} class. If you run the app now,
-pressing the Send button starts the
+clicking the Send button starts the
second activity, but it doesn't show anything yet.</p>
@@ -249,15 +293,15 @@
<p>Every {@link android.app.Activity} is invoked by an {@link android.content.Intent}, regardless of
how the user navigated there. You can get the {@link android.content.Intent} that started your
-activity by calling {@link android.app.Activity#getIntent()} and the retrieve data contained
+activity by calling {@link android.app.Activity#getIntent()} and retrieve the data contained
within it.</p>
<p>In the {@code DisplayMessageActivity} class’s {@link android.app.Activity#onCreate onCreate()}
-method, get the intent and extract the message delivered by {@code MyFirstActivity}:</p>
+method, get the intent and extract the message delivered by {@code MainActivity}:</p>
<pre>
Intent intent = getIntent();
-String message = intent.getStringExtra(MyFirstActivity.EXTRA_MESSAGE);
+String message = intent.getStringExtra(MainActivity.EXTRA_MESSAGE);
</pre>
@@ -279,22 +323,23 @@
// Get the message from the intent
Intent intent = getIntent();
- String message = intent.getStringExtra(MyFirstActivity.EXTRA_MESSAGE);
+ String message = intent.getStringExtra(MainActivity.EXTRA_MESSAGE);
// Create the text view
TextView textView = new TextView(this);
textView.setTextSize(40);
textView.setText(message);
+ // Set the text view as the activity layout
setContentView(textView);
}
</pre>
-<p>You can now run the app, type a message in the text field, press Send, and view the message on
-the second activity.</p>
+<p>You can now run the app. When it opens, type a message in the text field, click Send,
+ and the message appears on the second activity.</p>
<img src="{@docRoot}images/training/firstapp/firstapp.png" />
-<p class="img-caption"><strong>Figure 1.</strong> Both activities in the final app, running
+<p class="img-caption"><strong>Figure 2.</strong> Both activities in the final app, running
on Android 4.0.
<p>That's it, you've built your first Android app!</p>
diff --git a/keystore/tests/src/android/security/KeyStoreTest.java b/keystore/tests/src/android/security/KeyStoreTest.java
index 008d682..91c56d6 100755
--- a/keystore/tests/src/android/security/KeyStoreTest.java
+++ b/keystore/tests/src/android/security/KeyStoreTest.java
@@ -35,9 +35,9 @@
public class KeyStoreTest extends ActivityUnitTestCase<Activity> {
private static final String TEST_PASSWD = "12345678";
private static final String TEST_PASSWD2 = "87654321";
- private static final String TEST_KEYNAME = "testkey";
- private static final String TEST_KEYNAME1 = "testkey1";
- private static final String TEST_KEYNAME2 = "testkey2";
+ private static final String TEST_KEYNAME = "test-key";
+ private static final String TEST_KEYNAME1 = "test-key.1";
+ private static final String TEST_KEYNAME2 = "test-key.2";
private static final byte[] TEST_KEYVALUE = "test value".getBytes(Charsets.UTF_8);
// "Hello, World" in Chinese
@@ -45,10 +45,12 @@
private static final byte[] TEST_I18N_VALUE = TEST_I18N_KEY.getBytes(Charsets.UTF_8);
// Test vector data for signatures
- private static final byte[] TEST_DATA = {
- (byte) 0x00, (byte) 0xA0, (byte) 0xFF, (byte) 0x0A, (byte) 0x00, (byte) 0xFF,
- (byte) 0xAA, (byte) 0x55, (byte) 0x05, (byte) 0x5A,
- };
+ private static final byte[] TEST_DATA = new byte[256];
+ static {
+ for (int i = 0; i < TEST_DATA.length; i++) {
+ TEST_DATA[i] = (byte) i;
+ }
+ }
private KeyStore mKeyStore = null;
@@ -155,9 +157,9 @@
}
public void testDelete() throws Exception {
- assertTrue(mKeyStore.delete(TEST_KEYNAME));
+ assertFalse(mKeyStore.delete(TEST_KEYNAME));
mKeyStore.password(TEST_PASSWD);
- assertTrue(mKeyStore.delete(TEST_KEYNAME));
+ assertFalse(mKeyStore.delete(TEST_KEYNAME));
mKeyStore.put(TEST_KEYNAME, TEST_KEYVALUE);
assertTrue(Arrays.equals(TEST_KEYVALUE, mKeyStore.get(TEST_KEYNAME)));
diff --git a/libs/hwui/Debug.h b/libs/hwui/Debug.h
index 7d150bb..6795ac3 100644
--- a/libs/hwui/Debug.h
+++ b/libs/hwui/Debug.h
@@ -65,9 +65,6 @@
// Turn on to enable additional debugging in the font renderers
#define DEBUG_FONT_RENDERER 0
-// Force gamma correction in shaders
-#define DEBUG_FONT_RENDERER_FORCE_SHADER_GAMMA 0
-
// Turn on to dump display list state
#define DEBUG_DISPLAY_LIST 0
diff --git a/libs/hwui/DisplayListRenderer.cpp b/libs/hwui/DisplayListRenderer.cpp
index 133f63f..7161c58 100644
--- a/libs/hwui/DisplayListRenderer.cpp
+++ b/libs/hwui/DisplayListRenderer.cpp
@@ -61,9 +61,9 @@
"DrawPath",
"DrawLines",
"DrawPoints",
- "DrawText",
"DrawTextOnPath",
"DrawPosText",
+ "DrawGeneralText",
"ResetShader",
"SetupShader",
"ResetColorFilter",
@@ -572,17 +572,6 @@
ALOGD("%s%s", (char*) indent, OP_NAMES[op]);
}
break;
- case DrawText: {
- getText(&text);
- int32_t count = getInt();
- float x = getFloat();
- float y = getFloat();
- SkPaint* paint = getPaint(renderer);
- float length = getFloat();
- ALOGD("%s%s %s, %d, %d, %.2f, %.2f, %p, %.2f", (char*) indent, OP_NAMES[op],
- text.text(), text.length(), count, x, y, paint, length);
- }
- break;
case DrawTextOnPath: {
getText(&text);
int32_t count = getInt();
@@ -603,6 +592,17 @@
ALOGD("%s%s %s, %d, %d, %p", (char*) indent, OP_NAMES[op],
text.text(), text.length(), count, paint);
}
+ break;
+ case DrawGeneralText: {
+ getText(&text);
+ int count = getInt();
+ int positionsCount = 0;
+ float* positions = getFloats(positionsCount);
+ SkPaint* paint = getPaint(renderer);
+ ALOGD("%s%s %s, %d, %d, %p", (char*) indent, OP_NAMES[op],
+ text.text(), text.length(), count, paint);
+ }
+ break;
case ResetShader: {
ALOGD("%s%s", (char*) indent, OP_NAMES[op]);
}
@@ -1196,19 +1196,6 @@
drawGlStatus |= renderer.drawPoints(points, count, paint);
}
break;
- case DrawText: {
- getText(&text);
- int32_t count = getInt();
- float x = getFloat();
- float y = getFloat();
- SkPaint* paint = getPaint(renderer);
- float length = getFloat();
- DISPLAY_LIST_LOGD("%s%s %s, %d, %d, %.2f, %.2f, %p, %.2f", (char*) indent,
- OP_NAMES[op], text.text(), text.length(), count, x, y, paint, length);
- drawGlStatus |= renderer.drawText(text.text(), text.length(), count, x, y,
- paint, length);
- }
- break;
case DrawTextOnPath: {
getText(&text);
int32_t count = getInt();
@@ -1234,6 +1221,21 @@
positions, paint);
}
break;
+ case DrawGeneralText: {
+ getText(&text);
+ int32_t count = getInt();
+ float x = getFloat();
+ float y = getFloat();
+ int32_t positionsCount = 0;
+ float* positions = getFloats(positionsCount);
+ SkPaint* paint = getPaint(renderer);
+ float length = getFloat();
+ DISPLAY_LIST_LOGD("%s%s %s, %d, %d, %.2f, %.2f, %p, %.2f", (char*) indent,
+ OP_NAMES[op], text.text(), text.length(), count, x, y, paint, length);
+ drawGlStatus |= renderer.drawGeneralText(text.text(), text.length(), count,
+ x, y, positions, paint, length);
+ }
+ break;
case ResetShader: {
DISPLAY_LIST_LOGD("%s%s", (char*) indent, OP_NAMES[op]);
renderer.resetShader();
@@ -1684,37 +1686,6 @@
return DrawGlInfo::kStatusDone;
}
-status_t DisplayListRenderer::drawText(const char* text, int bytesCount, int count,
- float x, float y, SkPaint* paint, float length) {
- if (!text || count <= 0) return DrawGlInfo::kStatusDone;
-
- // TODO: We should probably make a copy of the paint instead of modifying
- // it; modifying the paint will change its generationID the first
- // time, which might impact caches. More investigation needed to
- // see if it matters.
- // If we make a copy, then drawTextDecorations() should *not* make
- // its own copy as it does right now.
- // Beware: this needs Glyph encoding (already done on the Paint constructor)
- paint->setAntiAlias(true);
- if (length < 0.0f) length = paint->measureText(text, bytesCount);
-
- bool reject = false;
- if (CC_LIKELY(paint->getTextAlign() == SkPaint::kLeft_Align)) {
- SkPaint::FontMetrics metrics;
- paint->getFontMetrics(&metrics, 0.0f);
- reject = quickReject(x, y + metrics.fTop, x + length, y + metrics.fBottom);
- }
-
- uint32_t* location = addOp(DisplayList::DrawText, reject);
- addText(text, bytesCount);
- addInt(count);
- addPoint(x, y);
- addPaint(paint);
- addFloat(length);
- addSkip(location);
- return DrawGlInfo::kStatusDone;
-}
-
status_t DisplayListRenderer::drawTextOnPath(const char* text, int bytesCount, int count,
SkPath* path, float hOffset, float vOffset, SkPaint* paint) {
if (!text || count <= 0) return DrawGlInfo::kStatusDone;
@@ -1741,6 +1712,39 @@
return DrawGlInfo::kStatusDone;
}
+status_t DisplayListRenderer::drawGeneralText(const char* text, int bytesCount, int count,
+ float x, float y, const float* positions, SkPaint* paint, float length) {
+ if (!text || count <= 0) return DrawGlInfo::kStatusDone;
+
+ // TODO: We should probably make a copy of the paint instead of modifying
+ // it; modifying the paint will change its generationID the first
+ // time, which might impact caches. More investigation needed to
+ // see if it matters.
+ // If we make a copy, then drawTextDecorations() should *not* make
+ // its own copy as it does right now.
+ // Beware: this needs Glyph encoding (already done on the Paint constructor)
+ paint->setAntiAlias(true);
+ if (length < 0.0f) length = paint->measureText(text, bytesCount);
+
+ bool reject = false;
+ if (CC_LIKELY(paint->getTextAlign() == SkPaint::kLeft_Align)) {
+ SkPaint::FontMetrics metrics;
+ paint->getFontMetrics(&metrics, 0.0f);
+ reject = quickReject(x, y + metrics.fTop, x + length, y + metrics.fBottom);
+ }
+
+ uint32_t* location = addOp(DisplayList::DrawGeneralText, reject);
+ addText(text, bytesCount);
+ addInt(count);
+ addFloat(x);
+ addFloat(y);
+ addFloats(positions, count * 2);
+ addPaint(paint);
+ addFloat(length);
+ addSkip(location);
+ return DrawGlInfo::kStatusDone;
+}
+
void DisplayListRenderer::resetShader() {
addOp(DisplayList::ResetShader);
}
diff --git a/libs/hwui/DisplayListRenderer.h b/libs/hwui/DisplayListRenderer.h
index 6b4c6b2..f3041dd 100644
--- a/libs/hwui/DisplayListRenderer.h
+++ b/libs/hwui/DisplayListRenderer.h
@@ -103,9 +103,9 @@
DrawPath,
DrawLines,
DrawPoints,
- DrawText,
DrawTextOnPath,
DrawPosText,
+ DrawGeneralText,
ResetShader,
SetupShader,
ResetColorFilter,
@@ -599,12 +599,12 @@
virtual status_t drawPath(SkPath* path, SkPaint* paint);
virtual status_t drawLines(float* points, int count, SkPaint* paint);
virtual status_t drawPoints(float* points, int count, SkPaint* paint);
- virtual status_t drawText(const char* text, int bytesCount, int count, float x, float y,
- SkPaint* paint, float length = -1.0f);
virtual status_t drawTextOnPath(const char* text, int bytesCount, int count, SkPath* path,
float hOffset, float vOffset, SkPaint* paint);
virtual status_t drawPosText(const char* text, int bytesCount, int count,
const float* positions, SkPaint* paint);
+ virtual status_t drawGeneralText(const char* text, int bytesCount, int count,
+ float x, float y, const float* positions, SkPaint* paint, float length);
virtual void resetShader();
virtual void setupShader(SkiaShader* shader);
diff --git a/libs/hwui/Extensions.h b/libs/hwui/Extensions.h
index 6b174d6..fb945a8 100644
--- a/libs/hwui/Extensions.h
+++ b/libs/hwui/Extensions.h
@@ -39,9 +39,6 @@
#define EXT_LOGD(...)
#endif
-// Vendor strings
-#define VENDOR_IMG "Imagination Technologies"
-
///////////////////////////////////////////////////////////////////////////////
// Classes
///////////////////////////////////////////////////////////////////////////////
@@ -69,10 +66,6 @@
mHasDebugMarker = hasExtension("GL_EXT_debug_marker");
mHasDebugLabel = hasExtension("GL_EXT_debug_label");
- const char* vendor = (const char*) glGetString(GL_VENDOR);
- EXT_LOGD("Vendor: %s", vendor);
- mNeedsHighpTexCoords = strcmp(vendor, VENDOR_IMG) == 0;
-
// We don't need to copy the string, the OpenGL ES spec
// guarantees the result of glGetString to point to a
// static string as long as our OpenGL context is valid
@@ -81,7 +74,6 @@
inline bool hasNPot() const { return mHasNPot; }
inline bool hasFramebufferFetch() const { return mHasFramebufferFetch; }
- inline bool needsHighpTexCoords() const { return mNeedsHighpTexCoords; }
inline bool hasDiscardFramebuffer() const { return mHasDiscardFramebuffer; }
inline bool hasDebugMarker() const { return mHasDebugMarker; }
inline bool hasDebugLabel() const { return mHasDebugLabel; }
@@ -101,7 +93,6 @@
const char* mExtensions;
bool mHasNPot;
- bool mNeedsHighpTexCoords;
bool mHasFramebufferFetch;
bool mHasDiscardFramebuffer;
bool mHasDebugMarker;
diff --git a/libs/hwui/FontRenderer.cpp b/libs/hwui/FontRenderer.cpp
index 3b3691c..7f0ed73 100644
--- a/libs/hwui/FontRenderer.cpp
+++ b/libs/hwui/FontRenderer.cpp
@@ -288,13 +288,13 @@
}
void Font::measure(SkPaint* paint, const char* text, uint32_t start, uint32_t len,
- int numGlyphs, Rect *bounds) {
+ int numGlyphs, Rect *bounds, const float* positions) {
if (bounds == NULL) {
ALOGE("No return rectangle provided to measure text");
return;
}
bounds->set(1e6, -1e6, -1e6, 1e6);
- render(paint, text, start, len, numGlyphs, 0, 0, MEASURE, NULL, 0, 0, bounds, NULL);
+ render(paint, text, start, len, numGlyphs, 0, 0, MEASURE, NULL, 0, 0, bounds, positions);
}
void Font::render(SkPaint* paint, const char* text, uint32_t start, uint32_t len,
@@ -697,8 +697,7 @@
}
CacheTexture* FontRenderer::createCacheTexture(int width, int height, bool allocate) {
- uint8_t* textureMemory = NULL;
- CacheTexture* cacheTexture = new CacheTexture(textureMemory, width, height);
+ CacheTexture* cacheTexture = new CacheTexture(width, height);
if (allocate) {
allocateTextureMemory(cacheTexture);
@@ -1008,7 +1007,7 @@
}
FontRenderer::DropShadow FontRenderer::renderDropShadow(SkPaint* paint, const char *text,
- uint32_t startIndex, uint32_t len, int numGlyphs, uint32_t radius) {
+ uint32_t startIndex, uint32_t len, int numGlyphs, uint32_t radius, const float* positions) {
checkInit();
if (!mCurrentFont) {
@@ -1026,7 +1025,7 @@
mBounds = NULL;
Rect bounds;
- mCurrentFont->measure(paint, text, startIndex, len, numGlyphs, &bounds);
+ mCurrentFont->measure(paint, text, startIndex, len, numGlyphs, &bounds, positions);
uint32_t paddedWidth = (uint32_t) (bounds.right - bounds.left) + 2 * radius;
uint32_t paddedHeight = (uint32_t) (bounds.top - bounds.bottom) + 2 * radius;
@@ -1040,7 +1039,7 @@
int penY = radius - bounds.bottom;
mCurrentFont->render(paint, text, startIndex, len, numGlyphs, penX, penY,
- dataBuffer, paddedWidth, paddedHeight);
+ Font::BITMAP, dataBuffer, paddedWidth, paddedHeight, NULL, positions);
blurImage(dataBuffer, paddedWidth, paddedHeight, radius);
DropShadow image;
diff --git a/libs/hwui/FontRenderer.h b/libs/hwui/FontRenderer.h
index 2ab680e..9ed6932 100644
--- a/libs/hwui/FontRenderer.h
+++ b/libs/hwui/FontRenderer.h
@@ -61,9 +61,8 @@
class CacheTexture {
public:
- CacheTexture() { }
- CacheTexture(uint8_t* texture, uint16_t width, uint16_t height) :
- mTexture(texture), mTextureId(0), mWidth(width), mHeight(height),
+ CacheTexture(uint16_t width, uint16_t height) :
+ mTexture(NULL), mTextureId(0), mWidth(width), mHeight(height),
mLinearFiltering(false) { }
~CacheTexture() {
if (mTexture) {
@@ -185,7 +184,7 @@
uint32_t bitmapW, uint32_t bitmapH, Rect *bounds, const float* positions);
void measure(SkPaint* paint, const char* text, uint32_t start, uint32_t len,
- int numGlyphs, Rect *bounds);
+ int numGlyphs, Rect *bounds, const float* positions);
Font(FontRenderer* state, uint32_t fontId, float fontSize, int flags, uint32_t italicStyle,
uint32_t scaleX, SkPaint::Style style, uint32_t strokeWidth);
@@ -274,7 +273,7 @@
// After renderDropShadow returns, the called owns the memory in DropShadow.image
// and is responsible for releasing it when it's done with it
DropShadow renderDropShadow(SkPaint* paint, const char *text, uint32_t startIndex,
- uint32_t len, int numGlyphs, uint32_t radius);
+ uint32_t len, int numGlyphs, uint32_t radius, const float* positions);
GLuint getTexture(bool linearFiltering = false) {
checkInit();
diff --git a/libs/hwui/GammaFontRenderer.cpp b/libs/hwui/GammaFontRenderer.cpp
index 226f4bc..bd0a4b3 100644
--- a/libs/hwui/GammaFontRenderer.cpp
+++ b/libs/hwui/GammaFontRenderer.cpp
@@ -42,17 +42,17 @@
GammaFontRenderer* GammaFontRenderer::createRenderer() {
// Choose the best renderer
char property[PROPERTY_VALUE_MAX];
- if (property_get(PROPERTY_TEXT_GAMMA_SHADER, property, DEFAULT_TEXT_GAMMA_SHADER) > 0) {
- if (!strcasecmp(property, "true")) {
- return new ShaderGammaFontRenderer();
+ if (property_get(PROPERTY_TEXT_GAMMA_METHOD, property, DEFAULT_TEXT_GAMMA_METHOD) > 0) {
+ if (!strcasecmp(property, "lookup")) {
+ return new LookupGammaFontRenderer();
+ } else if (!strcasecmp(property, "shader")) {
+ return new ShaderGammaFontRenderer(false);
+ } else if (!strcasecmp(property, "shader3")) {
+ return new ShaderGammaFontRenderer(true);
}
}
-#if DEBUG_FONT_RENDERER_FORCE_SHADER_GAMMA
- return new ShaderGammaFontRenderer();
-#else
- return new LookupGammaFontRenderer();
-#endif
+ return new Lookup3GammaFontRenderer();
}
GammaFontRenderer::GammaFontRenderer() {
@@ -96,20 +96,26 @@
// Shader-based renderer
///////////////////////////////////////////////////////////////////////////////
-ShaderGammaFontRenderer::ShaderGammaFontRenderer(): GammaFontRenderer() {
+ShaderGammaFontRenderer::ShaderGammaFontRenderer(bool multiGamma): GammaFontRenderer() {
INIT_LOGD("Creating shader gamma font renderer");
mRenderer = NULL;
+ mMultiGamma = multiGamma;
}
void ShaderGammaFontRenderer::describe(ProgramDescription& description,
const SkPaint* paint) const {
if (paint->getShader() == NULL) {
- const int l = luminance(paint);
+ if (mMultiGamma) {
+ const int l = luminance(paint);
- if (l <= mBlackThreshold) {
- description.hasGammaCorrection = true;
- description.gamma = mGamma;
- } else if (l >= mWhiteThreshold) {
+ if (l <= mBlackThreshold) {
+ description.hasGammaCorrection = true;
+ description.gamma = mGamma;
+ } else if (l >= mWhiteThreshold) {
+ description.hasGammaCorrection = true;
+ description.gamma = 1.0f / mGamma;
+ }
+ } else {
description.hasGammaCorrection = true;
description.gamma = 1.0f / mGamma;
}
@@ -131,16 +137,32 @@
INIT_LOGD("Creating lookup gamma font renderer");
// Compute the gamma tables
+ const float gamma = 1.0f / mGamma;
+
+ for (uint32_t i = 0; i <= 255; i++) {
+ mGammaTable[i] = uint8_t((float)::floor(pow(i / 255.0f, gamma) * 255.0f + 0.5f));
+ }
+
+ mRenderer = NULL;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// Lookup-based renderer, using 3 different correction tables
+///////////////////////////////////////////////////////////////////////////////
+
+Lookup3GammaFontRenderer::Lookup3GammaFontRenderer(): GammaFontRenderer() {
+ INIT_LOGD("Creating lookup3 gamma font renderer");
+
+ // Compute the gamma tables
const float blackGamma = mGamma;
const float whiteGamma = 1.0f / mGamma;
for (uint32_t i = 0; i <= 255; i++) {
- mGammaTable[i] = i;
-
const float v = i / 255.0f;
const float black = pow(v, blackGamma);
const float white = pow(v, whiteGamma);
+ mGammaTable[i] = i;
mGammaTable[256 + i] = uint8_t((float)::floor(black * 255.0f + 0.5f));
mGammaTable[512 + i] = uint8_t((float)::floor(white * 255.0f + 0.5f));
}
@@ -149,20 +171,20 @@
memset(mRenderersUsageCount, 0, sizeof(uint32_t) * kGammaCount);
}
-LookupGammaFontRenderer::~LookupGammaFontRenderer() {
+Lookup3GammaFontRenderer::~Lookup3GammaFontRenderer() {
for (int i = 0; i < kGammaCount; i++) {
delete mRenderers[i];
}
}
-void LookupGammaFontRenderer::clear() {
+void Lookup3GammaFontRenderer::clear() {
for (int i = 0; i < kGammaCount; i++) {
delete mRenderers[i];
mRenderers[i] = NULL;
}
}
-void LookupGammaFontRenderer::flush() {
+void Lookup3GammaFontRenderer::flush() {
int count = 0;
int min = -1;
uint32_t minCount = UINT_MAX;
@@ -190,7 +212,7 @@
}
}
-FontRenderer* LookupGammaFontRenderer::getRenderer(Gamma gamma) {
+FontRenderer* Lookup3GammaFontRenderer::getRenderer(Gamma gamma) {
FontRenderer* renderer = mRenderers[gamma];
if (!renderer) {
renderer = new FontRenderer();
@@ -201,7 +223,7 @@
return renderer;
}
-FontRenderer& LookupGammaFontRenderer::getFontRenderer(const SkPaint* paint) {
+FontRenderer& Lookup3GammaFontRenderer::getFontRenderer(const SkPaint* paint) {
if (paint->getShader() == NULL) {
const int l = luminance(paint);
diff --git a/libs/hwui/GammaFontRenderer.h b/libs/hwui/GammaFontRenderer.h
index 8e1db78..c4a50be 100644
--- a/libs/hwui/GammaFontRenderer.h
+++ b/libs/hwui/GammaFontRenderer.h
@@ -59,6 +59,7 @@
void clear() {
delete mRenderer;
+ mRenderer = NULL;
}
void flush() {
@@ -79,23 +80,71 @@
}
uint32_t getFontRendererSize(uint32_t fontRenderer) const {
- return mRenderer->getCacheSize();
+ return mRenderer ? mRenderer->getCacheSize() : 0;
}
void describe(ProgramDescription& description, const SkPaint* paint) const;
void setupProgram(ProgramDescription& description, Program* program) const;
private:
- ShaderGammaFontRenderer();
+ ShaderGammaFontRenderer(bool multiGamma);
FontRenderer* mRenderer;
+ bool mMultiGamma;
friend class GammaFontRenderer;
};
class LookupGammaFontRenderer: public GammaFontRenderer {
public:
- ~LookupGammaFontRenderer();
+ ~LookupGammaFontRenderer() {
+ delete mRenderer;
+ }
+
+ void clear() {
+ delete mRenderer;
+ }
+
+ void flush() {
+ if (mRenderer) {
+ mRenderer->flushLargeCaches();
+ }
+ }
+
+ FontRenderer& getFontRenderer(const SkPaint* paint) {
+ if (!mRenderer) {
+ mRenderer = new FontRenderer;
+ mRenderer->setGammaTable(&mGammaTable[0]);
+ }
+ return *mRenderer;
+ }
+
+ uint32_t getFontRendererCount() const {
+ return 1;
+ }
+
+ uint32_t getFontRendererSize(uint32_t fontRenderer) const {
+ return mRenderer ? mRenderer->getCacheSize() : 0;
+ }
+
+ void describe(ProgramDescription& description, const SkPaint* paint) const {
+ }
+
+ void setupProgram(ProgramDescription& description, Program* program) const {
+ }
+
+private:
+ LookupGammaFontRenderer();
+
+ FontRenderer* mRenderer;
+ uint8_t mGammaTable[256];
+
+ friend class GammaFontRenderer;
+};
+
+class Lookup3GammaFontRenderer: public GammaFontRenderer {
+public:
+ ~Lookup3GammaFontRenderer();
void clear();
void flush();
@@ -122,7 +171,7 @@
}
private:
- LookupGammaFontRenderer();
+ Lookup3GammaFontRenderer();
enum Gamma {
kGammaDefault = 0,
diff --git a/libs/hwui/GradientCache.cpp b/libs/hwui/GradientCache.cpp
index 3678788..7026eead 100644
--- a/libs/hwui/GradientCache.cpp
+++ b/libs/hwui/GradientCache.cpp
@@ -16,8 +16,6 @@
#define LOG_TAG "OpenGLRenderer"
-#include <GLES2/gl2.h>
-
#include <SkCanvas.h>
#include <SkGradientShader.h>
@@ -45,6 +43,8 @@
INIT_LOGD(" Using default gradient cache size of %.2fMB", DEFAULT_GRADIENT_CACHE_SIZE);
}
+ glGetIntegerv(GL_MAX_TEXTURE_SIZE, &mMaxTextureSize);
+
mCache.setOnEntryRemovedListener(this);
}
@@ -116,8 +116,11 @@
Texture* GradientCache::addLinearGradient(GradientCacheEntry& gradient,
uint32_t* colors, float* positions, int count, SkShader::TileMode tileMode) {
+ int width = 256 * (count - 1);
+ width = width < mMaxTextureSize ? width : mMaxTextureSize;
+
SkBitmap bitmap;
- bitmap.setConfig(SkBitmap::kARGB_8888_Config, 1024, 1);
+ bitmap.setConfig(SkBitmap::kARGB_8888_Config, width, 4);
bitmap.allocPixels();
bitmap.eraseColor(0);
@@ -134,7 +137,7 @@
p.setStyle(SkPaint::kStrokeAndFill_Style);
p.setShader(localShader)->unref();
- canvas.drawRectCoords(0.0f, 0.0f, bitmap.width(), 1.0f, p);
+ canvas.drawRectCoords(0.0f, 0.0f, bitmap.width(), 4.0f, p);
// Asume the cache is always big enough
const uint32_t size = bitmap.rowBytes() * bitmap.height();
diff --git a/libs/hwui/GradientCache.h b/libs/hwui/GradientCache.h
index ac34684..59515a1 100644
--- a/libs/hwui/GradientCache.h
+++ b/libs/hwui/GradientCache.h
@@ -17,6 +17,8 @@
#ifndef ANDROID_HWUI_GRADIENT_CACHE_H
#define ANDROID_HWUI_GRADIENT_CACHE_H
+#include <GLES2/gl2.h>
+
#include <SkShader.h>
#include <utils/Mutex.h>
@@ -152,6 +154,8 @@
uint32_t mSize;
uint32_t mMaxSize;
+ GLint mMaxTextureSize;
+
Vector<SkShader*> mGarbage;
mutable Mutex mLock;
}; // class GradientCache
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp
index a47d732..07281cc 100644
--- a/libs/hwui/OpenGLRenderer.cpp
+++ b/libs/hwui/OpenGLRenderer.cpp
@@ -1783,6 +1783,7 @@
int color, SkXfermode::Mode mode) {
float inverseScaleX = 1.0f;
float inverseScaleY = 1.0f;
+
// The quad that we use needs to account for scaling.
if (CC_UNLIKELY(!mSnapshot->transform->isPureTranslate())) {
Matrix4 *mat = mSnapshot->transform;
@@ -1798,24 +1799,6 @@
inverseScaleY = (scaleY != 0) ? (inverseScaleY / scaleY) : 0;
}
- setupDraw();
- setupDrawNoTexture();
- setupDrawAALine();
- setupDrawColor(color, ((color >> 24) & 0xFF) * mSnapshot->alpha);
- setupDrawColorFilter();
- setupDrawShader();
- setupDrawBlending(true, mode);
- setupDrawProgram();
- setupDrawModelViewIdentity(true);
- setupDrawColorUniforms();
- setupDrawColorFilterUniforms();
- setupDrawShaderIdentityUniforms();
-
- AAVertex rects[4];
- AAVertex* aaVertices = &rects[0];
- void* widthCoords = ((GLbyte*) aaVertices) + gVertexAAWidthOffset;
- void* lengthCoords = ((GLbyte*) aaVertices) + gVertexAALengthOffset;
-
float boundarySizeX = .5 * inverseScaleX;
float boundarySizeY = .5 * inverseScaleY;
@@ -1825,32 +1808,51 @@
top -= boundarySizeY;
bottom += boundarySizeY;
- float width = right - left;
- float height = bottom - top;
-
- int widthSlot;
- int lengthSlot;
-
- float boundaryWidthProportion = (width != 0) ? (2 * boundarySizeX) / width : 0;
- float boundaryHeightProportion = (height != 0) ? (2 * boundarySizeY) / height : 0;
- setupDrawAALine((void*) aaVertices, widthCoords, lengthCoords,
- boundaryWidthProportion, widthSlot, lengthSlot);
-
- int boundaryLengthSlot = mCaches.currentProgram->getUniform("boundaryLength");
- int inverseBoundaryLengthSlot = mCaches.currentProgram->getUniform("inverseBoundaryLength");
- glUniform1f(boundaryLengthSlot, boundaryHeightProportion);
- glUniform1f(inverseBoundaryLengthSlot, (1.0f / boundaryHeightProportion));
-
if (!quickReject(left, top, right, bottom)) {
+ setupDraw();
+ setupDrawNoTexture();
+ setupDrawAALine();
+ setupDrawColor(color, ((color >> 24) & 0xFF) * mSnapshot->alpha);
+ setupDrawColorFilter();
+ setupDrawShader();
+ setupDrawBlending(true, mode);
+ setupDrawProgram();
+ setupDrawModelViewIdentity(true);
+ setupDrawColorUniforms();
+ setupDrawColorFilterUniforms();
+ setupDrawShaderIdentityUniforms();
+
+ AAVertex rects[4];
+ AAVertex* aaVertices = &rects[0];
+ void* widthCoords = ((GLbyte*) aaVertices) + gVertexAAWidthOffset;
+ void* lengthCoords = ((GLbyte*) aaVertices) + gVertexAALengthOffset;
+
+ int widthSlot;
+ int lengthSlot;
+
+ float width = right - left;
+ float height = bottom - top;
+
+ float boundaryWidthProportion = (width != 0) ? (2 * boundarySizeX) / width : 0;
+ float boundaryHeightProportion = (height != 0) ? (2 * boundarySizeY) / height : 0;
+ setupDrawAALine((void*) aaVertices, widthCoords, lengthCoords,
+ boundaryWidthProportion, widthSlot, lengthSlot);
+
+ int boundaryLengthSlot = mCaches.currentProgram->getUniform("boundaryLength");
+ int inverseBoundaryLengthSlot = mCaches.currentProgram->getUniform("inverseBoundaryLength");
+ glUniform1f(boundaryLengthSlot, boundaryHeightProportion);
+ glUniform1f(inverseBoundaryLengthSlot, (1.0f / boundaryHeightProportion));
+
AAVertex::set(aaVertices++, left, bottom, 1, 1);
AAVertex::set(aaVertices++, left, top, 1, 0);
AAVertex::set(aaVertices++, right, bottom, 0, 1);
AAVertex::set(aaVertices++, right, top, 0, 0);
dirtyLayer(left, top, right, bottom, *mSnapshot->transform);
- glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
- }
- finishDrawAALine(widthSlot, lengthSlot);
+ glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
+
+ finishDrawAALine(widthSlot, lengthSlot);
+ }
}
/**
@@ -1922,6 +1924,9 @@
}
getAlphaAndMode(paint, &alpha, &mode);
+
+ mCaches.enableScissor();
+
setupDraw();
setupDrawNoTexture();
if (isAA) {
@@ -2052,7 +2057,7 @@
const float top = fmin(p1.y, fmin(p2.y, fmin(p3.y, p4.y)));
const float bottom = fmax(p1.y, fmax(p2.y, fmax(p3.y, p4.y)));
- if (!quickReject(left, top, right, bottom)) {
+ if (!quickRejectNoScissor(left, top, right, bottom)) {
if (!isAA) {
if (prevVertex != NULL) {
// Issue two repeat vertices to create degenerate triangles to bridge
@@ -2157,6 +2162,10 @@
TextureVertex pointsData[verticesCount];
TextureVertex* vertex = &pointsData[0];
+ // TODO: We should optimize this method to not generate vertices for points
+ // that lie outside of the clip.
+ mCaches.enableScissor();
+
setupDraw();
setupDrawNoTexture();
setupDrawPoint(strokeWidth);
@@ -2294,6 +2303,44 @@
return DrawGlInfo::kStatusDrew;
}
+void OpenGLRenderer::drawTextShadow(SkPaint* paint, const char* text, int bytesCount, int count,
+ const float* positions, FontRenderer& fontRenderer, int alpha, SkXfermode::Mode mode,
+ float x, float y) {
+ mCaches.activeTexture(0);
+
+ // NOTE: The drop shadow will not perform gamma correction
+ // if shader-based correction is enabled
+ mCaches.dropShadowCache.setFontRenderer(fontRenderer);
+ const ShadowTexture* shadow = mCaches.dropShadowCache.get(
+ paint, text, bytesCount, count, mShadowRadius, positions);
+ const AutoTexture autoCleanup(shadow);
+
+ const float sx = x - shadow->left + mShadowDx;
+ const float sy = y - shadow->top + mShadowDy;
+
+ const int shadowAlpha = ((mShadowColor >> 24) & 0xFF) * mSnapshot->alpha;
+ int shadowColor = mShadowColor;
+ if (mShader) {
+ shadowColor = 0xffffffff;
+ }
+
+ setupDraw();
+ setupDrawWithTexture(true);
+ setupDrawAlpha8Color(shadowColor, shadowAlpha < 255 ? shadowAlpha : alpha);
+ setupDrawColorFilter();
+ setupDrawShader();
+ setupDrawBlending(true, mode);
+ setupDrawProgram();
+ setupDrawModelView(sx, sy, sx + shadow->width, sy + shadow->height);
+ setupDrawTexture(shadow->id);
+ setupDrawPureColorUniforms();
+ setupDrawColorFilterUniforms();
+ setupDrawShaderUniforms();
+ setupDrawMesh(NULL, (GLvoid*) gMeshTextureOffset);
+
+ glDrawArrays(GL_TRIANGLE_STRIP, 0, gMeshCount);
+}
+
status_t OpenGLRenderer::drawPosText(const char* text, int bytesCount, int count,
const float* positions, SkPaint* paint) {
if (text == NULL || count == 0 || mSnapshot->isIgnored() ||
@@ -2322,6 +2369,11 @@
SkXfermode::Mode mode;
getAlphaAndMode(paint, &alpha, &mode);
+ if (CC_UNLIKELY(mHasShadow)) {
+ drawTextShadow(paint, text, bytesCount, count, positions, fontRenderer, alpha, mode,
+ 0.0f, 0.0f);
+ }
+
// Pick the appropriate texture filtering
bool linearFilter = mSnapshot->transform->changesBounds();
if (pureTranslate && !linearFilter) {
@@ -2369,8 +2421,8 @@
return DrawGlInfo::kStatusDrew;
}
-status_t OpenGLRenderer::drawText(const char* text, int bytesCount, int count,
- float x, float y, SkPaint* paint, float length) {
+status_t OpenGLRenderer::drawGeneralText(const char* text, int bytesCount, int count,
+ float x, float y, const float* positions, SkPaint* paint, float length) {
if (text == NULL || count == 0 || mSnapshot->isIgnored() ||
(paint->getAlpha() * mSnapshot->alpha == 0 && paint->getXfermode() == NULL)) {
return DrawGlInfo::kStatusDone;
@@ -2403,7 +2455,8 @@
}
#if DEBUG_GLYPHS
- ALOGD("OpenGLRenderer drawText() with FontID=%d", SkTypeface::UniqueID(paint->getTypeface()));
+ ALOGD("OpenGLRenderer drawGeneralText() with FontID=%d",
+ SkTypeface::UniqueID(paint->getTypeface()));
#endif
FontRenderer& fontRenderer = mCaches.fontRenderer->getFontRenderer(paint);
@@ -2415,39 +2468,8 @@
getAlphaAndMode(paint, &alpha, &mode);
if (CC_UNLIKELY(mHasShadow)) {
- mCaches.activeTexture(0);
-
- // NOTE: The drop shadow will not perform gamma correction
- // if shader-based correction is enabled
- mCaches.dropShadowCache.setFontRenderer(fontRenderer);
- const ShadowTexture* shadow = mCaches.dropShadowCache.get(
- paint, text, bytesCount, count, mShadowRadius);
- const AutoTexture autoCleanup(shadow);
-
- const float sx = oldX - shadow->left + mShadowDx;
- const float sy = oldY - shadow->top + mShadowDy;
-
- const int shadowAlpha = ((mShadowColor >> 24) & 0xFF) * mSnapshot->alpha;
- int shadowColor = mShadowColor;
- if (mShader) {
- shadowColor = 0xffffffff;
- }
-
- setupDraw();
- setupDrawWithTexture(true);
- setupDrawAlpha8Color(shadowColor, shadowAlpha < 255 ? shadowAlpha : alpha);
- setupDrawColorFilter();
- setupDrawShader();
- setupDrawBlending(true, mode);
- setupDrawProgram();
- setupDrawModelView(sx, sy, sx + shadow->width, sy + shadow->height);
- setupDrawTexture(shadow->id);
- setupDrawPureColorUniforms();
- setupDrawColorFilterUniforms();
- setupDrawShaderUniforms();
- setupDrawMesh(NULL, (GLvoid*) gMeshTextureOffset);
-
- glDrawArrays(GL_TRIANGLE_STRIP, 0, gMeshCount);
+ drawTextShadow(paint, text, bytesCount, count, positions, fontRenderer, alpha, mode,
+ oldX, oldY);
}
// Pick the appropriate texture filtering
@@ -2485,8 +2507,16 @@
const bool hasActiveLayer = false;
#endif
- if (fontRenderer.renderText(paint, clip, text, 0, bytesCount, count, x, y,
- hasActiveLayer ? &bounds : NULL)) {
+ bool status;
+ if (positions != NULL) {
+ status = fontRenderer.renderPosText(paint, clip, text, 0, bytesCount, count, x, y,
+ positions, hasActiveLayer ? &bounds : NULL);
+ } else {
+ // TODO: would it be okay to call renderPosText with null positions?
+ status = fontRenderer.renderText(paint, clip, text, 0, bytesCount, count, x, y,
+ hasActiveLayer ? &bounds : NULL);
+ }
+ if (status) {
#if RENDER_LAYERS_AS_REGIONS
if (hasActiveLayer) {
if (!pureTranslate) {
diff --git a/libs/hwui/OpenGLRenderer.h b/libs/hwui/OpenGLRenderer.h
index 1926575..378fc8c 100644
--- a/libs/hwui/OpenGLRenderer.h
+++ b/libs/hwui/OpenGLRenderer.h
@@ -138,12 +138,12 @@
virtual status_t drawPath(SkPath* path, SkPaint* paint);
virtual status_t drawLines(float* points, int count, SkPaint* paint);
virtual status_t drawPoints(float* points, int count, SkPaint* paint);
- virtual status_t drawText(const char* text, int bytesCount, int count, float x, float y,
- SkPaint* paint, float length = -1.0f);
virtual status_t drawTextOnPath(const char* text, int bytesCount, int count, SkPath* path,
float hOffset, float vOffset, SkPaint* paint);
virtual status_t drawPosText(const char* text, int bytesCount, int count,
const float* positions, SkPaint* paint);
+ virtual status_t drawGeneralText(const char* text, int bytesCount, int count, float x, float y,
+ const float* positions, SkPaint* paint, float length = -1.0f);
virtual void resetShader();
virtual void setupShader(SkiaShader* shader);
@@ -498,6 +498,24 @@
void drawTextDecorations(const char* text, int bytesCount, float length,
float x, float y, SkPaint* paint);
+ /**
+ * Draws shadow layer on text (with optional positions).
+ *
+ * @param paint The paint to draw the shadow with
+ * @param text The text to draw
+ * @param bytesCount The number of bytes in the text
+ * @param count The number of glyphs in the text
+ * @param positions The x, y positions of individual glyphs (or NULL)
+ * @param fontRenderer The font renderer object
+ * @param alpha The alpha value for drawing the shadow
+ * @param mode The xfermode for drawing the shadow
+ * @param x The x coordinate where the shadow will be drawn
+ * @param y The y coordinate where the shadow will be drawn
+ */
+ void drawTextShadow(SkPaint* paint, const char* text, int bytesCount, int count,
+ const float* positions, FontRenderer& fontRenderer, int alpha, SkXfermode::Mode mode,
+ float x, float y);
+
/**
* Draws a path texture. Path textures are alpha8 bitmaps that need special
* compositing to apply colors/filters/etc.
@@ -507,7 +525,7 @@
* @param y The y coordinate where the texture will be drawn
* @param paint The paint to draw the texture with
*/
- void drawPathTexture(const PathTexture* texture, float x, float y, SkPaint* paint);
+ void drawPathTexture(const PathTexture* texture, float x, float y, SkPaint* paint);
/**
* Resets the texture coordinates stored in mMeshVertices. Setting the values
diff --git a/libs/hwui/ProgramCache.cpp b/libs/hwui/ProgramCache.cpp
index fc60279..70bd1a8 100644
--- a/libs/hwui/ProgramCache.cpp
+++ b/libs/hwui/ProgramCache.cpp
@@ -65,25 +65,19 @@
const char* gVS_Header_Varyings_IsAA =
"varying float widthProportion;\n"
"varying float lengthProportion;\n";
-const char* gVS_Header_Varyings_HasBitmap[2] = {
- // Default precision
- "varying vec2 outBitmapTexCoords;\n",
- // High precision
- "varying highp vec2 outBitmapTexCoords;\n"
-};
-const char* gVS_Header_Varyings_PointHasBitmap[2] = {
- // Default precision
- "varying vec2 outPointBitmapTexCoords;\n",
- // High precision
- "varying highp vec2 outPointBitmapTexCoords;\n"
-};
+const char* gVS_Header_Varyings_HasBitmap =
+ "varying highp vec2 outBitmapTexCoords;\n";
+const char* gVS_Header_Varyings_PointHasBitmap =
+ "varying highp vec2 outPointBitmapTexCoords;\n";
+// TODO: These values are used to sample from textures,
+// they may need to be highp
const char* gVS_Header_Varyings_HasGradient[3] = {
// Linear
- "varying vec2 linear;\n",
+ "varying highp vec2 linear;\n",
// Circular
- "varying vec2 circular;\n",
+ "varying highp vec2 circular;\n",
// Sweep
- "varying vec2 sweep;\n"
+ "varying highp vec2 sweep;\n"
};
const char* gVS_Main =
"\nvoid main(void) {\n";
@@ -167,7 +161,7 @@
" lowp vec4 fragColor;\n";
const char* gFS_Main_PointBitmapTexCoords =
- " vec2 outBitmapTexCoords = outPointBitmapTexCoords + "
+ " highp vec2 outBitmapTexCoords = outPointBitmapTexCoords + "
"((gl_PointCoord - vec2(0.5, 0.5)) * textureDimension * vec2(pointSize, pointSize));\n";
// Fast cases
@@ -242,10 +236,10 @@
// Linear
" vec4 gradientColor = texture2D(gradientSampler, linear);\n",
// Circular
- " float index = length(circular);\n"
+ " highp float index = length(circular);\n"
" vec4 gradientColor = texture2D(gradientSampler, vec2(index, 0.5));\n",
// Sweep
- " float index = atan(sweep.y, sweep.x) * 0.15915494309; // inv(2 * PI)\n"
+ " highp float index = atan(sweep.y, sweep.x) * 0.15915494309; // inv(2 * PI)\n"
" vec4 gradientColor = texture2D(gradientSampler, vec2(index - floor(index), 0.5));\n"
};
const char* gFS_Main_FetchBitmap =
@@ -439,10 +433,9 @@
shader.append(gVS_Header_Varyings_HasGradient[description.gradientType]);
}
if (description.hasBitmap) {
- int index = Caches::getInstance().extensions.needsHighpTexCoords() ? 1 : 0;
shader.append(description.isPoint ?
- gVS_Header_Varyings_PointHasBitmap[index] :
- gVS_Header_Varyings_HasBitmap[index]);
+ gVS_Header_Varyings_PointHasBitmap :
+ gVS_Header_Varyings_HasBitmap);
}
// Begin the shader
@@ -501,10 +494,9 @@
shader.append(gVS_Header_Varyings_HasGradient[description.gradientType]);
}
if (description.hasBitmap) {
- int index = Caches::getInstance().extensions.needsHighpTexCoords() ? 1 : 0;
shader.append(description.isPoint ?
- gVS_Header_Varyings_PointHasBitmap[index] :
- gVS_Header_Varyings_HasBitmap[index]);
+ gVS_Header_Varyings_PointHasBitmap :
+ gVS_Header_Varyings_HasBitmap);
}
// Uniforms
@@ -704,13 +696,13 @@
}
void ProgramCache::generateTextureWrap(String8& shader, GLenum wrapS, GLenum wrapT) {
- shader.append("\nvec2 wrap(vec2 texCoords) {\n");
+ shader.append("\nhighp vec2 wrap(highp vec2 texCoords) {\n");
if (wrapS == GL_MIRRORED_REPEAT) {
- shader.append(" float xMod2 = mod(texCoords.x, 2.0);\n");
+ shader.append(" highp float xMod2 = mod(texCoords.x, 2.0);\n");
shader.append(" if (xMod2 > 1.0) xMod2 = 2.0 - xMod2;\n");
}
if (wrapT == GL_MIRRORED_REPEAT) {
- shader.append(" float yMod2 = mod(texCoords.y, 2.0);\n");
+ shader.append(" highp float yMod2 = mod(texCoords.y, 2.0);\n");
shader.append(" if (yMod2 > 1.0) yMod2 = 2.0 - yMod2;\n");
}
shader.append(" return vec2(");
diff --git a/libs/hwui/Properties.h b/libs/hwui/Properties.h
index 4a12e39..3f3b39a 100644
--- a/libs/hwui/Properties.h
+++ b/libs/hwui/Properties.h
@@ -74,13 +74,29 @@
#define PROPERTY_TEXT_CACHE_HEIGHT "ro.hwui.text_cache_height"
// Indicates whether gamma correction should be applied in the shaders
-// or in lookup tables. Accepted values: true, false
-#define PROPERTY_TEXT_GAMMA_SHADER "ro.hwui.text_gamma_shader"
+// or in lookup tables. Accepted values:
+//
+// - "lookup3", correction based on lookup tables. Gamma correction
+// is different for black and white text (see thresholds below)
+//
+// - "lookup", correction based on a single lookup table
+//
+// - "shader3", correction applied by a GLSL shader. Gamma correction
+// is different for black and white text (see thresholds below)
+//
+// - "shader", correction applied by a GLSL shader
+//
+// See PROPERTY_TEXT_GAMMA, PROPERTY_TEXT_BLACK_GAMMA_THRESHOLD and
+// PROPERTY_TEXT_WHITE_GAMMA_THRESHOLD for more control.
+#define PROPERTY_TEXT_GAMMA_METHOD "hwui.text_gamma_correction"
+#define DEFAULT_TEXT_GAMMA_METHOD "lookup"
// Gamma (>= 1.0, <= 10.0)
-#define PROPERTY_TEXT_GAMMA "ro.text_gamma"
-#define PROPERTY_TEXT_BLACK_GAMMA_THRESHOLD "ro.text_gamma.black_threshold"
-#define PROPERTY_TEXT_WHITE_GAMMA_THRESHOLD "ro.text_gamma.white_threshold"
+#define PROPERTY_TEXT_GAMMA "hwui.text_gamma"
+// Luminance threshold below which black gamma correction is applied. Range: [0..255]
+#define PROPERTY_TEXT_BLACK_GAMMA_THRESHOLD "hwui.text_gamma.black_threshold"
+// Lumincance threshold above which white gamma correction is applied. Range: [0..255]
+#define PROPERTY_TEXT_WHITE_GAMMA_THRESHOLD "hwui.text_gamma.white_threshold"
// Converts a number of mega-bytes into bytes
#define MB(s) s * 1024 * 1024
@@ -96,8 +112,6 @@
#define DEFAULT_TEXTURE_CACHE_FLUSH_RATE 0.6f
-#define DEFAULT_TEXT_GAMMA_SHADER "false"
-
#define DEFAULT_TEXT_GAMMA 1.4f
#define DEFAULT_TEXT_BLACK_GAMMA_THRESHOLD 64
#define DEFAULT_TEXT_WHITE_GAMMA_THRESHOLD 192
diff --git a/libs/hwui/ResourceCache.cpp b/libs/hwui/ResourceCache.cpp
index cf5f822..2153a8b 100644
--- a/libs/hwui/ResourceCache.cpp
+++ b/libs/hwui/ResourceCache.cpp
@@ -48,7 +48,8 @@
void ResourceCache::incrementRefcount(void* resource, ResourceType resourceType) {
Mutex::Autolock _l(mLock);
- ResourceReference* ref = mCache->indexOfKey(resource) >= 0 ? mCache->valueFor(resource) : NULL;
+ ssize_t index = mCache->indexOfKey(resource);
+ ResourceReference* ref = index >= 0 ? mCache->valueAt(index) : NULL;
if (ref == NULL || mCache->size() == 0) {
ref = new ResourceReference(resourceType);
mCache->add(resource, ref);
@@ -78,7 +79,8 @@
void ResourceCache::decrementRefcount(void* resource) {
Mutex::Autolock _l(mLock);
- ResourceReference* ref = mCache->indexOfKey(resource) >= 0 ? mCache->valueFor(resource) : NULL;
+ ssize_t index = mCache->indexOfKey(resource);
+ ResourceReference* ref = index >= 0 ? mCache->valueAt(index) : NULL;
if (ref == NULL) {
// Should not get here - shouldn't get a call to decrement if we're not yet tracking it
return;
@@ -111,12 +113,13 @@
void ResourceCache::recycle(SkBitmap* resource) {
Mutex::Autolock _l(mLock);
- if (mCache->indexOfKey(resource) < 0) {
+ ssize_t index = mCache->indexOfKey(resource);
+ if (index < 0) {
// not tracking this resource; just recycle the pixel data
resource->setPixels(NULL, NULL);
return;
}
- ResourceReference* ref = mCache->indexOfKey(resource) >= 0 ? mCache->valueFor(resource) : NULL;
+ ResourceReference* ref = mCache->valueAt(index);
if (ref == NULL) {
// Should not get here - shouldn't get a call to recycle if we're not yet tracking it
return;
@@ -129,7 +132,8 @@
void ResourceCache::destructor(SkPath* resource) {
Mutex::Autolock _l(mLock);
- ResourceReference* ref = mCache->indexOfKey(resource) >= 0 ? mCache->valueFor(resource) : NULL;
+ ssize_t index = mCache->indexOfKey(resource);
+ ResourceReference* ref = index >= 0 ? mCache->valueAt(index) : NULL;
if (ref == NULL) {
// If we're not tracking this resource, just delete it
if (Caches::hasInstance()) {
@@ -146,7 +150,8 @@
void ResourceCache::destructor(SkBitmap* resource) {
Mutex::Autolock _l(mLock);
- ResourceReference* ref = mCache->indexOfKey(resource) >= 0 ? mCache->valueFor(resource) : NULL;
+ ssize_t index = mCache->indexOfKey(resource);
+ ResourceReference* ref = index >= 0 ? mCache->valueAt(index) : NULL;
if (ref == NULL) {
// If we're not tracking this resource, just delete it
if (Caches::hasInstance()) {
@@ -163,7 +168,8 @@
void ResourceCache::destructor(SkiaShader* resource) {
Mutex::Autolock _l(mLock);
- ResourceReference* ref = mCache->indexOfKey(resource) >= 0 ? mCache->valueFor(resource) : NULL;
+ ssize_t index = mCache->indexOfKey(resource);
+ ResourceReference* ref = index >= 0 ? mCache->valueAt(index) : NULL;
if (ref == NULL) {
// If we're not tracking this resource, just delete it
delete resource;
@@ -177,7 +183,8 @@
void ResourceCache::destructor(SkiaColorFilter* resource) {
Mutex::Autolock _l(mLock);
- ResourceReference* ref = mCache->indexOfKey(resource) >= 0 ? mCache->valueFor(resource) : NULL;
+ ssize_t index = mCache->indexOfKey(resource);
+ ResourceReference* ref = index >= 0 ? mCache->valueAt(index) : NULL;
if (ref == NULL) {
// If we're not tracking this resource, just delete it
delete resource;
diff --git a/libs/hwui/TextDropShadowCache.cpp b/libs/hwui/TextDropShadowCache.cpp
index bef1373..93aa8a5 100644
--- a/libs/hwui/TextDropShadowCache.cpp
+++ b/libs/hwui/TextDropShadowCache.cpp
@@ -102,13 +102,13 @@
}
ShadowTexture* TextDropShadowCache::get(SkPaint* paint, const char* text, uint32_t len,
- int numGlyphs, uint32_t radius) {
- ShadowText entry(paint, radius, len, text);
+ int numGlyphs, uint32_t radius, const float* positions) {
+ ShadowText entry(paint, radius, len, text, positions);
ShadowTexture* texture = mCache.get(entry);
if (!texture) {
FontRenderer::DropShadow shadow = mRenderer->renderDropShadow(paint, text, 0,
- len, numGlyphs, radius);
+ len, numGlyphs, radius, positions);
texture = new ShadowTexture;
texture->left = shadow.penX;
diff --git a/libs/hwui/TextDropShadowCache.h b/libs/hwui/TextDropShadowCache.h
index e2bdde1..bae0c49 100644
--- a/libs/hwui/TextDropShadowCache.h
+++ b/libs/hwui/TextDropShadowCache.h
@@ -35,8 +35,9 @@
ShadowText(): radius(0), len(0), textSize(0.0f), typeface(NULL) {
}
- ShadowText(SkPaint* paint, uint32_t radius, uint32_t len, const char* srcText):
- radius(radius), len(len) {
+ ShadowText(SkPaint* paint, uint32_t radius, uint32_t len, const char* srcText,
+ const float* positions):
+ radius(radius), len(len), positions(positions) {
// TODO: Propagate this through the API, we should not cast here
text = (const char16_t*) srcText;
@@ -66,11 +67,18 @@
uint32_t italicStyle;
uint32_t scaleX;
const char16_t* text;
+ const float* positions;
String16 str;
+ Vector<float> positionsCopy;
void copyTextLocally() {
str.setTo((const char16_t*) text, len >> 1);
text = str.string();
+ if (positions != NULL) {
+ positionsCopy.clear();
+ positionsCopy.appendArray(positions, len);
+ positions = positionsCopy.array();
+ }
}
bool operator<(const ShadowText& rhs) const {
@@ -81,7 +89,12 @@
LTE_INT(flags) {
LTE_INT(italicStyle) {
LTE_INT(scaleX) {
- return memcmp(text, rhs.text, len) < 0;
+ int cmp = memcmp(text, rhs.text, len);
+ if (cmp < 0) return true;
+ if (cmp == 0 && rhs.positions != NULL) {
+ if (positions == NULL) return true;
+ return memcmp(positions, rhs.positions, len << 2) < 0;
+ }
}
}
}
@@ -117,7 +130,7 @@
void operator()(ShadowText& text, ShadowTexture*& texture);
ShadowTexture* get(SkPaint* paint, const char* text, uint32_t len,
- int numGlyphs, uint32_t radius);
+ int numGlyphs, uint32_t radius, const float* positions);
/**
* Clears the cache. This causes all textures to be deleted.
diff --git a/location/java/android/location/Location.java b/location/java/android/location/Location.java
index aacf857..5ad60ab 100644
--- a/location/java/android/location/Location.java
+++ b/location/java/android/location/Location.java
@@ -19,6 +19,7 @@
import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable;
+import android.os.SystemClock;
import android.util.Printer;
import java.text.DecimalFormat;
@@ -59,6 +60,7 @@
private String mProvider;
private long mTime = 0;
+ private long mElapsedRealtimeNano = 0;
private double mLatitude = 0.0;
private double mLongitude = 0.0;
private boolean mHasAltitude = false;
@@ -84,6 +86,7 @@
public void dump(Printer pw, String prefix) {
pw.println(prefix + "mProvider=" + mProvider + " mTime=" + mTime);
+ pw.println(prefix + "mElapsedRealtimeNano=" + mElapsedRealtimeNano);
pw.println(prefix + "mLatitude=" + mLatitude + " mLongitude=" + mLongitude);
pw.println(prefix + "mHasAltitude=" + mHasAltitude + " mAltitude=" + mAltitude);
pw.println(prefix + "mHasSpeed=" + mHasSpeed + " mSpeed=" + mSpeed);
@@ -118,6 +121,7 @@
public void set(Location l) {
mProvider = l.mProvider;
mTime = l.mTime;
+ mElapsedRealtimeNano = l.mElapsedRealtimeNano;
mLatitude = l.mLatitude;
mLongitude = l.mLongitude;
mHasAltitude = l.mHasAltitude;
@@ -137,6 +141,7 @@
public void reset() {
mProvider = null;
mTime = 0;
+ mElapsedRealtimeNano = 0;
mLatitude = 0;
mLongitude = 0;
mHasAltitude = false;
@@ -467,23 +472,62 @@
}
/**
- * Returns the UTC time of this fix, in milliseconds since January 1,
+ * Return the UTC time of this fix, in milliseconds since January 1,
* 1970.
+ * <p>Note that the UTC time on a device is not monotonic: it
+ * can jump forwards or backwards unpredictably. So always use
+ * {@link #getElapsedRealtimeNano()} when calculating time deltas.
+ * <p>On the other hand, {@link #getTime()} is useful for presenting
+ * a human readable time to the user, or for carefully comparing
+ * location fixes across reboot or across devices.
+ * <p>This method will always return a valid timestamp on
+ * Locations generated by a {@link LocationProvider}.
+ *
+ * @return time of fix, in milliseconds since January 1, 1970.
*/
public long getTime() {
return mTime;
}
/**
- * Sets the UTC time of this fix, in milliseconds since January 1,
+ * Set the UTC time of this fix, in milliseconds since January 1,
* 1970.
+ *
+ * @param time UTC time of this fix, in milliseconds since January 1, 1970
*/
public void setTime(long time) {
mTime = time;
}
/**
- * Returns the latitude of this fix.
+ * Return the time of this fix, in elapsed real-time since system boot.
+ * <p>This value can be reliably compared to
+ * {@link android.os.SystemClock#elapsedRealtimeNano()},
+ * to calculate the age of a fix, and to compare Location fixes, since
+ * elapsed real-time is guaranteed monotonic for each system boot, and
+ * continues to increment even when the system is in deep sleep.
+ * <p>This method will always return a valid timestamp on
+ * Locations generated by a {@link LocationProvider}.
+ *
+ * @return elapsed real-time of fix, in nanoseconds since system boot.
+ */
+ public long getElapsedRealtimeNano() {
+ return mElapsedRealtimeNano;
+ }
+
+ /**
+ * Set the time of this fix, in elapsed real-time since system boot.
+ *
+ * @param time elapsed real-time of fix, in nanoseconds since system boot.
+ */
+ public void setElapsedRealtimeNano(long time) {
+ mElapsedRealtimeNano = time;
+ }
+
+ /**
+ * Return the latitude of this fix.
+ * <p>This method will always return a valid latitude on
+ * Locations generated by a {@link LocationProvider}.
*/
public double getLatitude() {
return mLatitude;
@@ -497,7 +541,9 @@
}
/**
- * Returns the longitude of this fix.
+ * Return the longitude of this fix.
+ * <p>This method will always return a valid longitude on
+ * Locations generated by a {@link LocationProvider}.
*/
public double getLongitude() {
return mLongitude;
@@ -619,16 +665,27 @@
}
/**
- * Returns true if the provider is able to report accuracy information,
- * false otherwise. The default implementation returns false.
+ * Return true if this Location has an associated accuracy.
+ * <p>All Location objects generated by a {@link LocationProvider}
+ * will have an accuracy.
*/
public boolean hasAccuracy() {
return mHasAccuracy;
}
/**
- * Returns the accuracy of the fix in meters. If hasAccuracy() is false,
- * 0.0 is returned.
+ * Return the accuracy of this Location fix.
+ * <p>Accuracy is measured in meters, and indicates the
+ * radius of 95% confidence.
+ * In other words, there is a 95% probability that the
+ * true location is within a circle centered at the reported
+ * location, with radius of the reported accuracy.
+ * <p>This is only a measure of horizontal accuracy, and does
+ * not indicate the accuracy of bearing, velocity or altitude
+ * if those are included in this Location.
+ * <p>If {@link #hasAccuracy} is false, 0.0 is returned.
+ * <p>All Location object generated by a {@link LocationProvider}
+ * will have a valid accuracy.
*/
public float getAccuracy() {
return mAccuracy;
@@ -653,6 +710,37 @@
}
/**
+ * Return true if this Location object has enough data set to
+ * be considered a valid fix from a {@link LocationProvider}.
+ * @see #makeComplete
+ * @hide
+ */
+ public boolean isComplete() {
+ if (mProvider == null) return false;
+ if (!mHasAccuracy) return false;
+ if (mTime == 0) return false;
+ if (mElapsedRealtimeNano == 0) return false;
+ return true;
+ }
+
+ /**
+ * Helper to fill in incomplete fields.
+ * Only use this to assist in backwards compatibility
+ * with Location objects received from applications.
+ * @see #isComplete
+ * @hide
+ */
+ public void makeComplete() {
+ if (mProvider == null) mProvider = "?";
+ if (!mHasAccuracy) {
+ mHasAccuracy = true;
+ mAccuracy = 100.0f;
+ }
+ if (mTime == 0) mTime = System.currentTimeMillis();
+ if (mElapsedRealtimeNano == 0) mElapsedRealtimeNano = SystemClock.elapsedRealtimeNano();
+ }
+
+ /**
* Returns additional provider-specific information about the
* location fix as a Bundle. The keys and values are determined
* by the provider. If no additional information is available,
@@ -681,6 +769,7 @@
@Override public String toString() {
return "Location[mProvider=" + mProvider +
",mTime=" + mTime +
+ ",mElapsedRealtimeNano=" + mElapsedRealtimeNano +
",mLatitude=" + mLatitude +
",mLongitude=" + mLongitude +
",mHasAltitude=" + mHasAltitude +
@@ -700,6 +789,7 @@
String provider = in.readString();
Location l = new Location(provider);
l.mTime = in.readLong();
+ l.mElapsedRealtimeNano = in.readLong();
l.mLatitude = in.readDouble();
l.mLongitude = in.readDouble();
l.mHasAltitude = in.readInt() != 0;
@@ -726,6 +816,7 @@
public void writeToParcel(Parcel parcel, int flags) {
parcel.writeString(mProvider);
parcel.writeLong(mTime);
+ parcel.writeLong(mElapsedRealtimeNano);
parcel.writeDouble(mLatitude);
parcel.writeDouble(mLongitude);
parcel.writeInt(mHasAltitude ? 1 : 0);
diff --git a/location/java/android/location/LocationManager.java b/location/java/android/location/LocationManager.java
index ff74f41..15a2928 100644
--- a/location/java/android/location/LocationManager.java
+++ b/location/java/android/location/LocationManager.java
@@ -19,11 +19,13 @@
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
+import android.os.Build;
import android.os.Bundle;
import android.os.Looper;
import android.os.RemoteException;
import android.os.Handler;
import android.os.Message;
+import android.os.SystemClock;
import android.util.Log;
import com.android.internal.location.DummyLocationProvider;
@@ -1220,8 +1222,11 @@
}
/**
- * Sets a mock location for the given provider. This location will be used in place
- * of any actual location from the provider.
+ * Sets a mock location for the given provider.
+ * <p>This location will be used in place of any actual location from the provider.
+ * The location object must have a minimum number of fields set to be
+ * considered a valid LocationProvider Location, as per documentation
+ * on {@link Location} class.
*
* @param provider the provider name
* @param loc the mock location
@@ -1230,8 +1235,20 @@
* or the {@link android.provider.Settings.Secure#ALLOW_MOCK_LOCATION
* Settings.Secure.ALLOW_MOCK_LOCATION}} system setting is not enabled
* @throws IllegalArgumentException if no provider with the given name exists
+ * @throws IllegalArgumentException if the location is incomplete
*/
public void setTestProviderLocation(String provider, Location loc) {
+ if (!loc.isComplete()) {
+ if (mContext.getApplicationInfo().targetSdkVersion <= Build.VERSION_CODES.JELLY_BEAN) {
+ // for backwards compatibility, allow mock locations that are incomplete
+ Log.w(TAG, "Incomplete Location object", new Throwable());
+ loc.makeComplete();
+ } else {
+ throw new IllegalArgumentException(
+ "Location object not complete. Missing timestamps or accuracy?");
+ }
+ }
+
try {
mService.setTestProviderLocation(provider, loc);
} catch (RemoteException ex) {
diff --git a/media/java/android/media/MediaPlayer.java b/media/java/android/media/MediaPlayer.java
index e76d25a..870a4a9 100644
--- a/media/java/android/media/MediaPlayer.java
+++ b/media/java/android/media/MediaPlayer.java
@@ -2026,6 +2026,7 @@
if (msg.obj instanceof Parcel) {
Parcel parcel = (Parcel)msg.obj;
TimedText text = new TimedText(parcel);
+ parcel.recycle();
mOnTimedTextListener.onTimedText(mMediaPlayer, text);
}
}
diff --git a/media/jni/android_media_MediaPlayer.cpp b/media/jni/android_media_MediaPlayer.cpp
index de22e09..c2a6889 100644
--- a/media/jni/android_media_MediaPlayer.cpp
+++ b/media/jni/android_media_MediaPlayer.cpp
@@ -72,7 +72,6 @@
JNIMediaPlayerListener();
jclass mClass; // Reference to MediaPlayer class
jobject mObject; // Weak ref to MediaPlayer Java object to call on
- jobject mParcel;
};
JNIMediaPlayerListener::JNIMediaPlayerListener(JNIEnv* env, jobject thiz, jobject weak_thiz)
@@ -91,7 +90,6 @@
// We use a weak reference so the MediaPlayer object can be garbage collected.
// The reference is only used as a proxy for callbacks.
mObject = env->NewGlobalRef(weak_thiz);
- mParcel = env->NewGlobalRef(createJavaParcelObject(env));
}
JNIMediaPlayerListener::~JNIMediaPlayerListener()
@@ -100,20 +98,18 @@
JNIEnv *env = AndroidRuntime::getJNIEnv();
env->DeleteGlobalRef(mObject);
env->DeleteGlobalRef(mClass);
-
- recycleJavaParcelObject(env, mParcel);
- env->DeleteGlobalRef(mParcel);
}
void JNIMediaPlayerListener::notify(int msg, int ext1, int ext2, const Parcel *obj)
{
JNIEnv *env = AndroidRuntime::getJNIEnv();
if (obj && obj->dataSize() > 0) {
- if (mParcel != NULL) {
- Parcel* nativeParcel = parcelForJavaObject(env, mParcel);
+ jobject jParcel = createJavaParcelObject(env);
+ if (jParcel != NULL) {
+ Parcel* nativeParcel = parcelForJavaObject(env, jParcel);
nativeParcel->setData(obj->data(), obj->dataSize());
env->CallStaticVoidMethod(mClass, fields.post_event, mObject,
- msg, ext1, ext2, mParcel);
+ msg, ext1, ext2, jParcel);
}
} else {
env->CallStaticVoidMethod(mClass, fields.post_event, mObject,
diff --git a/opengl/java/android/opengl/EGL14.java b/opengl/java/android/opengl/EGL14.java
index 31fc04aa..4cdc272 100644
--- a/opengl/java/android/opengl/EGL14.java
+++ b/opengl/java/android/opengl/EGL14.java
@@ -24,10 +24,10 @@
import android.view.SurfaceView;
import android.view.SurfaceHolder;
-
/**
-* @hide
-*/
+ * EGL 1.4
+ *
+ */
public class EGL14 {
public static final int EGL_DEFAULT_DISPLAY = 0;
@@ -150,18 +150,18 @@
static {
_nativeClassInit();
}
- /* @hide C function EGLint eglGetError ( void ) */
+ // C function EGLint eglGetError ( void )
public static native int eglGetError(
);
- /* @hide C function EGLDisplay eglGetDisplay ( EGLNativeDisplayType display_id ) */
+ // C function EGLDisplay eglGetDisplay ( EGLNativeDisplayType display_id )
public static native EGLDisplay eglGetDisplay(
int display_id
);
- /* @hide C function EGLBoolean eglInitialize ( EGLDisplay dpy, EGLint *major, EGLint *minor ) */
+ // C function EGLBoolean eglInitialize ( EGLDisplay dpy, EGLint *major, EGLint *minor )
public static native boolean eglInitialize(
EGLDisplay dpy,
@@ -171,7 +171,7 @@
int minorOffset
);
- /* @hide C function EGLBoolean eglTerminate ( EGLDisplay dpy ) */
+ // C function EGLBoolean eglTerminate ( EGLDisplay dpy )
public static native boolean eglTerminate(
EGLDisplay dpy
@@ -183,7 +183,7 @@
EGLDisplay dpy,
int name
);
- /* @hide C function EGLBoolean eglGetConfigs ( EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config ) */
+ // C function EGLBoolean eglGetConfigs ( EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config )
public static native boolean eglGetConfigs(
EGLDisplay dpy,
@@ -194,7 +194,7 @@
int num_configOffset
);
- /* @hide C function EGLBoolean eglChooseConfig ( EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config ) */
+ // C function EGLBoolean eglChooseConfig ( EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config )
public static native boolean eglChooseConfig(
EGLDisplay dpy,
@@ -207,7 +207,7 @@
int num_configOffset
);
- /* @hide C function EGLBoolean eglGetConfigAttrib ( EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value ) */
+ // C function EGLBoolean eglGetConfigAttrib ( EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value )
public static native boolean eglGetConfigAttrib(
EGLDisplay dpy,
@@ -265,7 +265,7 @@
return surface;
}
- /* @hide C function EGLSurface eglCreatePbufferSurface ( EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list ) */
+ // C function EGLSurface eglCreatePbufferSurface ( EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list )
public static native EGLSurface eglCreatePbufferSurface(
EGLDisplay dpy,
@@ -274,7 +274,7 @@
int offset
);
- /* @hide C function EGLSurface eglCreatePixmapSurface ( EGLDisplay dpy, EGLConfig config, EGLNativePixmapType pixmap, const EGLint *attrib_list ) */
+ // C function EGLSurface eglCreatePixmapSurface ( EGLDisplay dpy, EGLConfig config, EGLNativePixmapType pixmap, const EGLint *attrib_list )
public static native EGLSurface eglCreatePixmapSurface(
EGLDisplay dpy,
@@ -284,14 +284,14 @@
int offset
);
- /* @hide C function EGLBoolean eglDestroySurface ( EGLDisplay dpy, EGLSurface surface ) */
+ // C function EGLBoolean eglDestroySurface ( EGLDisplay dpy, EGLSurface surface )
public static native boolean eglDestroySurface(
EGLDisplay dpy,
EGLSurface surface
);
- /* @hide C function EGLBoolean eglQuerySurface ( EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value ) */
+ // C function EGLBoolean eglQuerySurface ( EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value )
public static native boolean eglQuerySurface(
EGLDisplay dpy,
@@ -301,28 +301,28 @@
int offset
);
- /* @hide C function EGLBoolean eglBindAPI ( EGLenum api ) */
+ // C function EGLBoolean eglBindAPI ( EGLenum api )
public static native boolean eglBindAPI(
int api
);
- /* @hide C function EGLenum eglQueryAPI ( void ) */
+ // C function EGLenum eglQueryAPI ( void )
public static native int eglQueryAPI(
);
- /* @hide C function EGLBoolean eglWaitClient ( void ) */
+ // C function EGLBoolean eglWaitClient ( void )
public static native boolean eglWaitClient(
);
- /* @hide C function EGLBoolean eglReleaseThread ( void ) */
+ // C function EGLBoolean eglReleaseThread ( void )
public static native boolean eglReleaseThread(
);
- /* @hide C function EGLSurface eglCreatePbufferFromClientBuffer ( EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint *attrib_list ) */
+ // C function EGLSurface eglCreatePbufferFromClientBuffer ( EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint *attrib_list )
public static native EGLSurface eglCreatePbufferFromClientBuffer(
EGLDisplay dpy,
@@ -333,7 +333,7 @@
int offset
);
- /* @hide C function EGLBoolean eglSurfaceAttrib ( EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value ) */
+ // C function EGLBoolean eglSurfaceAttrib ( EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value )
public static native boolean eglSurfaceAttrib(
EGLDisplay dpy,
@@ -342,7 +342,7 @@
int value
);
- /* @hide C function EGLBoolean eglBindTexImage ( EGLDisplay dpy, EGLSurface surface, EGLint buffer ) */
+ // C function EGLBoolean eglBindTexImage ( EGLDisplay dpy, EGLSurface surface, EGLint buffer )
public static native boolean eglBindTexImage(
EGLDisplay dpy,
@@ -350,7 +350,7 @@
int buffer
);
- /* @hide C function EGLBoolean eglReleaseTexImage ( EGLDisplay dpy, EGLSurface surface, EGLint buffer ) */
+ // C function EGLBoolean eglReleaseTexImage ( EGLDisplay dpy, EGLSurface surface, EGLint buffer )
public static native boolean eglReleaseTexImage(
EGLDisplay dpy,
@@ -358,14 +358,14 @@
int buffer
);
- /* @hide C function EGLBoolean eglSwapInterval ( EGLDisplay dpy, EGLint interval ) */
+ // C function EGLBoolean eglSwapInterval ( EGLDisplay dpy, EGLint interval )
public static native boolean eglSwapInterval(
EGLDisplay dpy,
int interval
);
- /* @hide C function EGLContext eglCreateContext ( EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint *attrib_list ) */
+ // C function EGLContext eglCreateContext ( EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint *attrib_list )
public static native EGLContext eglCreateContext(
EGLDisplay dpy,
@@ -375,14 +375,14 @@
int offset
);
- /* @hide C function EGLBoolean eglDestroyContext ( EGLDisplay dpy, EGLContext ctx ) */
+ // C function EGLBoolean eglDestroyContext ( EGLDisplay dpy, EGLContext ctx )
public static native boolean eglDestroyContext(
EGLDisplay dpy,
EGLContext ctx
);
- /* @hide C function EGLBoolean eglMakeCurrent ( EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx ) */
+ // C function EGLBoolean eglMakeCurrent ( EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx )
public static native boolean eglMakeCurrent(
EGLDisplay dpy,
@@ -391,23 +391,23 @@
EGLContext ctx
);
- /* @hide C function EGLContext eglGetCurrentContext ( void ) */
+ // C function EGLContext eglGetCurrentContext ( void )
public static native EGLContext eglGetCurrentContext(
);
- /* @hide C function EGLSurface eglGetCurrentSurface ( EGLint readdraw ) */
+ // C function EGLSurface eglGetCurrentSurface ( EGLint readdraw )
public static native EGLSurface eglGetCurrentSurface(
int readdraw
);
- /* @hide C function EGLDisplay eglGetCurrentDisplay ( void ) */
+ // C function EGLDisplay eglGetCurrentDisplay ( void )
public static native EGLDisplay eglGetCurrentDisplay(
);
- /* @hide C function EGLBoolean eglQueryContext ( EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint *value ) */
+ // C function EGLBoolean eglQueryContext ( EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint *value )
public static native boolean eglQueryContext(
EGLDisplay dpy,
@@ -417,25 +417,25 @@
int offset
);
- /* @hide C function EGLBoolean eglWaitGL ( void ) */
+ // C function EGLBoolean eglWaitGL ( void )
public static native boolean eglWaitGL(
);
- /* @hide C function EGLBoolean eglWaitNative ( EGLint engine ) */
+ // C function EGLBoolean eglWaitNative ( EGLint engine )
public static native boolean eglWaitNative(
int engine
);
- /* @hide C function EGLBoolean eglSwapBuffers ( EGLDisplay dpy, EGLSurface surface ) */
+ // C function EGLBoolean eglSwapBuffers ( EGLDisplay dpy, EGLSurface surface )
public static native boolean eglSwapBuffers(
EGLDisplay dpy,
EGLSurface surface
);
- /* @hide C function EGLBoolean eglCopyBuffers ( EGLDisplay dpy, EGLSurface surface, EGLNativePixmapType target ) */
+ // C function EGLBoolean eglCopyBuffers ( EGLDisplay dpy, EGLSurface surface, EGLNativePixmapType target )
public static native boolean eglCopyBuffers(
EGLDisplay dpy,
diff --git a/opengl/java/android/opengl/EGLConfig.java b/opengl/java/android/opengl/EGLConfig.java
index d9aebfc..d457c9f 100644
--- a/opengl/java/android/opengl/EGLConfig.java
+++ b/opengl/java/android/opengl/EGLConfig.java
@@ -18,10 +18,11 @@
package android.opengl;
/**
- * @hide
+ * Wrapper class for native EGLConfig objects.
+ *
*/
public class EGLConfig extends EGLObjectHandle {
- public EGLConfig(int handle) {
+ private EGLConfig(int handle) {
super(handle);
}
@@ -33,9 +34,4 @@
EGLConfig that = (EGLConfig) o;
return getHandle() == that.getHandle();
}
-
- @Override
- public int hashCode() {
- return getHandle();
- }
}
diff --git a/opengl/java/android/opengl/EGLContext.java b/opengl/java/android/opengl/EGLContext.java
index 7b194f3..41b8ef1 100644
--- a/opengl/java/android/opengl/EGLContext.java
+++ b/opengl/java/android/opengl/EGLContext.java
@@ -18,10 +18,11 @@
package android.opengl;
/**
- * @hide
+ * Wrapper class for native EGLContext objects.
+ *
*/
public class EGLContext extends EGLObjectHandle {
- public EGLContext(int handle) {
+ private EGLContext(int handle) {
super(handle);
}
@@ -33,9 +34,4 @@
EGLContext that = (EGLContext) o;
return getHandle() == that.getHandle();
}
-
- @Override
- public int hashCode() {
- return getHandle();
- }
}
diff --git a/opengl/java/android/opengl/EGLDisplay.java b/opengl/java/android/opengl/EGLDisplay.java
index a090cf0..17d1a64 100644
--- a/opengl/java/android/opengl/EGLDisplay.java
+++ b/opengl/java/android/opengl/EGLDisplay.java
@@ -18,10 +18,11 @@
package android.opengl;
/**
- * @hide
+ * Wrapper class for native EGLDisplay objects.
+ *
*/
public class EGLDisplay extends EGLObjectHandle {
- public EGLDisplay(int handle) {
+ private EGLDisplay(int handle) {
super(handle);
}
@@ -33,9 +34,4 @@
EGLDisplay that = (EGLDisplay) o;
return getHandle() == that.getHandle();
}
-
- @Override
- public int hashCode() {
- return getHandle();
- }
}
diff --git a/opengl/java/android/opengl/EGLObjectHandle.java b/opengl/java/android/opengl/EGLObjectHandle.java
index 01f9bd4..d2710de 100644
--- a/opengl/java/android/opengl/EGLObjectHandle.java
+++ b/opengl/java/android/opengl/EGLObjectHandle.java
@@ -18,16 +18,30 @@
package android.opengl;
/**
- * @hide
+ * Base class for wrapped EGL objects.
+ *
*/
public abstract class EGLObjectHandle {
private final int mHandle;
- public EGLObjectHandle(int handle) {
+ protected EGLObjectHandle(int handle) {
mHandle = handle;
}
+ /**
+ * Returns the native handle of the wrapped EGL object. This handle can be
+ * cast to the corresponding native type on the native side.
+ *
+ * For example, EGLDisplay dpy = (EGLDisplay)handle;
+ *
+ * @return the native handle of the wrapped EGL object.
+ */
public int getHandle() {
return mHandle;
}
+
+ @Override
+ public int hashCode() {
+ return getHandle();
+ }
}
diff --git a/opengl/java/android/opengl/EGLSurface.java b/opengl/java/android/opengl/EGLSurface.java
index 4800a64..65bec4f 100644
--- a/opengl/java/android/opengl/EGLSurface.java
+++ b/opengl/java/android/opengl/EGLSurface.java
@@ -18,10 +18,11 @@
package android.opengl;
/**
- * @hide
+ * Wrapper class for native EGLSurface objects.
+ *
*/
public class EGLSurface extends EGLObjectHandle {
- public EGLSurface(int handle) {
+ private EGLSurface(int handle) {
super(handle);
}
@@ -33,9 +34,4 @@
EGLSurface that = (EGLSurface) o;
return getHandle() == that.getHandle();
}
-
- @Override
- public int hashCode() {
- return getHandle();
- }
}
diff --git a/opengl/java/android/opengl/GLES20.java b/opengl/java/android/opengl/GLES20.java
index 635f811..2eeae62 100644
--- a/opengl/java/android/opengl/GLES20.java
+++ b/opengl/java/android/opengl/GLES20.java
@@ -829,6 +829,25 @@
byte name
);
+ // C function void glGetActiveAttrib ( GLuint program, GLuint index, GLsizei bufsize, GLsizei *length, GLint *size, GLenum *type, char *name )
+
+ public static native String glGetActiveAttrib(
+ int program,
+ int index,
+ int[] size,
+ int sizeOffset,
+ int[] type,
+ int typeOffset
+ );
+
+ // C function void glGetActiveAttrib ( GLuint program, GLuint index, GLsizei bufsize, GLsizei *length, GLint *size, GLenum *type, char *name )
+
+ public static native String glGetActiveAttrib(
+ int program,
+ int index,
+ java.nio.IntBuffer size,
+ java.nio.IntBuffer type
+ );
// C function void glGetActiveUniform ( GLuint program, GLuint index, GLsizei bufsize, GLsizei *length, GLint *size, GLenum *type, char *name )
public static native void glGetActiveUniform(
@@ -856,7 +875,25 @@
java.nio.IntBuffer type,
byte name
);
+ // C function void glGetActiveUniform ( GLuint program, GLuint index, GLsizei bufsize, GLsizei *length, GLint *size, GLenum *type, char *name )
+ public static native String glGetActiveUniform(
+ int program,
+ int index,
+ int[] size,
+ int sizeOffset,
+ int[] type,
+ int typeOffset
+ );
+
+ // C function void glGetActiveUniform ( GLuint program, GLuint index, GLsizei bufsize, GLsizei *length, GLint *size, GLenum *type, char *name )
+
+ public static native String glGetActiveUniform(
+ int program,
+ int index,
+ java.nio.IntBuffer size,
+ java.nio.IntBuffer type
+ );
// C function void glGetAttachedShaders ( GLuint program, GLsizei maxcount, GLsizei *count, GLuint *shaders )
public static native void glGetAttachedShaders(
@@ -1105,6 +1142,11 @@
byte source
);
+ // C function void glGetShaderSource ( GLuint shader, GLsizei bufsize, GLsizei *length, char *source )
+
+ public static native String glGetShaderSource(
+ int shader
+ );
/*
* Copyright (C) 2009 The Android Open Source Project
*
diff --git a/packages/SystemUI/res/values-fa/strings.xml b/packages/SystemUI/res/values-fa/strings.xml
index 888564b9..2c66897 100644
--- a/packages/SystemUI/res/values-fa/strings.xml
+++ b/packages/SystemUI/res/values-fa/strings.xml
@@ -48,12 +48,12 @@
<string name="status_bar_settings_notifications" msgid="397146176280905137">"اعلانها"</string>
<string name="bluetooth_tethered" msgid="7094101612161133267">"اتصال اینترنتی با بلوتوث تلفن همراه"</string>
<string name="status_bar_input_method_settings_configure_input_methods" msgid="3504292471512317827">"تنظیم روشهای ورودی"</string>
- <string name="status_bar_use_physical_keyboard" msgid="7551903084416057810">"صفحه کلید فیزیکی"</string>
+ <string name="status_bar_use_physical_keyboard" msgid="7551903084416057810">"صفحهکلید فیزیکی"</string>
<string name="usb_device_permission_prompt" msgid="834698001271562057">"به برنامه <xliff:g id="APPLICATION">%1$s</xliff:g> اجازه میدهید به دستگاه USB دسترسی داشته باشد؟"</string>
<string name="usb_accessory_permission_prompt" msgid="5171775411178865750">"به برنامه <xliff:g id="APPLICATION">%1$s</xliff:g> اجازه میدهد تا به وسیله جانبی USB دسترسی داشته باشد؟"</string>
<string name="usb_device_confirm_prompt" msgid="5161205258635253206">"وقتی این دستگاه USB وصل است، <xliff:g id="ACTIVITY">%1$s</xliff:g> باز شود؟"</string>
<string name="usb_accessory_confirm_prompt" msgid="3808984931830229888">"وقتی این وسیله جانبی USB وصل است، <xliff:g id="ACTIVITY">%1$s</xliff:g> باز شود؟"</string>
- <string name="usb_accessory_uri_prompt" msgid="513450621413733343">"هیچ برنامه کاربردی نصب شدهای با این وسیله جانبی USB کار نمیکند. در <xliff:g id="URL">%1$s</xliff:g> درباره این وسیله جانبی اطلاعات بیشتری کسب کنید"</string>
+ <string name="usb_accessory_uri_prompt" msgid="513450621413733343">"هیچ برنامهٔ کاربردی نصب شدهای با این وسیله جانبی USB کار نمیکند. در <xliff:g id="URL">%1$s</xliff:g> دربارهٔ این وسیله جانبی اطلاعات بیشتری کسب کنید"</string>
<string name="title_usb_accessory" msgid="4966265263465181372">"لوازم جانبی USB"</string>
<string name="label_view" msgid="6304565553218192990">"مشاهده"</string>
<string name="always_use_device" msgid="1450287437017315906">"استفاده به صورت پیشفرض برای این دستگاه USB"</string>
diff --git a/packages/SystemUI/res/values-sw/strings.xml b/packages/SystemUI/res/values-sw/strings.xml
index 00d3bac..b333bbe 100644
--- a/packages/SystemUI/res/values-sw/strings.xml
+++ b/packages/SystemUI/res/values-sw/strings.xml
@@ -51,7 +51,7 @@
<string name="usb_accessory_permission_prompt" msgid="5171775411178865750">"Ruhusu programu <xliff:g id="APPLICATION">%1$s</xliff:g> kufikia kifaa cha ziada cha USB?"</string>
<string name="usb_device_confirm_prompt" msgid="5161205258635253206">"Je, ungetaka kufungua <xliff:g id="ACTIVITY">%1$s</xliff:g>wakati kifaa cha USB kimeunganishwa?"</string>
<string name="usb_accessory_confirm_prompt" msgid="3808984931830229888">"Je, ungetaka kufungua <xliff:g id="ACTIVITY">%1$s</xliff:g>wakati kifaa cha USB kimeunganishwa?"</string>
- <string name="usb_accessory_uri_prompt" msgid="513450621413733343">"Hakuna programu zilizosakinishwa zinazofanya kazi na kifaa hiki cha USB. Jifunze zaidi kuhusu kifaa hiki kwenye <xliff:g id="URL">%1$s</xliff:g>"</string>
+ <string name="usb_accessory_uri_prompt" msgid="513450621413733343">"Hakuna programu zilizosakinishwa zinazofanya kazi na kifaa hiki cha USB. Pata maelezo zaidi kuhusu kifaa hiki kwenye <xliff:g id="URL">%1$s</xliff:g>"</string>
<string name="title_usb_accessory" msgid="4966265263465181372">"Kifaa cha Usb"</string>
<string name="label_view" msgid="6304565553218192990">"Ona"</string>
<string name="always_use_device" msgid="1450287437017315906">"Kwa kifaa hiki cha USB tumia chaguo-msingi"</string>
diff --git a/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java b/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java
index 0bdf84a..cb69660 100644
--- a/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java
+++ b/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java
@@ -21,6 +21,7 @@
import android.app.ActivityManager;
import android.app.ActivityManagerNative;
import android.app.ActivityOptions;
+import android.app.TaskStackBuilder;
import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
@@ -845,8 +846,9 @@
private void startApplicationDetailsActivity(String packageName) {
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS,
Uri.fromParts("package", packageName, null));
- intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
- getContext().startActivity(intent);
+ intent.setComponent(intent.resolveActivity(mContext.getPackageManager()));
+ TaskStackBuilder.create(getContext())
+ .addNextIntentWithParentStack(intent).startActivities();
}
public boolean onInterceptTouchEvent(MotionEvent ev) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
index bd8be1f..b392648 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
@@ -16,9 +16,24 @@
package com.android.systemui.statusbar;
+import com.android.internal.statusbar.IStatusBarService;
+import com.android.internal.statusbar.StatusBarIcon;
+import com.android.internal.statusbar.StatusBarIconList;
+import com.android.internal.statusbar.StatusBarNotification;
+import com.android.internal.widget.SizeAdaptiveLayout;
+import com.android.systemui.R;
+import com.android.systemui.SearchPanelView;
+import com.android.systemui.SystemUI;
+import com.android.systemui.recent.RecentTasksLoader;
+import com.android.systemui.recent.RecentsPanelView;
+import com.android.systemui.recent.TaskDescription;
+import com.android.systemui.statusbar.policy.NotificationRowLayout;
+import com.android.systemui.statusbar.tablet.StatusBarPanel;
+
import android.app.ActivityManagerNative;
import android.app.KeyguardManager;
import android.app.PendingIntent;
+import android.app.TaskStackBuilder;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
@@ -51,22 +66,6 @@
import android.widget.PopupMenu;
import android.widget.RemoteViews;
-import com.android.internal.statusbar.IStatusBarService;
-import com.android.internal.statusbar.StatusBarIcon;
-import com.android.internal.statusbar.StatusBarIconList;
-import com.android.internal.statusbar.StatusBarNotification;
-import com.android.internal.widget.SizeAdaptiveLayout;
-import com.android.systemui.R;
-import com.android.systemui.SearchPanelView;
-import com.android.systemui.SystemUI;
-import com.android.systemui.recent.RecentTasksLoader;
-import com.android.systemui.recent.RecentsPanelView;
-import com.android.systemui.recent.TaskDescription;
-import com.android.systemui.statusbar.CommandQueue;
-import com.android.systemui.statusbar.NotificationData.Entry;
-import com.android.systemui.statusbar.policy.NotificationRowLayout;
-import com.android.systemui.statusbar.tablet.StatusBarPanel;
-
import java.util.ArrayList;
public abstract class BaseStatusBar extends SystemUI implements
@@ -299,8 +298,8 @@
private void startApplicationDetailsActivity(String packageName) {
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS,
Uri.fromParts("package", packageName, null));
- intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
- mContext.startActivity(intent);
+ intent.setComponent(intent.resolveActivity(mContext.getPackageManager()));
+ TaskStackBuilder.create(mContext).addNextIntentWithParentStack(intent).startActivities();
}
protected View.OnLongClickListener getNotificationLongClicker() {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/GestureRecorder.java b/packages/SystemUI/src/com/android/systemui/statusbar/GestureRecorder.java
new file mode 100755
index 0000000..b4b29da
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/GestureRecorder.java
@@ -0,0 +1,258 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package com.android.systemui.statusbar;
+
+import java.io.BufferedWriter;
+import java.io.FileDescriptor;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.HashSet;
+import java.util.LinkedList;
+
+import android.os.Handler;
+import android.os.Message;
+import android.os.SystemClock;
+import android.util.Slog;
+import android.view.MotionEvent;
+
+/**
+ * Convenience class for capturing gestures for later analysis.
+ */
+public class GestureRecorder {
+ public static final boolean DEBUG = true; // for now
+ public static final String TAG = GestureRecorder.class.getSimpleName();
+
+ public class Gesture {
+ public abstract class Record {
+ long time;
+ public abstract String toJson();
+ }
+ public class MotionEventRecord extends Record {
+ public MotionEvent event;
+ public MotionEventRecord(long when, MotionEvent event) {
+ this.time = when;
+ this.event = event.copy();
+ }
+ String actionName(int action) {
+ switch (action) {
+ case MotionEvent.ACTION_DOWN:
+ return "down";
+ case MotionEvent.ACTION_UP:
+ return "up";
+ case MotionEvent.ACTION_MOVE:
+ return "move";
+ case MotionEvent.ACTION_CANCEL:
+ return "cancel";
+ default:
+ return String.valueOf(action);
+ }
+ }
+ public String toJson() {
+ return String.format(
+ ("{\"type\":\"motion\", \"time\":%d, \"action\":\"%s\", "
+ + "\"x\":%.2f, \"y\":%.2f, \"s\":%.2f, \"p\":%.2f}"),
+ this.time,
+ actionName(this.event.getAction()),
+ this.event.getRawX(),
+ this.event.getRawY(),
+ this.event.getSize(),
+ this.event.getPressure()
+ );
+ }
+ }
+ public class TagRecord extends Record {
+ public String tag, info;
+ public TagRecord(long when, String tag, String info) {
+ this.time = when;
+ this.tag = tag;
+ this.info = info;
+ }
+ public String toJson() {
+ return String.format("{\"type\":\"tag\", \"time\":%d, \"tag\":\"%s\", \"info\":\"%s\"}",
+ this.time,
+ this.tag,
+ this.info
+ );
+ }
+ }
+ private LinkedList<Record> mRecords = new LinkedList<Record>();
+ private HashSet<String> mTags = new HashSet<String>();
+ long mDownTime = -1;
+ boolean mComplete = false;
+
+ public void add(MotionEvent ev) {
+ mRecords.add(new MotionEventRecord(ev.getEventTime(), ev));
+ if (mDownTime < 0) {
+ mDownTime = ev.getDownTime();
+ } else {
+ if (mDownTime != ev.getDownTime()) {
+ // TODO: remove
+ throw new RuntimeException("Assertion failure in GestureRecorder: event downTime ("
+ +ev.getDownTime()+") does not match gesture downTime ("+mDownTime+")");
+ }
+ }
+ switch (ev.getActionMasked()) {
+ case MotionEvent.ACTION_UP:
+ case MotionEvent.ACTION_CANCEL:
+ mComplete = true;
+ }
+ }
+ public void tag(long when, String tag, String info) {
+ mRecords.add(new TagRecord(when, tag, info));
+ mTags.add(tag);
+ }
+ public boolean isComplete() {
+ return mComplete;
+ }
+ public String toJson() {
+ StringBuilder sb = new StringBuilder();
+ boolean first = true;
+ sb.append("[");
+ for (Record r : mRecords) {
+ if (!first) sb.append(", ");
+ first = false;
+ sb.append(r.toJson());
+ }
+ sb.append("]");
+ return sb.toString();
+ }
+ }
+
+ // -=-=-=-=-=-=-=-=-=-=-=-
+
+ static final long SAVE_DELAY = 5000; // ms
+ static final int SAVE_MESSAGE = 6351;
+
+ private LinkedList<Gesture> mGestures;
+ private Gesture mCurrentGesture;
+ private int mLastSaveLen = -1;
+ private String mLogfile;
+
+ private Handler mHandler = new Handler() {
+ @Override
+ public void handleMessage(Message msg) {
+ if (msg.what == SAVE_MESSAGE) {
+ save();
+ }
+ }
+ };
+
+ public GestureRecorder(String filename) {
+ mLogfile = filename;
+ mGestures = new LinkedList<Gesture>();
+ mCurrentGesture = null;
+ }
+
+ public void add(MotionEvent ev) {
+ synchronized (mGestures) {
+ if (mCurrentGesture == null || mCurrentGesture.isComplete()) {
+ mCurrentGesture = new Gesture();
+ mGestures.add(mCurrentGesture);
+ }
+ mCurrentGesture.add(ev);
+ }
+ saveLater();
+ }
+
+ public void tag(long when, String tag, String info) {
+ synchronized (mGestures) {
+ if (mCurrentGesture == null) {
+ mCurrentGesture = new Gesture();
+ mGestures.add(mCurrentGesture);
+ }
+ mCurrentGesture.tag(when, tag, info);
+ }
+ saveLater();
+ }
+
+ public void tag(long when, String tag) {
+ tag(when, tag, null);
+ }
+
+ public void tag(String tag) {
+ tag(SystemClock.uptimeMillis(), tag, null);
+ }
+
+ public void tag(String tag, String info) {
+ tag(SystemClock.uptimeMillis(), tag, info);
+ }
+
+ /**
+ * Generates a JSON string capturing all completed gestures.
+ * Not threadsafe; call with a lock.
+ */
+ public String toJsonLocked() {
+ StringBuilder sb = new StringBuilder();
+ boolean first = true;
+ sb.append("[");
+ int count = 0;
+ for (Gesture g : mGestures) {
+ if (!g.isComplete()) continue;
+ if (!first) sb.append("," );
+ first = false;
+ sb.append(g.toJson());
+ count++;
+ }
+ mLastSaveLen = count;
+ sb.append("]");
+ return sb.toString();
+ }
+
+ public String toJson() {
+ String s;
+ synchronized (mGestures) {
+ s = toJsonLocked();
+ }
+ return s;
+ }
+
+ public void saveLater() {
+ mHandler.removeMessages(SAVE_MESSAGE);
+ mHandler.sendEmptyMessageDelayed(SAVE_MESSAGE, SAVE_DELAY);
+ }
+
+ public void save() {
+ synchronized (mGestures) {
+ try {
+ BufferedWriter w = new BufferedWriter(new FileWriter(mLogfile, /*append=*/ true));
+ w.append(toJsonLocked() + "\n");
+ w.close();
+ mGestures.clear();
+ // If we have a pending gesture, push it back
+ if (!mCurrentGesture.isComplete()) {
+ mGestures.add(mCurrentGesture);
+ }
+ if (DEBUG) {
+ Slog.v(TAG, String.format("Wrote %d complete gestures to %s", mLastSaveLen, mLogfile));
+ }
+ } catch (IOException e) {
+ Slog.e(TAG, String.format("Couldn't write gestures to %s", mLogfile), e);
+ mLastSaveLen = -1;
+ }
+ }
+ }
+
+ public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
+ save();
+ if (mLastSaveLen >= 0) {
+ pw.println(String.valueOf(mLastSaveLen) + " gestures written to " + mLogfile);
+ } else {
+ pw.println("error writing gestures");
+ }
+ }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
index ffe3db20..25de109 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -79,6 +79,7 @@
import com.android.systemui.recent.RecentTasksLoader;
import com.android.systemui.statusbar.BaseStatusBar;
import com.android.systemui.statusbar.CommandQueue;
+import com.android.systemui.statusbar.GestureRecorder;
import com.android.systemui.statusbar.NotificationData;
import com.android.systemui.statusbar.NotificationData.Entry;
import com.android.systemui.statusbar.RotationToggle;
@@ -242,6 +243,9 @@
DisplayMetrics mDisplayMetrics = new DisplayMetrics();
+ // XXX: gesture research
+ private GestureRecorder mGestureRec = new GestureRecorder("/sdcard/statusbar_gestures.dat");
+
private int mNavigationIconHints = 0;
private final Animator.AnimatorListener mMakeIconsInvisible = new AnimatorListenerAdapter() {
@Override
@@ -1215,6 +1219,7 @@
+ " mExpandedVisible=" + mExpandedVisible
+ " mExpanded=" + mExpanded
+ " mAnimating=" + mAnimating
+ + " mAnimatingReveal=" + mAnimatingReveal
+ " mAnimY=" + mAnimY
+ " mAnimVel=" + mAnimVel
+ " flags=" + flags);
@@ -1235,7 +1240,7 @@
}
int y;
- if (mAnimating) {
+ if (mAnimating || mAnimatingReveal) {
y = (int)mAnimY;
} else {
y = getExpandedViewMaxHeight()-1;
@@ -1270,6 +1275,10 @@
if (!mExpandedVisible) {
return;
}
+
+ // Ensure the panel is fully collapsed (just in case; bug 6765842)
+ updateExpandedViewPos(0);
+
mExpandedVisible = false;
mPile.setLayoutTransitionsEnabled(false);
if (mNavigationBarView != null)
@@ -1565,6 +1574,8 @@
}
}
+ mGestureRec.add(event);
+
if ((mDisabled & StatusBarManager.DISABLE_EXPAND) != 0) {
return false;
}
@@ -1599,6 +1610,7 @@
if (x >= edgeBorder && x < mDisplayMetrics.widthPixels - edgeBorder) {
prepareTracking(y, !mExpanded);// opening if we're not already fully visible
trackMovement(event);
+ mGestureRec.tag("tracking", mExpanded ? "expanded" : "collapsed");
}
}
} else if (mTracking) {
@@ -1649,6 +1661,8 @@
mFlingY = y;
}
mFlingVelocity = vel;
+ mGestureRec.tag("fling " + ((mFlingVelocity > 0) ? "open" : "closed"),
+ "v=" + mFlingVelocity);
mHandler.post(mPerformFling);
}
@@ -1933,6 +1947,9 @@
}
}
+ pw.print(" status bar gestures: ");
+ mGestureRec.dump(fd, pw, args);
+
mNetworkController.dump(fd, pw, args);
}
@@ -1992,9 +2009,14 @@
@Override
protected void updateExpandedViewPos(int expandedPosition) {
if (SPEW) {
- Slog.d(TAG, "updateExpandedViewPos before expandedPosition=" + expandedPosition
+ Slog.d(TAG, "updateExpandedViewPos: expandedPosition=" + expandedPosition
//+ " mTrackingParams.y=" + ((mTrackingParams == null) ? "?" : mTrackingParams.y)
+ + " mTracking=" + mTracking
+ " mTrackingPosition=" + mTrackingPosition
+ + " mExpandedVisible=" + mExpandedVisible
+ + " mAnimating=" + mAnimating
+ + " mAnimatingReveal=" + mAnimatingReveal
+ + " mClosing=" + mClosing
+ " gravity=" + mNotificationPanelGravity);
}
int panelh = 0;
@@ -2003,6 +2025,7 @@
// If the expanded view is not visible, make sure they're still off screen.
// Maybe the view was resized.
if (!mExpandedVisible) {
+ if (SPEW) Slog.d(TAG, "updateExpandedViewPos: view not visible, bailing");
updateExpandedInvisiblePosition();
return;
}
@@ -2023,13 +2046,21 @@
}
// catch orientation changes and other peculiar cases
- if (panelh > disph || (panelh < disph && !mTracking && !mAnimating)) {
+ if (panelh > 0 &&
+ ((panelh > disph) ||
+ (panelh < disph && !mTracking && !mAnimating))) {
+ if (SPEW) Slog.d(TAG, "updateExpandedViewPos: orientation change?");
panelh = disph;
} else if (panelh < 0) {
panelh = 0;
}
- if (panelh == mTrackingPosition) return;
+ if (SPEW) Slog.d(TAG, "updateExpandedViewPos: adjusting size to panelh=" + panelh);
+
+ if (panelh == mTrackingPosition) {
+ if (SPEW) Slog.d(TAG, "updateExpandedViewPos: panelh == mTrackingPosition, bailing");
+ return;
+ }
mTrackingPosition = panelh;
@@ -2186,8 +2217,7 @@
private BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() {
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
- if (Intent.ACTION_CLOSE_SYSTEM_DIALOGS.equals(action)
- || Intent.ACTION_SCREEN_OFF.equals(action)) {
+ if (Intent.ACTION_CLOSE_SYSTEM_DIALOGS.equals(action)) {
int flags = CommandQueue.FLAG_EXCLUDE_NONE;
if (Intent.ACTION_CLOSE_SYSTEM_DIALOGS.equals(action)) {
String reason = intent.getStringExtra("reason");
@@ -2197,6 +2227,10 @@
}
animateCollapse(flags);
}
+ else if (Intent.ACTION_SCREEN_OFF.equals(action)) {
+ // no waiting!
+ performCollapse();
+ }
else if (Intent.ACTION_CONFIGURATION_CHANGED.equals(action)) {
updateResources();
repositionNavigationBar();
diff --git a/packages/VpnDialogs/res/values-fa/strings.xml b/packages/VpnDialogs/res/values-fa/strings.xml
index 7bd5590..ec163af 100644
--- a/packages/VpnDialogs/res/values-fa/strings.xml
+++ b/packages/VpnDialogs/res/values-fa/strings.xml
@@ -17,7 +17,7 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="prompt" msgid="8359175999006833462">"<xliff:g id="APP">%s</xliff:g> تلاش میکند یک اتصال VPN ایجاد کند."</string>
- <string name="warning" msgid="5470743576660160079">"با ادامه دادن، به برنامه کاربردی اجازه میدهید تمام ترافیک شبکه را رهگیری کند. "<b>"تا به برنامه اعتماد نکردید آن را قبول نکنید."</b>" در غیر این صورت، این ریسک را قبول میکنید که دادههای شما توسط یک نرمافزار مخرب به خطر بیفتد."</string>
+ <string name="warning" msgid="5470743576660160079">"با ادامه دادن، به برنامهٔ کاربردی اجازه میدهید تمام ترافیک شبکه را رهگیری کند. "<b>"تا به برنامه اعتماد نکردید آن را قبول نکنید."</b>" در غیر این صورت، این ریسک را قبول میکنید که دادههای شما توسط یک نرمافزار مخرب به خطر بیفتد."</string>
<string name="accept" msgid="2889226408765810173">"من به این برنامه اعتماد دارم."</string>
<string name="legacy_title" msgid="192936250066580964">"VPN متصل است"</string>
<string name="configure" msgid="4905518375574791375">"پیکربندی"</string>
diff --git a/services/common_time/clock_recovery.cpp b/services/common_time/clock_recovery.cpp
index 4a5b2ef..3a7c70c 100644
--- a/services/common_time/clock_recovery.cpp
+++ b/services/common_time/clock_recovery.cpp
@@ -225,6 +225,9 @@
if (current_point == min_rtt || rtt < control_thresh_) {
delta_f = delta = nominal_common_time - observed_common;
+ last_error_est_valid_ = true;
+ last_error_est_usec_ = delta;
+
// Compute the error then clamp to the panic threshold. If we ever
// exceed this amt of error, its time to panic and reset the system.
// Given that the error in the measurement of the error could be as
@@ -258,7 +261,6 @@
// Save error terms for later.
last_delta_f_ = delta_f;
- last_delta_ = delta;
// Clamp CO to +/- 100ppm.
if (CO < COmin)
@@ -295,8 +297,8 @@
int32_t ClockRecoveryLoop::getLastErrorEstimate() {
Mutex::Autolock lock(&lock_);
- if (last_delta_valid_)
- return last_delta_;
+ if (last_error_est_valid_)
+ return last_error_est_usec_;
else
return ICommonClock::kErrorEstimateUnknown;
}
@@ -310,8 +312,8 @@
}
if (frequency) {
- last_delta_valid_ = false;
- last_delta_ = 0;
+ last_error_est_valid_ = false;
+ last_error_est_usec_ = 0;
last_delta_f_ = 0.0;
CO = 0.0f;
lastCObias = CObias = 0.0f;
diff --git a/services/common_time/clock_recovery.h b/services/common_time/clock_recovery.h
index 20fbf96..b6c87ff 100644
--- a/services/common_time/clock_recovery.h
+++ b/services/common_time/clock_recovery.h
@@ -108,8 +108,8 @@
// parameters maintained while running and reset during a reset
// of the frequency correction.
- bool last_delta_valid_;
- int32_t last_delta_;
+ bool last_error_est_valid_;
+ int32_t last_error_est_usec_;
float last_delta_f_;
int32_t integrated_error_;
int32_t tgt_correction_;
diff --git a/services/common_time/common_time_server.cpp b/services/common_time/common_time_server.cpp
index 0125709..16be8f1 100644
--- a/services/common_time/common_time_server.cpp
+++ b/services/common_time/common_time_server.cpp
@@ -107,6 +107,9 @@
, mTimelineID(ICommonClock::kInvalidTimelineID)
, mClockSynced(false)
, mCommonClockHasClients(false)
+ , mStateChangeLog("Recent State Change Events", 30)
+ , mElectionLog("Recent Master Election Traffic", 30)
+ , mBadPktLog("Recent Bad Packet RX Info", 8)
, mInitial_WhoIsMasterRequestTimeouts(0)
, mClient_MasterDeviceID(0)
, mClient_MasterDevicePriority(0)
@@ -330,10 +333,11 @@
// we are in any other state (CLIENT, RONIN or WAIT_FOR_ELECTION),
// then transition to either INITIAL or MASTER depending on whether
// or not our timeline is valid.
- ALOGI("Entering networkless mode interface is %s, "
- "shouldAutoDisable = %s",
- mBindIfaceValid ? "valid" : "invalid",
- shouldAutoDisable() ? "true" : "false");
+ mStateChangeLog.log(ANDROID_LOG_INFO, LOG_TAG,
+ "Entering networkless mode interface is %s, "
+ "shouldAutoDisable = %s",
+ mBindIfaceValid ? "valid" : "invalid",
+ shouldAutoDisable() ? "true" : "false");
if ((mState != ICommonClock::STATE_INITIAL) &&
(mState != ICommonClock::STATE_MASTER)) {
if (mTimelineID == ICommonClock::kInvalidTimelineID)
@@ -415,20 +419,23 @@
sockaddrToString(mMasterElectionEP, true, masterElectionEPStr,
sizeof(masterElectionEPStr));
- ALOGI("Building socket :: bind = %s master election = %s",
- mBindIface.string(), masterElectionEPStr);
+ mStateChangeLog.log(ANDROID_LOG_INFO, LOG_TAG,
+ "Building socket :: bind = %s master election = %s",
+ mBindIface.string(), masterElectionEPStr);
// TODO: add proper support for IPv6. Right now, we block IPv6 addresses at
// the configuration interface level.
if (AF_INET != mMasterElectionEP.ss_family) {
- ALOGW("TODO: add proper IPv6 support");
+ mStateChangeLog.log(ANDROID_LOG_WARN, LOG_TAG,
+ "TODO: add proper IPv6 support");
goto bailout;
}
// open a UDP socket for the timeline serivce
mSocket = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
if (mSocket < 0) {
- ALOGE("Failed to create socket (errno = %d)", errno);
+ mStateChangeLog.log(ANDROID_LOG_ERROR, LOG_TAG,
+ "Failed to create socket (errno = %d)", errno);
goto bailout;
}
@@ -440,8 +447,9 @@
rc = setsockopt(mSocket, SOL_SOCKET, SO_BINDTODEVICE,
(void *)&ifr, sizeof(ifr));
if (rc) {
- ALOGE("Failed to bind socket at to interface %s (errno = %d)",
- ifr.ifr_name, errno);
+ mStateChangeLog.log(ANDROID_LOG_ERROR, LOG_TAG,
+ "Failed to bind socket at to interface %s "
+ "(errno = %d)", ifr.ifr_name, errno);
goto bailout;
}
@@ -459,8 +467,9 @@
reinterpret_cast<const sockaddr *>(&bindAddr),
sizeof(bindAddr));
if (rc) {
- ALOGE("Failed to bind socket to port %hu (errno = %d)",
- ntohs(bindAddr.sin_port), errno);
+ mStateChangeLog.log(ANDROID_LOG_ERROR, LOG_TAG,
+ "Failed to bind socket to port %hu (errno = %d)",
+ ntohs(bindAddr.sin_port), errno);
goto bailout;
}
@@ -483,17 +492,20 @@
rc = setsockopt(mSocket, IPPROTO_IP, IP_MULTICAST_LOOP,
&zero, sizeof(zero));
if (rc == -1) {
- ALOGE("Failed to disable multicast loopback (errno = %d)", errno);
+ mStateChangeLog.log(ANDROID_LOG_ERROR, LOG_TAG,
+ "Failed to disable multicast loopback "
+ "(errno = %d)", errno);
goto bailout;
}
} else
if (ntohl(ipv4_addr->sin_addr.s_addr) == 0xFFFFFFFF) {
// If the master election address is the broadcast address, then enable
// the broadcast socket option
- const int one = 1;
rc = setsockopt(mSocket, SOL_SOCKET, SO_BROADCAST, &one, sizeof(one));
if (rc == -1) {
- ALOGE("Failed to enable broadcast (errno = %d)", errno);
+ mStateChangeLog.log(ANDROID_LOG_ERROR, LOG_TAG,
+ "Failed to enable broadcast (errno = %d)",
+ errno);
goto bailout;
}
} else {
@@ -507,7 +519,8 @@
// the local subnet)
rc = setsockopt(mSocket, IPPROTO_IP, IP_TTL, &one, sizeof(one));
if (rc == -1) {
- ALOGE("Failed to set TTL to %d (errno = %d)", one, errno);
+ mStateChangeLog.log(ANDROID_LOG_ERROR, LOG_TAG,
+ "Failed to set TTL to %d (errno = %d)", one, errno);
goto bailout;
}
@@ -569,6 +582,31 @@
((devicePrio1 == devicePrio2) && (deviceID1 > deviceID2)));
}
+static void hexDumpToString(const uint8_t* src, size_t src_len,
+ char* dst, size_t dst_len) {
+ size_t offset;
+ size_t i;
+
+ for (i = 0; (i < src_len) && (offset < dst_len); ++i) {
+ int res;
+ if (0 == (i % 16)) {
+ res = snprintf(dst + offset, dst_len - offset, "\n%04x :", i);
+ if (res < 0)
+ break;
+ offset += res;
+ if (offset >= dst_len)
+ break;
+ }
+
+ res = snprintf(dst + offset, dst_len - offset, " %02x", src[i]);
+ if (res < 0)
+ break;
+ offset += res;
+ }
+
+ dst[dst_len - 1] = 0;
+}
+
bool CommonTimeServer::handlePacket() {
uint8_t buf[256];
struct sockaddr_storage srcAddr;
@@ -579,14 +617,24 @@
reinterpret_cast<const sockaddr *>(&srcAddr), &srcAddrLen);
if (recvBytes < 0) {
- ALOGE("%s:%d recvfrom failed", __PRETTY_FUNCTION__, __LINE__);
+ mBadPktLog.log(ANDROID_LOG_ERROR, LOG_TAG,
+ "recvfrom failed (res %d, errno %d)",
+ recvBytes, errno);
return false;
}
UniversalTimeServicePacket pkt;
- recvBytes = pkt.deserializePacket(buf, recvBytes, mSyncGroupID);
- if (recvBytes < 0)
+ if (pkt.deserializePacket(buf, recvBytes, mSyncGroupID) < 0) {
+ char hex[256];
+ char srcEPStr[64];
+
+ hexDumpToString(buf, static_cast<size_t>(recvBytes), hex, sizeof(hex));
+ sockaddrToString(srcAddr, true, srcEPStr, sizeof(srcEPStr));
+
+ mBadPktLog.log("Failed to parse %d byte packet from %s.%s",
+ recvBytes, srcEPStr, hex);
return false;
+ }
bool result;
switch (pkt.packetType) {
@@ -614,8 +662,13 @@
break;
default: {
- ALOGD("%s:%d unknown packet type(%d)",
- __PRETTY_FUNCTION__, __LINE__, pkt.packetType);
+ char srcEPStr[64];
+ sockaddrToString(srcAddr, true, srcEPStr, sizeof(srcEPStr));
+
+ mBadPktLog.log(ANDROID_LOG_WARN, LOG_TAG,
+ "unknown packet type (%d) from %s",
+ pkt.packetType, srcEPStr);
+
result = false;
} break;
}
@@ -699,6 +752,14 @@
bool CommonTimeServer::handleWhoIsMasterRequest(
const WhoIsMasterRequestPacket* request,
const sockaddr_storage& srcAddr) {
+
+ char srcEPStr[64];
+ sockaddrToString(srcAddr, true, srcEPStr, sizeof(srcEPStr));
+ mElectionLog.log("RXed WhoIs master request while in state %s. "
+ "src %s reqTID %016llx ourTID %016llx",
+ stateToString(mState), srcEPStr,
+ request->timelineID, mTimelineID);
+
if (mState == ICommonClock::STATE_MASTER) {
// is this request related to this master's timeline?
if (request->timelineID != ICommonClock::kInvalidTimelineID &&
@@ -710,6 +771,13 @@
pkt.deviceID = mDeviceID;
pkt.devicePriority = effectivePriority();
+ mElectionLog.log("TXing WhoIs master resp to %s while in state %s. "
+ "ourTID %016llx ourGID %016llx ourDID %016llx "
+ "ourPrio %u",
+ srcEPStr, stateToString(mState),
+ mTimelineID, mSyncGroupID,
+ pkt.deviceID, pkt.devicePriority);
+
uint8_t buf[256];
ssize_t bufSz = pkt.serializePacket(buf, sizeof(buf));
if (bufSz < 0)
@@ -761,6 +829,17 @@
bool CommonTimeServer::handleWhoIsMasterResponse(
const WhoIsMasterResponsePacket* response,
const sockaddr_storage& srcAddr) {
+ char srcEPStr[64];
+ sockaddrToString(srcAddr, true, srcEPStr, sizeof(srcEPStr));
+ mElectionLog.log("RXed WhoIs master response while in state %s. "
+ "src %s respTID %016llx respDID %016llx respPrio %u "
+ "ourTID %016llx",
+ stateToString(mState), srcEPStr,
+ response->timelineID,
+ response->deviceID,
+ static_cast<uint32_t>(response->devicePriority),
+ mTimelineID);
+
if (mState == ICommonClock::STATE_INITIAL || mState == ICommonClock::STATE_RONIN) {
return becomeClient(srcAddr,
response->deviceID,
@@ -917,6 +996,14 @@
uint8_t newDevicePrio = packet->devicePriority;
uint64_t newTimelineID = packet->timelineID;
+ char srcEPStr[64];
+ sockaddrToString(srcAddr, true, srcEPStr, sizeof(srcEPStr));
+ mElectionLog.log("RXed master announcement while in state %s. "
+ "src %s srcDevID %lld srcPrio %u srcTID %016llx",
+ stateToString(mState), srcEPStr,
+ newDeviceID, static_cast<uint32_t>(newDevicePrio),
+ newTimelineID);
+
if (mState == ICommonClock::STATE_INITIAL ||
mState == ICommonClock::STATE_RONIN ||
mState == ICommonClock::STATE_WAIT_FOR_ELECTION) {
@@ -973,6 +1060,15 @@
uint8_t buf[256];
ssize_t bufSz = pkt.serializePacket(buf, sizeof(buf));
if (bufSz >= 0) {
+ char dstEPStr[64];
+ sockaddrToString(mMasterElectionEP, true, dstEPStr, sizeof(dstEPStr));
+ mElectionLog.log("TXing WhoIs master request to %s while in state %s. "
+ "ourTID %016llx ourGID %016llx ourDID %016llx "
+ "ourPrio %u",
+ dstEPStr, stateToString(mState),
+ mTimelineID, mSyncGroupID,
+ pkt.senderDeviceID, pkt.senderDevicePriority);
+
ssize_t sendBytes = sendto(
mSocket, buf, bufSz, 0,
reinterpret_cast<const sockaddr *>(&mMasterElectionEP),
@@ -1049,6 +1145,15 @@
uint8_t buf[256];
ssize_t bufSz = pkt.serializePacket(buf, sizeof(buf));
if (bufSz >= 0) {
+ char dstEPStr[64];
+ sockaddrToString(mMasterElectionEP, true, dstEPStr, sizeof(dstEPStr));
+ mElectionLog.log("TXing Master announcement to %s while in state %s. "
+ "ourTID %016llx ourGID %016llx ourDID %016llx "
+ "ourPrio %u",
+ dstEPStr, stateToString(mState),
+ mTimelineID, mSyncGroupID,
+ pkt.deviceID, pkt.devicePriority);
+
ssize_t sendBytes = sendto(
mSocket, buf, bufSz, 0,
reinterpret_cast<const sockaddr *>(&mMasterElectionEP),
@@ -1071,15 +1176,16 @@
sockaddrToString(masterEP, true, newEPStr, sizeof(newEPStr));
sockaddrToString(mMasterEP, mMasterEPValid, oldEPStr, sizeof(oldEPStr));
- ALOGI("%s --> CLIENT (%s) :%s"
- " OldMaster: %02x-%014llx::%016llx::%s"
- " NewMaster: %02x-%014llx::%016llx::%s",
- stateToString(mState), cause,
- (mTimelineID != timelineID) ? " (new timeline)" : "",
- mClient_MasterDevicePriority, mClient_MasterDeviceID,
- mTimelineID, oldEPStr,
- masterDevicePriority, masterDeviceID,
- timelineID, newEPStr);
+ mStateChangeLog.log(ANDROID_LOG_INFO, LOG_TAG,
+ "%s --> CLIENT (%s) :%s"
+ " OldMaster: %02x-%014llx::%016llx::%s"
+ " NewMaster: %02x-%014llx::%016llx::%s",
+ stateToString(mState), cause,
+ (mTimelineID != timelineID) ? " (new timeline)" : "",
+ mClient_MasterDevicePriority, mClient_MasterDeviceID,
+ mTimelineID, oldEPStr,
+ masterDevicePriority, masterDeviceID,
+ timelineID, newEPStr);
if (mTimelineID != timelineID) {
// start following a new timeline
@@ -1132,11 +1238,12 @@
notifyClockSync();
}
- ALOGI("%s --> MASTER (%s) : %s timeline %016llx",
- stateToString(mState), cause,
- (oldTimelineID == mTimelineID) ? "taking ownership of"
- : "creating new",
- mTimelineID);
+ mStateChangeLog.log(ANDROID_LOG_INFO, LOG_TAG,
+ "%s --> MASTER (%s) : %s timeline %016llx",
+ stateToString(mState), cause,
+ (oldTimelineID == mTimelineID) ? "taking ownership of"
+ : "creating new",
+ mTimelineID);
memset(&mMasterEP, 0, sizeof(mMasterEP));
mMasterEPValid = false;
@@ -1165,7 +1272,8 @@
mMasterEPValid = false;
if (mCommonClock.isValid()) {
- ALOGI("%s --> RONIN (%s) : lost track of previously valid timeline "
+ mStateChangeLog.log(ANDROID_LOG_INFO, LOG_TAG,
+ "%s --> RONIN (%s) : lost track of previously valid timeline "
"%02x-%014llx::%016llx::%s (%d TXed %d RXed %d RXExpired)",
stateToString(mState), cause,
mClient_MasterDevicePriority, mClient_MasterDeviceID,
@@ -1178,7 +1286,8 @@
setState(ICommonClock::STATE_RONIN);
return sendWhoIsMasterRequest();
} else {
- ALOGI("%s --> INITIAL (%s) : never synced timeline "
+ mStateChangeLog.log(ANDROID_LOG_INFO, LOG_TAG,
+ "%s --> INITIAL (%s) : never synced timeline "
"%02x-%014llx::%016llx::%s (%d TXed %d RXed %d RXExpired)",
stateToString(mState), cause,
mClient_MasterDevicePriority, mClient_MasterDeviceID,
@@ -1192,7 +1301,8 @@
}
bool CommonTimeServer::becomeWaitForElection(const char* cause) {
- ALOGI("%s --> WAIT_FOR_ELECTION (%s) : dropping out of election,"
+ mStateChangeLog.log(ANDROID_LOG_INFO, LOG_TAG,
+ "%s --> WAIT_FOR_ELECTION (%s) : dropping out of election,"
" waiting %d mSec for completion.",
stateToString(mState), cause, kWaitForElection_TimeoutMs);
@@ -1202,7 +1312,9 @@
}
bool CommonTimeServer::becomeInitial(const char* cause) {
- ALOGI("Entering INITIAL (%s), total reset.", cause);
+ mStateChangeLog.log(ANDROID_LOG_INFO, LOG_TAG,
+ "Entering INITIAL (%s), total reset.",
+ cause);
setState(ICommonClock::STATE_INITIAL);
diff --git a/services/common_time/common_time_server.h b/services/common_time/common_time_server.h
index b2ad3f0..f6a2419 100644
--- a/services/common_time/common_time_server.h
+++ b/services/common_time/common_time_server.h
@@ -238,6 +238,11 @@
// interface AND currently active common clock clients.
bool mCommonClockHasClients;
+ // Internal logs used for dumpsys.
+ LogRing mStateChangeLog;
+ LogRing mElectionLog;
+ LogRing mBadPktLog;
+
// Configuration info
struct sockaddr_storage mMasterElectionEP; // Endpoint over which we conduct master election
String8 mBindIface; // Endpoint for the service to bind to.
diff --git a/services/common_time/common_time_server_api.cpp b/services/common_time/common_time_server_api.cpp
index fb8c261..e1570718 100644
--- a/services/common_time/common_time_server_api.cpp
+++ b/services/common_time/common_time_server_api.cpp
@@ -354,6 +354,9 @@
dump_printf("Active Clients : %u\n", activeClients);
mClient_PacketRTTLog.dumpLog(fd, mCommonClock);
+ mStateChangeLog.dumpLog(fd);
+ mElectionLog.dumpLog(fd);
+ mBadPktLog.dumpLog(fd);
}
return NO_ERROR;
diff --git a/services/common_time/utils.cpp b/services/common_time/utils.cpp
index 3ed2599..ed2c77d 100644
--- a/services/common_time/utils.cpp
+++ b/services/common_time/utils.cpp
@@ -14,6 +14,9 @@
* limitations under the License.
*/
+#define LOG_TAG "common_time"
+#include <utils/Log.h>
+
#include "utils.h"
namespace android {
@@ -46,4 +49,116 @@
return static_cast<int>(delta);
}
+LogRing::LogRing(const char* header, size_t entries)
+ : mSize(entries)
+ , mWr(0)
+ , mIsFull(false)
+ , mHeader(header) {
+ mRingBuffer = new Entry[mSize];
+ if (NULL == mRingBuffer)
+ ALOGE("Failed to allocate log ring with %u entries.", mSize);
+}
+
+LogRing::~LogRing() {
+ if (NULL != mRingBuffer)
+ delete[] mRingBuffer;
+}
+
+void LogRing::log(int prio, const char* tag, const char* fmt, ...) {
+ va_list argp;
+ va_start(argp, fmt);
+ internalLog(prio, tag, fmt, argp);
+ va_end(argp);
+}
+
+void LogRing::log(const char* fmt, ...) {
+ va_list argp;
+ va_start(argp, fmt);
+ internalLog(0, NULL, fmt, argp);
+ va_end(argp);
+}
+
+void LogRing::internalLog(int prio,
+ const char* tag,
+ const char* fmt,
+ va_list argp) {
+ if (NULL != mRingBuffer) {
+ Mutex::Autolock lock(&mLock);
+ String8 s(String8::formatV(fmt, argp));
+ Entry* last = NULL;
+
+ if (mIsFull || mWr)
+ last = &(mRingBuffer[(mWr + mSize - 1) % mSize]);
+
+
+ if ((NULL != last) && !last->s.compare(s)) {
+ gettimeofday(&(last->last_ts), NULL);
+ ++last->count;
+ } else {
+ gettimeofday(&mRingBuffer[mWr].first_ts, NULL);
+ mRingBuffer[mWr].last_ts = mRingBuffer[mWr].first_ts;
+ mRingBuffer[mWr].count = 1;
+ mRingBuffer[mWr].s.setTo(s);
+
+ mWr = (mWr + 1) % mSize;
+ if (!mWr)
+ mIsFull = true;
+ }
+ }
+
+ if (NULL != tag)
+ LOG_PRI_VA(prio, tag, fmt, argp);
+}
+
+void LogRing::dumpLog(int fd) {
+ if (NULL == mRingBuffer)
+ return;
+
+ Mutex::Autolock lock(&mLock);
+
+ if (!mWr && !mIsFull)
+ return;
+
+ char buf[1024];
+ int res;
+ size_t start = mIsFull ? mWr : 0;
+ size_t count = mIsFull ? mSize : mWr;
+ static const char* kTimeFmt = "%a %b %d %Y %H:%M:%S";
+
+ res = snprintf(buf, sizeof(buf), "\n%s\n", mHeader);
+ if (res > 0)
+ write(fd, buf, res);
+
+ for (size_t i = 0; i < count; ++i) {
+ struct tm t;
+ char timebuf[64];
+ char repbuf[96];
+ size_t ndx = (start + i) % mSize;
+
+ if (1 != mRingBuffer[ndx].count) {
+ localtime_r(&mRingBuffer[ndx].last_ts.tv_sec, &t);
+ strftime(timebuf, sizeof(timebuf), kTimeFmt, &t);
+ snprintf(repbuf, sizeof(repbuf),
+ " (repeated %d times, last was %s.%03ld)",
+ mRingBuffer[ndx].count,
+ timebuf,
+ mRingBuffer[ndx].last_ts.tv_usec / 1000);
+ repbuf[sizeof(repbuf) - 1] = 0;
+ } else {
+ repbuf[0] = 0;
+ }
+
+ localtime_r(&mRingBuffer[ndx].first_ts.tv_sec, &t);
+ strftime(timebuf, sizeof(timebuf), kTimeFmt, &t);
+ res = snprintf(buf, sizeof(buf), "[%2d] %s.%03ld :: %s%s\n",
+ i, timebuf,
+ mRingBuffer[ndx].first_ts.tv_usec / 1000,
+ mRingBuffer[ndx].s.string(),
+ repbuf);
+
+ if (res > 0)
+ write(fd, buf, res);
+ }
+}
+
} // namespace android
diff --git a/services/common_time/utils.h b/services/common_time/utils.h
index d3545c9..c28cf0a 100644
--- a/services/common_time/utils.h
+++ b/services/common_time/utils.h
@@ -20,6 +20,8 @@
#include <stdint.h>
#include <unistd.h>
+#include <utils/String8.h>
+#include <utils/threads.h>
#include <utils/Timers.h>
namespace android {
@@ -43,6 +45,39 @@
nsecs_t mSystemEndTime;
};
+class LogRing {
+ public:
+ LogRing(const char* header, size_t entries);
+ ~LogRing();
+
+ // Send a log message to logcat as well as storing it in the ring buffer.
+ void log(int prio, const char* tag, const char* fmt, ...);
+
+ // Add a log message the ring buffer, do not send the message to logcat.
+ void log(const char* fmt, ...);
+
+ // Dump the log to an fd (dumpsys style)
+ void dumpLog(int fd);
+
+ private:
+ class Entry {
+ public:
+ uint32_t count;
+ struct timeval first_ts;
+ struct timeval last_ts;
+ String8 s;
+ };
+
+ Mutex mLock;
+ Entry* mRingBuffer;
+ size_t mSize;
+ size_t mWr;
+ bool mIsFull;
+ const char* mHeader;
+
+ void internalLog(int prio, const char* tag, const char* fmt, va_list va);
+};
+
} // namespace android
#endif // __UTILS_H__
diff --git a/services/java/com/android/server/LocationManagerService.java b/services/java/com/android/server/LocationManagerService.java
index 06b056d..1498a11 100644
--- a/services/java/com/android/server/LocationManagerService.java
+++ b/services/java/com/android/server/LocationManagerService.java
@@ -1532,6 +1532,11 @@
throw new SecurityException("Requires INSTALL_LOCATION_PROVIDER permission");
}
+ if (!location.isComplete()) {
+ Log.w(TAG, "Dropping incomplete location: " + location);
+ return;
+ }
+
mLocationHandler.removeMessages(MESSAGE_LOCATION_CHANGED, location);
Message m = Message.obtain(mLocationHandler, MESSAGE_LOCATION_CHANGED, location);
m.arg1 = (passive ? 1 : 0);
@@ -1588,7 +1593,8 @@
// Check whether sufficient time has passed
long minTime = record.mMinTime;
- if (loc.getTime() - lastLoc.getTime() < minTime - MAX_PROVIDER_SCHEDULING_JITTER) {
+ long delta = (loc.getElapsedRealtimeNano() - lastLoc.getElapsedRealtimeNano()) / 1000000L;
+ if (delta < minTime - MAX_PROVIDER_SCHEDULING_JITTER) {
return false;
}
diff --git a/services/java/com/android/server/UiModeManagerService.java b/services/java/com/android/server/UiModeManagerService.java
index d1f92a7..5299b71 100644
--- a/services/java/com/android/server/UiModeManagerService.java
+++ b/services/java/com/android/server/UiModeManagerService.java
@@ -308,7 +308,7 @@
/* if new location is older than the current one, the devices hasn't
* moved.
*/
- if (location.getTime() < mLocation.getTime()) {
+ if (location.getElapsedRealtimeNano() < mLocation.getElapsedRealtimeNano()) {
return false;
}
@@ -764,7 +764,8 @@
mLocationManager.getLastKnownLocation(providers.next());
// pick the most recent location
if (location == null || (lastKnownLocation != null &&
- location.getTime() < lastKnownLocation.getTime())) {
+ location.getElapsedRealtimeNano() <
+ lastKnownLocation.getElapsedRealtimeNano())) {
location = lastKnownLocation;
}
}
@@ -781,6 +782,7 @@
location.setLatitude(0);
location.setAccuracy(417000.0f);
location.setTime(System.currentTimeMillis());
+ location.setElapsedRealtimeNano(SystemClock.elapsedRealtimeNano());
}
synchronized (mLock) {
mLocation = location;
diff --git a/services/java/com/android/server/location/GpsLocationProvider.java b/services/java/com/android/server/location/GpsLocationProvider.java
index 4ad6140..8e75d94 100755
--- a/services/java/com/android/server/location/GpsLocationProvider.java
+++ b/services/java/com/android/server/location/GpsLocationProvider.java
@@ -1078,6 +1078,9 @@
mLocation.setLatitude(latitude);
mLocation.setLongitude(longitude);
mLocation.setTime(timestamp);
+ // It would be nice to push the elapsed real-time timestamp
+ // further down the stack, but this is still useful
+ mLocation.setElapsedRealtimeNano(SystemClock.elapsedRealtimeNano());
}
if ((flags & LOCATION_HAS_ALTITUDE) == LOCATION_HAS_ALTITUDE) {
mLocation.setAltitude(altitude);
diff --git a/services/java/com/android/server/location/LocationBasedCountryDetector.java b/services/java/com/android/server/location/LocationBasedCountryDetector.java
index d4fb8ee..38871d78 100755
--- a/services/java/com/android/server/location/LocationBasedCountryDetector.java
+++ b/services/java/com/android/server/location/LocationBasedCountryDetector.java
@@ -114,7 +114,9 @@
for (String provider : providers) {
Location lastKnownLocation = mLocationManager.getLastKnownLocation(provider);
if (lastKnownLocation != null) {
- if (bestLocation == null || bestLocation.getTime() < lastKnownLocation.getTime()) {
+ if (bestLocation == null ||
+ bestLocation.getElapsedRealtimeNano() <
+ lastKnownLocation.getElapsedRealtimeNano()) {
bestLocation = lastKnownLocation;
}
}
diff --git a/telephony/tests/telephonytests/src/com/android/internal/telephony/SmsUsageMonitorShortCodeTest.java b/telephony/tests/telephonytests/src/com/android/internal/telephony/SmsUsageMonitorShortCodeTest.java
deleted file mode 100644
index 3bb7c06..0000000
--- a/telephony/tests/telephonytests/src/com/android/internal/telephony/SmsUsageMonitorShortCodeTest.java
+++ /dev/null
@@ -1,466 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.internal.telephony;
-
-import android.test.AndroidTestCase;
-import android.test.suitebuilder.annotation.SmallTest;
-
-import static com.android.internal.telephony.SmsUsageMonitor.CATEGORY_FREE_SHORT_CODE;
-import static com.android.internal.telephony.SmsUsageMonitor.CATEGORY_NOT_SHORT_CODE;
-import static com.android.internal.telephony.SmsUsageMonitor.CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE;
-import static com.android.internal.telephony.SmsUsageMonitor.CATEGORY_PREMIUM_SHORT_CODE;
-import static com.android.internal.telephony.SmsUsageMonitor.CATEGORY_STANDARD_SHORT_CODE;
-
-/**
- * Test cases for SMS short code pattern matching in SmsUsageMonitor.
- */
-public class SmsUsageMonitorShortCodeTest extends AndroidTestCase {
-
- private static final class ShortCodeTest {
- final String countryIso;
- final String address;
- final int category;
-
- ShortCodeTest(String countryIso, String destAddress, int category) {
- this.countryIso = countryIso;
- this.address = destAddress;
- this.category = category;
- }
- }
-
- /**
- * List of short code test cases.
- */
- private static final ShortCodeTest[] sShortCodeTests = new ShortCodeTest[] {
- new ShortCodeTest("al", "112", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("al", "4321", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("al", "54321", CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest("al", "15191", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("al", "55500", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("al", "55600", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("al", "654321", CATEGORY_NOT_SHORT_CODE),
-
- new ShortCodeTest("am", "112", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("am", "101", CATEGORY_FREE_SHORT_CODE),
- new ShortCodeTest("am", "102", CATEGORY_FREE_SHORT_CODE),
- new ShortCodeTest("am", "103", CATEGORY_FREE_SHORT_CODE),
- new ShortCodeTest("am", "222", CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest("am", "1111", CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest("am", "9999", CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest("am", "1121", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("am", "1141", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("am", "1161", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("am", "3024", CATEGORY_PREMIUM_SHORT_CODE),
-
- new ShortCodeTest("at", "112", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("at", "116117", CATEGORY_FREE_SHORT_CODE),
- new ShortCodeTest("at", "0901234", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("at", "0900666266", CATEGORY_PREMIUM_SHORT_CODE),
-
- new ShortCodeTest("au", "112", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("au", "180000", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("au", "190000", CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest("au", "1900000", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("au", "19000000", CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest("au", "19998882", CATEGORY_PREMIUM_SHORT_CODE),
-
- new ShortCodeTest("az", "112", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("az", "1234", CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest("az", "12345", CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest("az", "87744", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("az", "3301", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("az", "3302", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("az", "9012", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("az", "9014", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("az", "9394", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("az", "87744", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("az", "93101", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("az", "123456", CATEGORY_NOT_SHORT_CODE),
-
- new ShortCodeTest("be", "112", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("be", "116117", CATEGORY_FREE_SHORT_CODE),
- new ShortCodeTest("be", "567890", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("be", "8000", CATEGORY_FREE_SHORT_CODE),
- new ShortCodeTest("be", "6566", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("be", "7777", CATEGORY_PREMIUM_SHORT_CODE),
-
- new ShortCodeTest("bg", "112", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("bg", "116117", CATEGORY_FREE_SHORT_CODE),
- new ShortCodeTest("bg", "1234", CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest("bg", "12345", CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest("bg", "1816", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("bg", "1915", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("bg", "1916", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("bg", "1935", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("bg", "18423", CATEGORY_PREMIUM_SHORT_CODE),
-
- new ShortCodeTest("by", "112", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("by", "1234", CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest("by", "3336", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("by", "5013", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("by", "5014", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("by", "7781", CATEGORY_PREMIUM_SHORT_CODE),
-
- new ShortCodeTest("ca", "911", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("ca", "+18005551234", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("ca", "8005551234", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("ca", "20000", CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest("ca", "200000", CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest("ca", "2000000", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("ca", "60999", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("ca", "88188", CATEGORY_PREMIUM_SHORT_CODE),
-
- new ShortCodeTest("ch", "112", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("ch", "123", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("ch", "234", CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest("ch", "3456", CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest("ch", "98765", CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest("ch", "543", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("ch", "83111", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("ch", "234567", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("ch", "87654321", CATEGORY_NOT_SHORT_CODE),
-
- new ShortCodeTest("cn", "120", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("cn", "1062503000", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("cn", "1065123456", CATEGORY_FREE_SHORT_CODE),
- new ShortCodeTest("cn", "1066335588", CATEGORY_PREMIUM_SHORT_CODE),
-
- new ShortCodeTest("cy", "112", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("cy", "116117", CATEGORY_FREE_SHORT_CODE),
- new ShortCodeTest("cy", "4321", CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest("cy", "54321", CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest("cy", "654321", CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest("cy", "7510", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("cy", "987654321", CATEGORY_NOT_SHORT_CODE),
-
- new ShortCodeTest("cz", "112", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("cz", "116117", CATEGORY_FREE_SHORT_CODE),
- new ShortCodeTest("cz", "9090150", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("cz", "90901599", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("cz", "987654321", CATEGORY_NOT_SHORT_CODE),
-
- new ShortCodeTest("de", "112", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("de", "116117", CATEGORY_FREE_SHORT_CODE),
- new ShortCodeTest("de", "1234", CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest("de", "12345", CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest("de", "8888", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("de", "11111", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("de", "11886", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("de", "22022", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("de", "23300", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("de", "3434", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("de", "34567", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("de", "41414", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("de", "55655", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("de", "66766", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("de", "66777", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("de", "77677", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("de", "80888", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("de", "1232286", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("de", "987654321", CATEGORY_NOT_SHORT_CODE),
-
- new ShortCodeTest("dk", "112", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("dk", "116117", CATEGORY_FREE_SHORT_CODE),
- new ShortCodeTest("dk", "1259", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("dk", "16123", CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest("dk", "987654321", CATEGORY_NOT_SHORT_CODE),
-
- new ShortCodeTest("ee", "112", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("ee", "116117", CATEGORY_FREE_SHORT_CODE),
- new ShortCodeTest("ee", "123", CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest("ee", "1259", CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest("ee", "15330", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("ee", "17999", CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest("ee", "17010", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("ee", "17013", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("ee", "9034567", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("ee", "34567890", CATEGORY_NOT_SHORT_CODE),
-
- new ShortCodeTest("es", "112", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("es", "116117", CATEGORY_FREE_SHORT_CODE),
- new ShortCodeTest("es", "25165", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("es", "27333", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("es", "995399", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("es", "87654321", CATEGORY_NOT_SHORT_CODE),
-
- new ShortCodeTest("fi", "112", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("fi", "116117", CATEGORY_FREE_SHORT_CODE),
- new ShortCodeTest("fi", "12345", CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest("fi", "123456", CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest("fi", "17159", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("fi", "17163", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("fi", "0600123", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("fi", "070012345", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("fi", "987654321", CATEGORY_NOT_SHORT_CODE),
-
- new ShortCodeTest("fr", "112", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("fr", "116117", CATEGORY_FREE_SHORT_CODE),
- new ShortCodeTest("fr", "34567", CATEGORY_FREE_SHORT_CODE),
- new ShortCodeTest("fr", "45678", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("fr", "81185", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("fr", "87654321", CATEGORY_NOT_SHORT_CODE),
-
- new ShortCodeTest("gb", "112", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("gb", "999", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("gb", "116117", CATEGORY_FREE_SHORT_CODE),
- new ShortCodeTest("gb", "4567", CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest("gb", "45678", CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest("gb", "56789", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("gb", "79067", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("gb", "80079", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("gb", "654321", CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest("gb", "7654321", CATEGORY_NOT_SHORT_CODE),
-
- new ShortCodeTest("ge", "112", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("ge", "8765", CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest("ge", "2345", CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest("ge", "8012", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("ge", "8013", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("ge", "8014", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("ge", "8889", CATEGORY_PREMIUM_SHORT_CODE),
-
- new ShortCodeTest("gr", "112", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("gr", "116117", CATEGORY_FREE_SHORT_CODE),
- new ShortCodeTest("gr", "54321", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("gr", "19567", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("gr", "19678", CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest("gr", "87654321", CATEGORY_NOT_SHORT_CODE),
-
- new ShortCodeTest("hu", "112", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("hu", "116117", CATEGORY_FREE_SHORT_CODE),
- new ShortCodeTest("hu", "012", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("hu", "0123", CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest("hu", "1234", CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest("hu", "1784", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("hu", "2345", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("hu", "01234", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("hu", "012345678", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("hu", "0123456789", CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest("hu", "1234567890", CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest("hu", "0691227910", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("hu", "2345678901", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("hu", "01234567890", CATEGORY_NOT_SHORT_CODE),
-
- new ShortCodeTest("ie", "112", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("ie", "116117", CATEGORY_FREE_SHORT_CODE),
- new ShortCodeTest("ie", "50123", CATEGORY_FREE_SHORT_CODE),
- new ShortCodeTest("ie", "51234", CATEGORY_STANDARD_SHORT_CODE),
- new ShortCodeTest("ie", "52345", CATEGORY_STANDARD_SHORT_CODE),
- new ShortCodeTest("ie", "57890", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("ie", "67890", CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest("ie", "87654321", CATEGORY_NOT_SHORT_CODE),
-
- new ShortCodeTest("il", "112", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("il", "5432", CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest("il", "4422", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("il", "4545", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("il", "98765", CATEGORY_NOT_SHORT_CODE),
-
- new ShortCodeTest("it", "112", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("it", "116117", CATEGORY_FREE_SHORT_CODE),
- new ShortCodeTest("it", "4567", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("it", "48000", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("it", "45678", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("it", "56789", CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest("it", "456789", CATEGORY_NOT_SHORT_CODE),
-
- new ShortCodeTest("kg", "112", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("kg", "5432", CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest("kg", "4152", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("kg", "4157", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("kg", "4449", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("kg", "98765", CATEGORY_NOT_SHORT_CODE),
-
- new ShortCodeTest("kz", "112", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("kz", "5432", CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest("kz", "9194", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("kz", "7790", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("kz", "98765", CATEGORY_NOT_SHORT_CODE),
-
- new ShortCodeTest("lt", "112", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("lt", "116117", CATEGORY_FREE_SHORT_CODE),
- new ShortCodeTest("lt", "123", CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest("lt", "1234", CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest("lt", "1381", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("lt", "1394", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("lt", "1645", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("lt", "12345", CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest("lt", "123456", CATEGORY_NOT_SHORT_CODE),
-
- new ShortCodeTest("lu", "112", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("lu", "116117", CATEGORY_FREE_SHORT_CODE),
- new ShortCodeTest("lu", "1234", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("lu", "12345", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("lu", "64747", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("lu", "678901", CATEGORY_NOT_SHORT_CODE),
-
- new ShortCodeTest("lv", "112", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("lv", "116117", CATEGORY_FREE_SHORT_CODE),
- new ShortCodeTest("lv", "5432", CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest("lv", "1819", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("lv", "1863", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("lv", "1874", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("lv", "98765", CATEGORY_NOT_SHORT_CODE),
-
- new ShortCodeTest("mx", "112", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("mx", "2345", CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest("mx", "7766", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("mx", "23456", CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest("mx", "53035", CATEGORY_PREMIUM_SHORT_CODE),
-
- new ShortCodeTest("my", "112", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("my", "1234", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("my", "23456", CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest("my", "32298", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("my", "33776", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("my", "345678", CATEGORY_NOT_SHORT_CODE),
-
- new ShortCodeTest("nl", "112", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("nl", "116117", CATEGORY_FREE_SHORT_CODE),
- new ShortCodeTest("nl", "1234", CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest("nl", "4466", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("nl", "5040", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("nl", "23456", CATEGORY_NOT_SHORT_CODE),
-
- new ShortCodeTest("no", "112", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("no", "1234", CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest("no", "2201", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("no", "2226", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("no", "2227", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("no", "23456", CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest("no", "234567", CATEGORY_NOT_SHORT_CODE),
-
- new ShortCodeTest("nz", "112", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("nz", "123", CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest("nz", "2345", CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest("nz", "3903", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("nz", "8995", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("nz", "23456", CATEGORY_NOT_SHORT_CODE),
-
- new ShortCodeTest("pl", "112", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("pl", "116117", CATEGORY_FREE_SHORT_CODE),
- new ShortCodeTest("pl", "7890", CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest("pl", "34567", CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest("pl", "7910", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("pl", "74240", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("pl", "79866", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("pl", "92525", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("pl", "87654321", CATEGORY_NOT_SHORT_CODE),
-
- new ShortCodeTest("pt", "112", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("pt", "116117", CATEGORY_FREE_SHORT_CODE),
- new ShortCodeTest("pt", "61000", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("pt", "62345", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("pt", "68304", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("pt", "69876", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("pt", "87654321", CATEGORY_NOT_SHORT_CODE),
-
- new ShortCodeTest("ro", "112", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("ro", "116117", CATEGORY_FREE_SHORT_CODE),
- new ShortCodeTest("ro", "1234", CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest("ro", "1263", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("ro", "1288", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("ro", "1314", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("ro", "1380", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("ro", "7890", CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest("ro", "12345", CATEGORY_NOT_SHORT_CODE),
-
- new ShortCodeTest("ru", "112", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("ru", "5432", CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest("ru", "1161", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("ru", "2097", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("ru", "3933", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("ru", "7781", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("ru", "98765", CATEGORY_NOT_SHORT_CODE),
-
- new ShortCodeTest("se", "112", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("se", "116117", CATEGORY_FREE_SHORT_CODE),
- new ShortCodeTest("se", "1234", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("se", "72345", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("se", "72999", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("se", "123456", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("se", "87654321", CATEGORY_NOT_SHORT_CODE),
-
- new ShortCodeTest("sg", "112", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("sg", "1234", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("sg", "70000", CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest("sg", "79999", CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest("sg", "73800", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("sg", "74688", CATEGORY_STANDARD_SHORT_CODE),
- new ShortCodeTest("sg", "987654", CATEGORY_NOT_SHORT_CODE),
-
- new ShortCodeTest("si", "112", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("si", "116117", CATEGORY_FREE_SHORT_CODE),
- new ShortCodeTest("si", "1234", CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest("si", "3838", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("si", "72999", CATEGORY_NOT_SHORT_CODE),
-
- new ShortCodeTest("sk", "112", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("sk", "116117", CATEGORY_FREE_SHORT_CODE),
- new ShortCodeTest("sk", "1234", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("sk", "6674", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("sk", "7604", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("sk", "72999", CATEGORY_NOT_SHORT_CODE),
-
- new ShortCodeTest("tj", "112", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("tj", "5432", CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest("tj", "1161", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("tj", "1171", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("tj", "4161", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("tj", "4449", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("tj", "98765", CATEGORY_NOT_SHORT_CODE),
-
- new ShortCodeTest("ua", "112", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("ua", "5432", CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest("ua", "4448", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("ua", "7094", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("ua", "7540", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("ua", "98765", CATEGORY_NOT_SHORT_CODE),
-
- new ShortCodeTest("us", "911", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("us", "+18005551234", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("us", "8005551234", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("us", "20000", CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest("us", "200000", CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest("us", "2000000", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("us", "20433", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("us", "21472", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("us", "23333", CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("us", "99807", CATEGORY_PREMIUM_SHORT_CODE),
-
- // generic rules for other countries: 5 digits or less considered potential short code
- new ShortCodeTest("zz", "2000000", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("zz", "54321", CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest("zz", "4321", CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest("zz", "321", CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest("zz", "112", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest(null, "2000000", CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest(null, "54321", CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest(null, "4321", CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest(null, "321", CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest(null, "112", CATEGORY_NOT_SHORT_CODE),
- };
-
- @SmallTest
- public void testSmsUsageMonitor() {
- SmsUsageMonitor monitor = new SmsUsageMonitor(getContext());
- for (ShortCodeTest test : sShortCodeTests) {
- assertEquals("country: " + test.countryIso + " number: " + test.address,
- test.category, monitor.checkDestination(test.address, test.countryIso));
- }
- }
-}
diff --git a/tests/HwAccelerationTest/AndroidManifest.xml b/tests/HwAccelerationTest/AndroidManifest.xml
index c5fdffb..e7247a3 100644
--- a/tests/HwAccelerationTest/AndroidManifest.xml
+++ b/tests/HwAccelerationTest/AndroidManifest.xml
@@ -42,6 +42,15 @@
</activity>
<activity
+ android:name="BigGradientActivity"
+ android:label="_BigGradient">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ </activity>
+
+ <activity
android:name="DatePickerActivity"
android:label="_DatePicker">
<intent-filter>
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/BigGradientActivity.java b/tests/HwAccelerationTest/src/com/android/test/hwui/BigGradientActivity.java
new file mode 100644
index 0000000..4d28f51
--- /dev/null
+++ b/tests/HwAccelerationTest/src/com/android/test/hwui/BigGradientActivity.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.test.hwui;
+
+import android.app.Activity;
+import android.content.Context;
+import android.graphics.Canvas;
+import android.graphics.LinearGradient;
+import android.graphics.Paint;
+import android.graphics.Shader;
+import android.os.Bundle;
+import android.view.View;
+
+public class BigGradientActivity extends Activity {
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+
+ setContentView(new BigGradientView(this));
+ }
+
+ private class BigGradientView extends View {
+ public BigGradientView(Context context) {
+ super(context);
+ }
+
+ @Override
+ protected void onDraw(Canvas canvas) {
+ Paint p = new Paint();
+ p.setShader(new LinearGradient(0.0f, 0.0f, 0.0f, getHeight(), 0xff000000,
+ 0xff333333, Shader.TileMode.CLAMP));
+
+ canvas.drawRect(0.0f, 0.0f, getWidth(), getHeight(), p);
+ }
+ }
+}
diff --git a/tests/RenderScriptTests/ImageProcessing/res/layout/main.xml b/tests/RenderScriptTests/ImageProcessing/res/layout/main.xml
index 08a010d..bd56d62 100644
--- a/tests/RenderScriptTests/ImageProcessing/res/layout/main.xml
+++ b/tests/RenderScriptTests/ImageProcessing/res/layout/main.xml
@@ -50,8 +50,12 @@
android:textSize="8pt"
android:text="@string/saturation"/>
</LinearLayout>
+ <Spinner
+ android:id="@+id/filterselection"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"/>
<TextView
- android:id="@+id/inSaturationText"
+ android:id="@+id/slider1Text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="8pt"
@@ -59,13 +63,13 @@
android:layout_marginTop="15sp"
android:text="@string/saturation"/>
<SeekBar
- android:id="@+id/inSaturation"
+ android:id="@+id/slider1"
android:layout_marginLeft="10sp"
android:layout_marginRight="10sp"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<TextView
- android:id="@+id/inGammaText"
+ android:id="@+id/slider2Text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="8pt"
@@ -73,13 +77,13 @@
android:layout_marginTop="15sp"
android:text="@string/gamma"/>
<SeekBar
- android:id="@+id/inGamma"
+ android:id="@+id/slider2"
android:layout_marginLeft="10sp"
android:layout_marginRight="10sp"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<TextView
- android:id="@+id/outWhiteText"
+ android:id="@+id/slider3Text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10sp"
@@ -87,13 +91,13 @@
android:textSize="8pt"
android:text="@string/out_white"/>
<SeekBar
- android:id="@+id/outWhite"
+ android:id="@+id/slider3"
android:layout_marginLeft="10sp"
android:layout_marginRight="10sp"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<TextView
- android:id="@+id/inWhiteText"
+ android:id="@+id/slider4Text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="8pt"
@@ -101,49 +105,21 @@
android:layout_marginTop="15sp"
android:text="@string/in_white"/>
<SeekBar
- android:id="@+id/inWhite"
+ android:id="@+id/slider4"
android:layout_marginLeft="10sp"
android:layout_marginRight="10sp"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<TextView
- android:id="@+id/outBlackText"
+ android:id="@+id/slider5Text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="8pt"
android:layout_marginLeft="10sp"
android:layout_marginTop="15sp"
- android:text="@string/out_black"/>
+ android:text="@string/in_white"/>
<SeekBar
- android:id="@+id/outBlack"
- android:layout_marginLeft="10sp"
- android:layout_marginRight="10sp"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"/>
- <TextView
- android:id="@+id/inBlackText"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:textSize="8pt"
- android:layout_marginLeft="10sp"
- android:layout_marginTop="15sp"
- android:text="@string/in_black"/>
- <SeekBar
- android:id="@+id/inBlack"
- android:layout_marginLeft="10sp"
- android:layout_marginRight="10sp"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"/>
- <TextView
- android:id="@+id/blurText"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:textSize="8pt"
- android:layout_marginLeft="10sp"
- android:layout_marginTop="15sp"
- android:text="@string/blur_description"/>
- <SeekBar
- android:id="@+id/radius"
+ android:id="@+id/slider5"
android:layout_marginLeft="10sp"
android:layout_marginRight="10sp"
android:layout_width="match_parent"
diff --git a/tests/RenderScriptTests/ImageProcessing/res/layout/spinner_layout.xml b/tests/RenderScriptTests/ImageProcessing/res/layout/spinner_layout.xml
new file mode 100644
index 0000000..8196bbf
--- /dev/null
+++ b/tests/RenderScriptTests/ImageProcessing/res/layout/spinner_layout.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!-- Copyright (C) 2012 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<TextView xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:padding="10dp"
+ android:textSize="16sp"
+/>
diff --git a/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/Blur25.java b/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/Blur25.java
new file mode 100644
index 0000000..697bbb1
--- /dev/null
+++ b/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/Blur25.java
@@ -0,0 +1,106 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.rs.image;
+
+import java.lang.Math;
+
+import android.renderscript.Allocation;
+import android.renderscript.Element;
+import android.renderscript.RenderScript;
+import android.renderscript.Script;
+import android.renderscript.ScriptC;
+import android.renderscript.Type;
+import android.util.Log;
+import android.widget.SeekBar;
+import android.widget.TextView;
+
+public class Blur25 extends TestBase {
+ private int MAX_RADIUS = 25;
+ private ScriptC_threshold mScript;
+ private ScriptC_vertical_blur mScriptVBlur;
+ private ScriptC_horizontal_blur mScriptHBlur;
+ private int mRadius = MAX_RADIUS;
+ private float mSaturation = 1.0f;
+ private Allocation mScratchPixelsAllocation1;
+ private Allocation mScratchPixelsAllocation2;
+
+
+ public boolean onBar1Setup(SeekBar b, TextView t) {
+ t.setText("Radius");
+ b.setProgress(100);
+ return true;
+ }
+ public boolean onBar2Setup(SeekBar b, TextView t) {
+ b.setProgress(50);
+ t.setText("Saturation");
+ return true;
+ }
+
+
+ public void onBar1Changed(int progress) {
+ float fRadius = progress / 100.0f;
+ fRadius *= (float)(MAX_RADIUS);
+ mRadius = (int)fRadius;
+ mScript.set_radius(mRadius);
+ }
+ public void onBar2Changed(int progress) {
+ mSaturation = (float)progress / 50.0f;
+ mScriptVBlur.invoke_setSaturation(mSaturation);
+ }
+
+
+ public void createTest(android.content.res.Resources res) {
+ int width = mInPixelsAllocation.getType().getX();
+ int height = mInPixelsAllocation.getType().getY();
+
+ Type.Builder tb = new Type.Builder(mRS, Element.F32_4(mRS));
+ tb.setX(width);
+ tb.setY(height);
+ mScratchPixelsAllocation1 = Allocation.createTyped(mRS, tb.create());
+ mScratchPixelsAllocation2 = Allocation.createTyped(mRS, tb.create());
+
+ mScriptVBlur = new ScriptC_vertical_blur(mRS, res, R.raw.vertical_blur);
+ mScriptHBlur = new ScriptC_horizontal_blur(mRS, res, R.raw.horizontal_blur);
+
+ mScript = new ScriptC_threshold(mRS, res, R.raw.threshold);
+ mScript.set_width(width);
+ mScript.set_height(height);
+ mScript.set_radius(mRadius);
+
+ mScriptVBlur.invoke_setSaturation(mSaturation);
+
+ mScript.bind_InPixel(mInPixelsAllocation);
+ mScript.bind_OutPixel(mOutPixelsAllocation);
+ mScript.bind_ScratchPixel1(mScratchPixelsAllocation1);
+ mScript.bind_ScratchPixel2(mScratchPixelsAllocation2);
+
+ mScript.set_vBlurScript(mScriptVBlur);
+ mScript.set_hBlurScript(mScriptHBlur);
+ }
+
+ public void runTest() {
+ mScript.invoke_filter();
+ }
+
+ public void setupBenchmark() {
+ mScript.set_radius(MAX_RADIUS);
+ }
+
+ public void exitBenchmark() {
+ mScript.set_radius(mRadius);
+ }
+}
diff --git a/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/Grain.java b/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/Grain.java
new file mode 100644
index 0000000..cd54c2e
--- /dev/null
+++ b/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/Grain.java
@@ -0,0 +1,73 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.rs.image;
+
+import java.lang.Math;
+
+import android.renderscript.Allocation;
+import android.renderscript.Element;
+import android.renderscript.RenderScript;
+import android.renderscript.Script;
+import android.renderscript.ScriptC;
+import android.renderscript.Type;
+import android.util.Log;
+import android.widget.SeekBar;
+import android.widget.TextView;
+
+public class Grain extends TestBase {
+ private ScriptC_grain mScript;
+ private Allocation mNoise;
+ private Allocation mNoise2;
+
+
+ public boolean onBar1Setup(SeekBar b, TextView t) {
+ t.setText("Strength");
+ b.setProgress(50);
+ return true;
+ }
+
+ public void onBar1Changed(int progress) {
+ float s = progress / 100.0f;
+ mScript.set_gNoiseStrength(s);
+ }
+
+ public void createTest(android.content.res.Resources res) {
+ int width = mInPixelsAllocation.getType().getX();
+ int height = mInPixelsAllocation.getType().getY();
+
+ Type.Builder tb = new Type.Builder(mRS, Element.U8(mRS));
+ tb.setX(width);
+ tb.setY(height);
+ mNoise = Allocation.createTyped(mRS, tb.create());
+ mNoise2 = Allocation.createTyped(mRS, tb.create());
+
+ mScript = new ScriptC_grain(mRS, res, R.raw.grain);
+ mScript.set_gWidth(width);
+ mScript.set_gHeight(height);
+ mScript.set_gNoiseStrength(0.5f);
+ mScript.set_gBlendSource(mNoise);
+ mScript.set_gNoise(mNoise2);
+ }
+
+ public void runTest() {
+ mScript.forEach_genRand(mNoise);
+ mScript.forEach_blend9(mNoise2);
+ mScript.forEach_root(mInPixelsAllocation, mOutPixelsAllocation);
+ }
+
+}
+
diff --git a/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/Greyscale.java b/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/Greyscale.java
new file mode 100644
index 0000000..3db210a
--- /dev/null
+++ b/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/Greyscale.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.rs.image;
+
+import java.lang.Math;
+
+import android.renderscript.Allocation;
+import android.renderscript.Element;
+import android.renderscript.RenderScript;
+import android.renderscript.Script;
+import android.renderscript.ScriptC;
+import android.renderscript.Type;
+import android.util.Log;
+
+public class Greyscale extends TestBase {
+ private ScriptC_greyscale mScript;
+
+ public void createTest(android.content.res.Resources res) {
+ mScript = new ScriptC_greyscale(mRS, res, R.raw.greyscale);
+ }
+
+ public void runTest() {
+ mScript.forEach_root(mInPixelsAllocation, mOutPixelsAllocation);
+ }
+
+}
diff --git a/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/ImageProcessingActivity.java b/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/ImageProcessingActivity.java
index 7368260..3a9838b 100644
--- a/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/ImageProcessingActivity.java
+++ b/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/ImageProcessingActivity.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009 The Android Open Source Project
+ * Copyright (C) 2012 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -29,124 +29,65 @@
import android.renderscript.Script;
import android.view.SurfaceView;
import android.view.SurfaceHolder;
+import android.widget.AdapterView;
+import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.SeekBar;
+import android.widget.Spinner;
import android.widget.TextView;
import android.view.View;
import android.util.Log;
import java.lang.Math;
public class ImageProcessingActivity extends Activity
- implements SurfaceHolder.Callback,
- SeekBar.OnSeekBarChangeListener {
+ implements SeekBar.OnSeekBarChangeListener {
private final String TAG = "Img";
- private Bitmap mBitmapIn;
- private Bitmap mBitmapOut;
- private ScriptC_threshold mScript;
- private ScriptC_vertical_blur mScriptVBlur;
- private ScriptC_horizontal_blur mScriptHBlur;
- private int mRadius = 0;
- private SeekBar mRadiusSeekBar;
+ Bitmap mBitmapIn;
+ Bitmap mBitmapOut;
+ String mTestNames[];
- private float mInBlack = 0.0f;
- private SeekBar mInBlackSeekBar;
- private float mOutBlack = 0.0f;
- private SeekBar mOutBlackSeekBar;
- private float mInWhite = 255.0f;
- private SeekBar mInWhiteSeekBar;
- private float mOutWhite = 255.0f;
- private SeekBar mOutWhiteSeekBar;
- private float mGamma = 1.0f;
- private SeekBar mGammaSeekBar;
+ private SeekBar mBar1;
+ private SeekBar mBar2;
+ private SeekBar mBar3;
+ private SeekBar mBar4;
+ private SeekBar mBar5;
+ private TextView mText1;
+ private TextView mText2;
+ private TextView mText3;
+ private TextView mText4;
+ private TextView mText5;
private float mSaturation = 1.0f;
- private SeekBar mSaturationSeekBar;
private TextView mBenchmarkResult;
-
- @SuppressWarnings({"FieldCanBeLocal"})
- private RenderScript mRS;
- @SuppressWarnings({"FieldCanBeLocal"})
- private Type mPixelType;
- @SuppressWarnings({"FieldCanBeLocal"})
- private Allocation mInPixelsAllocation;
- @SuppressWarnings({"FieldCanBeLocal"})
- private Allocation mOutPixelsAllocation;
- @SuppressWarnings({"FieldCanBeLocal"})
- private Allocation mScratchPixelsAllocation1;
- private Allocation mScratchPixelsAllocation2;
+ private Spinner mTestSpinner;
private SurfaceView mSurfaceView;
private ImageView mDisplayView;
- private boolean mIsProcessing;
+ private boolean mDoingBenchmark;
- class FilterCallback extends RenderScript.RSMessageHandler {
- private Runnable mAction = new Runnable() {
- public void run() {
+ private TestBase mTest;
- synchronized (mDisplayView) {
- mIsProcessing = false;
- }
-
- mOutPixelsAllocation.copyTo(mBitmapOut);
- mDisplayView.invalidate();
- }
- };
-
- @Override
- public void run() {
- mSurfaceView.removeCallbacks(mAction);
- mSurfaceView.post(mAction);
- }
- }
-
- int in[];
- int interm[];
- int out[];
- int MAX_RADIUS = 25;
- // Store our coefficients here
- float gaussian[];
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
if (fromUser) {
- if (seekBar == mRadiusSeekBar) {
- float fRadius = progress / 100.0f;
- fRadius *= (float)(MAX_RADIUS);
- mRadius = (int)fRadius;
-
- mScript.set_radius(mRadius);
- } else if (seekBar == mInBlackSeekBar) {
- mInBlack = (float)progress;
- mScriptVBlur.invoke_setLevels(mInBlack, mOutBlack, mInWhite, mOutWhite);
- } else if (seekBar == mOutBlackSeekBar) {
- mOutBlack = (float)progress;
- mScriptVBlur.invoke_setLevels(mInBlack, mOutBlack, mInWhite, mOutWhite);
- } else if (seekBar == mInWhiteSeekBar) {
- mInWhite = (float)progress + 127.0f;
- mScriptVBlur.invoke_setLevels(mInBlack, mOutBlack, mInWhite, mOutWhite);
- } else if (seekBar == mOutWhiteSeekBar) {
- mOutWhite = (float)progress + 127.0f;
- mScriptVBlur.invoke_setLevels(mInBlack, mOutBlack, mInWhite, mOutWhite);
- } else if (seekBar == mGammaSeekBar) {
- mGamma = (float)progress/100.0f;
- mGamma = Math.max(mGamma, 0.1f);
- mGamma = 1.0f / mGamma;
- mScriptVBlur.invoke_setGamma(mGamma);
- } else if (seekBar == mSaturationSeekBar) {
- mSaturation = (float)progress / 50.0f;
- mScriptVBlur.invoke_setSaturation(mSaturation);
+ if (seekBar == mBar1) {
+ mTest.onBar1Changed(progress);
+ } else if (seekBar == mBar2) {
+ mTest.onBar2Changed(progress);
+ } else if (seekBar == mBar3) {
+ mTest.onBar3Changed(progress);
+ } else if (seekBar == mBar4) {
+ mTest.onBar4Changed(progress);
+ } else if (seekBar == mBar5) {
+ mTest.onBar5Changed(progress);
}
- synchronized (mDisplayView) {
- if (mIsProcessing) {
- return;
- }
- mIsProcessing = true;
- }
-
- mScript.invoke_filter();
+ mTest.runTest();
+ mTest.updateBitmap(mBitmapOut);
+ mDisplayView.invalidate();
}
}
@@ -156,6 +97,87 @@
public void onStopTrackingTouch(SeekBar seekBar) {
}
+ void setupBars() {
+ mBar1.setVisibility(View.VISIBLE);
+ mText1.setVisibility(View.VISIBLE);
+ mTest.onBar1Setup(mBar1, mText1);
+
+ mBar2.setVisibility(View.VISIBLE);
+ mText2.setVisibility(View.VISIBLE);
+ mTest.onBar2Setup(mBar2, mText2);
+
+ mBar3.setVisibility(View.VISIBLE);
+ mText3.setVisibility(View.VISIBLE);
+ mTest.onBar3Setup(mBar3, mText3);
+
+ mBar4.setVisibility(View.VISIBLE);
+ mText4.setVisibility(View.VISIBLE);
+ mTest.onBar4Setup(mBar4, mText4);
+
+ mBar5.setVisibility(View.VISIBLE);
+ mText5.setVisibility(View.VISIBLE);
+ mTest.onBar5Setup(mBar5, mText5);
+ }
+
+
+ void changeTest(int testID) {
+ switch(testID) {
+ case 0:
+ mTest = new LevelsV4(false, false);
+ break;
+ case 1:
+ mTest = new LevelsV4(false, true);
+ break;
+ case 2:
+ mTest = new LevelsV4(true, false);
+ break;
+ case 3:
+ mTest = new LevelsV4(true, true);
+ break;
+ case 4:
+ mTest = new Blur25();
+ break;
+ case 5:
+ mTest = new Greyscale();
+ break;
+ case 6:
+ mTest = new Grain();
+ break;
+ }
+
+ mTest.createBaseTest(this, mBitmapIn);
+ setupBars();
+
+ mTest.runTest();
+ mTest.updateBitmap(mBitmapOut);
+ mDisplayView.invalidate();
+ mBenchmarkResult.setText("Result: not run");
+ }
+
+ void setupTests() {
+ mTestNames = new String[7];
+ mTestNames[0] = "Levels Vec3 Relaxed";
+ mTestNames[1] = "Levels Vec4 Relaxed";
+ mTestNames[2] = "Levels Vec3 Full";
+ mTestNames[3] = "Levels Vec4 Full";
+ mTestNames[4] = "Blur radius 25";
+ mTestNames[5] = "Greyscale";
+ mTestNames[6] = "Grain";
+ mTestSpinner.setAdapter(new ArrayAdapter<String>(
+ this, R.layout.spinner_layout, mTestNames));
+ }
+
+ private AdapterView.OnItemSelectedListener mTestSpinnerListener =
+ new AdapterView.OnItemSelectedListener() {
+ public void onItemSelected(AdapterView<?> parent, View view, int pos, long id) {
+ changeTest(pos);
+ }
+
+ public void onNothingSelected(AdapterView parent) {
+
+ }
+ };
+
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@@ -165,94 +187,38 @@
mBitmapOut = loadBitmap(R.drawable.city);
mSurfaceView = (SurfaceView) findViewById(R.id.surface);
- mSurfaceView.getHolder().addCallback(this);
mDisplayView = (ImageView) findViewById(R.id.display);
mDisplayView.setImageBitmap(mBitmapOut);
- mRadiusSeekBar = (SeekBar) findViewById(R.id.radius);
- mRadiusSeekBar.setOnSeekBarChangeListener(this);
+ mBar1 = (SeekBar) findViewById(R.id.slider1);
+ mBar2 = (SeekBar) findViewById(R.id.slider2);
+ mBar3 = (SeekBar) findViewById(R.id.slider3);
+ mBar4 = (SeekBar) findViewById(R.id.slider4);
+ mBar5 = (SeekBar) findViewById(R.id.slider5);
- mInBlackSeekBar = (SeekBar)findViewById(R.id.inBlack);
- mInBlackSeekBar.setOnSeekBarChangeListener(this);
- mInBlackSeekBar.setMax(128);
- mInBlackSeekBar.setProgress(0);
- mOutBlackSeekBar = (SeekBar)findViewById(R.id.outBlack);
- mOutBlackSeekBar.setOnSeekBarChangeListener(this);
- mOutBlackSeekBar.setMax(128);
- mOutBlackSeekBar.setProgress(0);
+ mBar1.setOnSeekBarChangeListener(this);
+ mBar2.setOnSeekBarChangeListener(this);
+ mBar3.setOnSeekBarChangeListener(this);
+ mBar4.setOnSeekBarChangeListener(this);
+ mBar5.setOnSeekBarChangeListener(this);
- mInWhiteSeekBar = (SeekBar)findViewById(R.id.inWhite);
- mInWhiteSeekBar.setOnSeekBarChangeListener(this);
- mInWhiteSeekBar.setMax(128);
- mInWhiteSeekBar.setProgress(128);
- mOutWhiteSeekBar = (SeekBar)findViewById(R.id.outWhite);
- mOutWhiteSeekBar.setOnSeekBarChangeListener(this);
- mOutWhiteSeekBar.setMax(128);
- mOutWhiteSeekBar.setProgress(128);
+ mText1 = (TextView) findViewById(R.id.slider1Text);
+ mText2 = (TextView) findViewById(R.id.slider2Text);
+ mText3 = (TextView) findViewById(R.id.slider3Text);
+ mText4 = (TextView) findViewById(R.id.slider4Text);
+ mText5 = (TextView) findViewById(R.id.slider5Text);
- mGammaSeekBar = (SeekBar)findViewById(R.id.inGamma);
- mGammaSeekBar.setOnSeekBarChangeListener(this);
- mGammaSeekBar.setMax(150);
- mGammaSeekBar.setProgress(100);
-
- mSaturationSeekBar = (SeekBar)findViewById(R.id.inSaturation);
- mSaturationSeekBar.setOnSeekBarChangeListener(this);
- mSaturationSeekBar.setProgress(50);
+ mTestSpinner = (Spinner) findViewById(R.id.filterselection);
+ mTestSpinner.setOnItemSelectedListener(mTestSpinnerListener);
mBenchmarkResult = (TextView) findViewById(R.id.benchmarkText);
mBenchmarkResult.setText("Result: not run");
+
+ setupTests();
+ changeTest(0);
}
- public void surfaceCreated(SurfaceHolder holder) {
- createScript();
- mScript.invoke_filter();
- mOutPixelsAllocation.copyTo(mBitmapOut);
- }
-
- public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
- }
-
- public void surfaceDestroyed(SurfaceHolder holder) {
- }
-
- private void createScript() {
- mRS = RenderScript.create(this);
- mRS.setMessageHandler(new FilterCallback());
-
- mInPixelsAllocation = Allocation.createFromBitmap(mRS, mBitmapIn,
- Allocation.MipmapControl.MIPMAP_NONE,
- Allocation.USAGE_SCRIPT);
- mOutPixelsAllocation = Allocation.createFromBitmap(mRS, mBitmapOut,
- Allocation.MipmapControl.MIPMAP_NONE,
- Allocation.USAGE_SCRIPT);
-
- Type.Builder tb = new Type.Builder(mRS, Element.F32_4(mRS));
- tb.setX(mBitmapIn.getWidth());
- tb.setY(mBitmapIn.getHeight());
- mScratchPixelsAllocation1 = Allocation.createTyped(mRS, tb.create());
- mScratchPixelsAllocation2 = Allocation.createTyped(mRS, tb.create());
-
- mScriptVBlur = new ScriptC_vertical_blur(mRS, getResources(), R.raw.vertical_blur);
- mScriptHBlur = new ScriptC_horizontal_blur(mRS, getResources(), R.raw.horizontal_blur);
-
- mScript = new ScriptC_threshold(mRS, getResources(), R.raw.threshold);
- mScript.set_width(mBitmapIn.getWidth());
- mScript.set_height(mBitmapIn.getHeight());
- mScript.set_radius(mRadius);
-
- mScriptVBlur.invoke_setLevels(mInBlack, mOutBlack, mInWhite, mOutWhite);
- mScriptVBlur.invoke_setGamma(mGamma);
- mScriptVBlur.invoke_setSaturation(mSaturation);
-
- mScript.bind_InPixel(mInPixelsAllocation);
- mScript.bind_OutPixel(mOutPixelsAllocation);
- mScript.bind_ScratchPixel1(mScratchPixelsAllocation1);
- mScript.bind_ScratchPixel2(mScratchPixelsAllocation2);
-
- mScript.set_vBlurScript(mScriptVBlur);
- mScript.set_hBlurScript(mScriptHBlur);
- }
private Bitmap loadBitmap(int resource) {
final BitmapFactory.Options options = new BitmapFactory.Options();
@@ -278,26 +244,29 @@
// For benchmark test
public long getBenchmark() {
+ mDoingBenchmark = true;
+
+ mTest.setupBenchmark();
+ long result = 0;
+
+ Log.v(TAG, "Warming");
+ long t = java.lang.System.currentTimeMillis() + 2000;
+ do {
+ mTest.runTest();
+ mTest.finish();
+ } while (t > java.lang.System.currentTimeMillis());
+
+
Log.v(TAG, "Benchmarking");
- int oldRadius = mRadius;
- mRadius = MAX_RADIUS;
- mScript.set_radius(mRadius);
-
- mScript.invoke_filter();
- mRS.finish();
-
- long t = java.lang.System.currentTimeMillis();
-
- mScript.invoke_filter();
- mOutPixelsAllocation.copyTo(mBitmapOut);
-
+ t = java.lang.System.currentTimeMillis();
+ mTest.runTest();
+ mTest.finish();
t = java.lang.System.currentTimeMillis() - t;
- Log.v(TAG, "getBenchmark: Renderscript frame time core ms " + t);
- mRadius = oldRadius;
- mScript.set_radius(mRadius);
- mScript.invoke_filter();
- mOutPixelsAllocation.copyTo(mBitmapOut);
+ Log.v(TAG, "getBenchmark: Renderscript frame time core ms " + t);
+ mTest.exitBenchmark();
+ mDoingBenchmark = false;
+
return t;
}
}
diff --git a/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/LevelsV4.java b/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/LevelsV4.java
new file mode 100644
index 0000000..9eb5647
--- /dev/null
+++ b/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/LevelsV4.java
@@ -0,0 +1,167 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.rs.image;
+
+import java.lang.Math;
+
+import android.renderscript.Allocation;
+import android.renderscript.Element;
+import android.renderscript.RenderScript;
+import android.renderscript.Matrix3f;
+import android.renderscript.Script;
+import android.renderscript.ScriptC;
+import android.renderscript.Type;
+import android.util.Log;
+import android.widget.SeekBar;
+import android.widget.TextView;
+
+
+public class LevelsV4 extends TestBase {
+ private ScriptC_levels_relaxed mScriptR;
+ private ScriptC_levels_full mScriptF;
+ private float mInBlack = 0.0f;
+ private float mOutBlack = 0.0f;
+ private float mInWhite = 255.0f;
+ private float mOutWhite = 255.0f;
+ private float mSaturation = 1.0f;
+
+ Matrix3f satMatrix = new Matrix3f();
+ float mInWMinInB;
+ float mOutWMinOutB;
+ float mOverInWMinInB;
+
+ boolean mUseFull;
+ boolean mUseV4;
+
+ LevelsV4(boolean useFull, boolean useV4) {
+ mUseFull = useFull;
+ mUseV4 = useV4;
+ }
+
+
+ private void setLevels() {
+ mInWMinInB = mInWhite - mInBlack;
+ mOutWMinOutB = mOutWhite - mOutBlack;
+ mOverInWMinInB = 1.f / mInWMinInB;
+
+ mScriptR.set_inBlack(mInBlack);
+ mScriptR.set_outBlack(mOutBlack);
+ mScriptR.set_inWMinInB(mInWMinInB);
+ mScriptR.set_outWMinOutB(mOutWMinOutB);
+ mScriptR.set_overInWMinInB(mOverInWMinInB);
+ mScriptF.set_inBlack(mInBlack);
+ mScriptF.set_outBlack(mOutBlack);
+ mScriptF.set_inWMinInB(mInWMinInB);
+ mScriptF.set_outWMinOutB(mOutWMinOutB);
+ mScriptF.set_overInWMinInB(mOverInWMinInB);
+ }
+
+ private void setSaturation() {
+ float rWeight = 0.299f;
+ float gWeight = 0.587f;
+ float bWeight = 0.114f;
+ float oneMinusS = 1.0f - mSaturation;
+
+ satMatrix.set(0, 0, oneMinusS * rWeight + mSaturation);
+ satMatrix.set(0, 1, oneMinusS * rWeight);
+ satMatrix.set(0, 2, oneMinusS * rWeight);
+ satMatrix.set(1, 0, oneMinusS * gWeight);
+ satMatrix.set(1, 1, oneMinusS * gWeight + mSaturation);
+ satMatrix.set(1, 2, oneMinusS * gWeight);
+ satMatrix.set(2, 0, oneMinusS * bWeight);
+ satMatrix.set(2, 1, oneMinusS * bWeight);
+ satMatrix.set(2, 2, oneMinusS * bWeight + mSaturation);
+ mScriptR.set_colorMat(satMatrix);
+ mScriptF.set_colorMat(satMatrix);
+ }
+
+ public boolean onBar1Setup(SeekBar b, TextView t) {
+ b.setProgress(50);
+ t.setText("Saturation");
+ return true;
+ }
+ public boolean onBar2Setup(SeekBar b, TextView t) {
+ b.setMax(128);
+ b.setProgress(0);
+ t.setText("In Black");
+ return true;
+ }
+ public boolean onBar3Setup(SeekBar b, TextView t) {
+ b.setMax(128);
+ b.setProgress(0);
+ t.setText("Out Black");
+ return true;
+ }
+ public boolean onBar4Setup(SeekBar b, TextView t) {
+ b.setMax(128);
+ b.setProgress(128);
+ t.setText("Out White");
+ return true;
+ }
+ public boolean onBar5Setup(SeekBar b, TextView t) {
+ b.setMax(128);
+ b.setProgress(128);
+ t.setText("Out White");
+ return true;
+ }
+
+ public void onBar1Changed(int progress) {
+ mSaturation = (float)progress / 50.0f;
+ setSaturation();
+ }
+ public void onBar2Changed(int progress) {
+ mInBlack = (float)progress;
+ setLevels();
+ }
+ public void onBar3Changed(int progress) {
+ mOutBlack = (float)progress;
+ setLevels();
+ }
+ public void onBar4Changed(int progress) {
+ mInWhite = (float)progress + 127.0f;
+ setLevels();
+ }
+ public void onBar5Changed(int progress) {
+ mOutWhite = (float)progress + 127.0f;
+ setLevels();
+ }
+
+ public void createTest(android.content.res.Resources res) {
+ mScriptR = new ScriptC_levels_relaxed(mRS, res, R.raw.levels_relaxed);
+ mScriptF = new ScriptC_levels_full(mRS, res, R.raw.levels_full);
+ setSaturation();
+ setLevels();
+ }
+
+ public void runTest() {
+ if (mUseFull) {
+ if (mUseV4) {
+ mScriptF.forEach_root4(mInPixelsAllocation, mOutPixelsAllocation);
+ } else {
+ mScriptF.forEach_root(mInPixelsAllocation, mOutPixelsAllocation);
+ }
+ } else {
+ if (mUseV4) {
+ mScriptR.forEach_root4(mInPixelsAllocation, mOutPixelsAllocation);
+ } else {
+ mScriptR.forEach_root(mInPixelsAllocation, mOutPixelsAllocation);
+ }
+ }
+ }
+
+}
+
diff --git a/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/TestBase.java b/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/TestBase.java
new file mode 100644
index 0000000..3a6241d
--- /dev/null
+++ b/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/TestBase.java
@@ -0,0 +1,122 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.rs.image;
+
+import android.app.Activity;
+import android.content.Context;
+import android.os.Bundle;
+import android.graphics.BitmapFactory;
+import android.graphics.Bitmap;
+import android.graphics.Canvas;
+import android.renderscript.ScriptC;
+import android.renderscript.RenderScript;
+import android.renderscript.Type;
+import android.renderscript.Allocation;
+import android.renderscript.Element;
+import android.renderscript.Script;
+import android.view.SurfaceView;
+import android.view.SurfaceHolder;
+import android.widget.ImageView;
+import android.widget.SeekBar;
+import android.widget.TextView;
+import android.view.View;
+import android.util.Log;
+import java.lang.Math;
+
+public class TestBase {
+ protected final String TAG = "Img";
+
+ protected RenderScript mRS;
+ protected Allocation mInPixelsAllocation;
+ protected Allocation mOutPixelsAllocation;
+
+ // Override to use UI elements
+ public void onBar1Changed(int progress) {
+ }
+ public void onBar2Changed(int progress) {
+ }
+ public void onBar3Changed(int progress) {
+ }
+ public void onBar4Changed(int progress) {
+ }
+ public void onBar5Changed(int progress) {
+ }
+
+ // Override to use UI elements
+ // Unused bars will be hidden.
+ public boolean onBar1Setup(SeekBar b, TextView t) {
+ b.setVisibility(View.INVISIBLE);
+ t.setVisibility(View.INVISIBLE);
+ return false;
+ }
+ public boolean onBar2Setup(SeekBar b, TextView t) {
+ b.setVisibility(View.INVISIBLE);
+ t.setVisibility(View.INVISIBLE);
+ return false;
+ }
+ public boolean onBar3Setup(SeekBar b, TextView t) {
+ b.setVisibility(View.INVISIBLE);
+ t.setVisibility(View.INVISIBLE);
+ return false;
+ }
+ public boolean onBar4Setup(SeekBar b, TextView t) {
+ b.setVisibility(View.INVISIBLE);
+ t.setVisibility(View.INVISIBLE);
+ return false;
+ }
+ public boolean onBar5Setup(SeekBar b, TextView t) {
+ b.setVisibility(View.INVISIBLE);
+ t.setVisibility(View.INVISIBLE);
+ return false;
+ }
+
+ public final void createBaseTest(ImageProcessingActivity act, Bitmap b) {
+ mRS = RenderScript.create(act);
+ mInPixelsAllocation = Allocation.createFromBitmap(mRS, b,
+ Allocation.MipmapControl.MIPMAP_NONE,
+ Allocation.USAGE_SCRIPT);
+ mOutPixelsAllocation = Allocation.createFromBitmap(mRS, b,
+ Allocation.MipmapControl.MIPMAP_NONE,
+ Allocation.USAGE_SCRIPT);
+ createTest(act.getResources());
+ }
+
+ // Must override
+ public void createTest(android.content.res.Resources res) {
+ android.util.Log.e("img", "implement createTest");
+ }
+
+ // Must override
+ public void runTest() {
+ }
+
+ public void finish() {
+ mRS.finish();
+ }
+
+ public void updateBitmap(Bitmap b) {
+ mOutPixelsAllocation.copyTo(b);
+ }
+
+ // Override to configure specific benchmark config.
+ public void setupBenchmark() {
+ }
+
+ // Override to reset after benchmark.
+ public void exitBenchmark() {
+ }
+}
diff --git a/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/grain.rs b/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/grain.rs
new file mode 100644
index 0000000..97ae4fb
--- /dev/null
+++ b/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/grain.rs
@@ -0,0 +1,92 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma version(1)
+#pragma rs java_package_name(com.android.rs.image)
+#pragma rs_fp_relaxed
+
+void genRand(uchar *out) {
+ *out = (uchar)rsRand(0xff);
+}
+
+/*
+ * Convolution matrix of distance 2 with fixed point of 'kShiftBits' bits
+ * shifted. Thus the sum of this matrix should be 'kShiftValue'. Entries of
+ * small values are not calculated to gain efficiency.
+ * The order ot pixels represented in this matrix is:
+ * 1 2 3
+ * 4 0 5
+ * 6 7 8
+ * and the matrix should be: {230, 56, 114, 56, 114, 114, 56, 114, 56}.
+ * However, since most of the valus are identical, we only use the first three
+ * entries and the entries corresponding to the pixels is:
+ * 1 2 1
+ * 2 0 2
+ * 1 2 1
+ */
+
+int32_t gWidth;
+int32_t gHeight;
+
+rs_allocation gBlendSource;
+void blend9(uchar *out, uint32_t x, uint32_t y) {
+ uint32_t x1 = min(x+1, (uint32_t)gWidth);
+ uint32_t x2 = max(x-1, (uint32_t)0);
+ uint32_t y1 = min(y+1, (uint32_t)gHeight);
+ uint32_t y2 = max(y-1, (uint32_t)0);
+
+ uint p00 = 56 * ((uchar *)rsGetElementAt(gBlendSource, x1, y1))[0];
+ uint p01 = 114 * ((uchar *)rsGetElementAt(gBlendSource, x, y1))[0];
+ uint p02 = 56 * ((uchar *)rsGetElementAt(gBlendSource, x2, y1))[0];
+ uint p10 = 114 * ((uchar *)rsGetElementAt(gBlendSource, x1, y))[0];
+ uint p11 = 230 * ((uchar *)rsGetElementAt(gBlendSource, x, y))[0];
+ uint p12 = 114 * ((uchar *)rsGetElementAt(gBlendSource, x2, y))[0];
+ uint p20 = 56 * ((uchar *)rsGetElementAt(gBlendSource, x1, y2))[0];
+ uint p21 = 114 * ((uchar *)rsGetElementAt(gBlendSource, x, y2))[0];
+ uint p22 = 56 * ((uchar *)rsGetElementAt(gBlendSource, x2, y2))[0];
+
+ p00 += p01;
+ p02 += p10;
+ p11 += p12;
+ p20 += p21;
+
+ p22 += p00;
+ p02 += p11;
+
+ p20 += p22;
+ p20 += p02;
+
+ *out = (uchar)(p20 >> 10);
+}
+
+float gNoiseStrength;
+
+rs_allocation gNoise;
+void root(const uchar4 *in, uchar4 *out, uint32_t x, uint32_t y) {
+ float4 ip = convert_float4(*in);
+ float pnoise = (float) ((uchar *)rsGetElementAt(gNoise, x, y))[0];
+
+ float energy_level = ip.r + ip.g + ip.b;
+ float energy_mask = (28.f - sqrt(energy_level)) * 0.03571f;
+ pnoise = (pnoise - 128.f) * energy_mask;
+
+ ip += pnoise * gNoiseStrength;
+ ip = clamp(ip, 0.f, 255.f);
+
+ uchar4 p = convert_uchar4(ip);
+ p.a = 0xff;
+ *out = p;
+}
diff --git a/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/greyscale.rs b/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/greyscale.rs
new file mode 100644
index 0000000..c420cac
--- /dev/null
+++ b/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/greyscale.rs
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma version(1)
+#pragma rs java_package_name(com.android.rs.image)
+#pragma rs_fp_relaxed
+
+const static float3 gMonoMult = {0.299f, 0.587f, 0.114f};
+
+void root(const uchar4 *v_in, uchar4 *v_out) {
+ float4 f4 = rsUnpackColor8888(*v_in);
+
+ float3 mono = dot(f4.rgb, gMonoMult);
+ *v_out = rsPackColorTo8888(mono);
+}
+
+
diff --git a/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/levels.rsh b/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/levels.rsh
new file mode 100644
index 0000000..7c5d930
--- /dev/null
+++ b/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/levels.rsh
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+float inBlack;
+float outBlack;
+float inWMinInB;
+float outWMinOutB;
+float overInWMinInB;
+rs_matrix3x3 colorMat;
+
+void root(const uchar4 *in, uchar4 *out, uint32_t x, uint32_t y) {
+ float3 pixel = convert_float4(in[0]).rgb;
+ pixel = rsMatrixMultiply(&colorMat, pixel);
+ pixel = clamp(pixel, 0.f, 255.f);
+ pixel = (pixel - inBlack) * overInWMinInB;
+ pixel = pixel * outWMinOutB + outBlack;
+ pixel = clamp(pixel, 0.f, 255.f);
+ out->xyz = convert_uchar3(pixel);
+ out->w = 0xff;
+}
+
+void root4(const uchar4 *in, uchar4 *out, uint32_t x, uint32_t y) {
+ float4 pixel = convert_float4(in[0]);
+ pixel.rgb = rsMatrixMultiply(&colorMat, pixel.rgb);
+ pixel = clamp(pixel, 0.f, 255.f);
+ pixel = (pixel - inBlack) * overInWMinInB;
+ pixel = pixel * outWMinOutB + outBlack;
+ pixel = clamp(pixel, 0.f, 255.f);
+ out->xyzw = convert_uchar4(pixel);
+}
+
diff --git a/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/levels_full.rs b/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/levels_full.rs
new file mode 100644
index 0000000..da6a291
--- /dev/null
+++ b/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/levels_full.rs
@@ -0,0 +1,21 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma version(1)
+#pragma rs java_package_name(com.android.rs.image)
+
+#include "levels.rsh"
+
diff --git a/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/levels_relaxed.rs b/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/levels_relaxed.rs
new file mode 100644
index 0000000..b115445
--- /dev/null
+++ b/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/levels_relaxed.rs
@@ -0,0 +1,22 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma version(1)
+#pragma rs java_package_name(com.android.rs.image)
+#pragma rs_fp_relaxed
+
+#include "levels.rsh"
+
diff --git a/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/threshold.rs b/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/threshold.rs
index d93238c..77cd5be 100644
--- a/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/threshold.rs
+++ b/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/threshold.rs
@@ -88,6 +88,6 @@
fs.ain = rsGetAllocation(ScratchPixel2);
rsForEach(vBlurScript, fs.ain, rsGetAllocation(OutPixel), &fs, sizeof(fs));
- rsSendToClientBlocking(CMD_FINISHED);
+ //rsSendToClientBlocking(CMD_FINISHED);
}
diff --git a/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/vertical_blur.rs b/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/vertical_blur.rs
index a6da192..60fd71b 100644
--- a/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/vertical_blur.rs
+++ b/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/vertical_blur.rs
@@ -3,29 +3,9 @@
#include "ip.rsh"
-static float inBlack;
-static float outBlack;
-static float inWhite;
-static float outWhite;
-static float3 gamma;
static float saturation;
-
-static float inWMinInB;
-static float outWMinOutB;
-static float overInWMinInB;
static rs_matrix3x3 colorMat;
-void setLevels(float iBlk, float oBlk, float iWht, float oWht) {
- inBlack = iBlk;
- outBlack = oBlk;
- inWhite = iWht;
- outWhite = oWht;
-
- inWMinInB = inWhite - inBlack;
- outWMinOutB = outWhite - outBlack;
- overInWMinInB = 1.f / inWMinInB;
-}
-
void setSaturation(float sat) {
saturation = sat;
@@ -52,10 +32,6 @@
rsMatrixSet(&colorMat, 2, 2, oneMinusS * bWeight + saturation);
}
-void setGamma(float g) {
- gamma = (float3)g;
-}
-
void root(uchar4 *out, const void *usrData, uint32_t x, uint32_t y) {
const FilterStruct *fs = (const FilterStruct *)usrData;
float3 blurredPixel = 0;
@@ -76,12 +52,8 @@
}
float3 temp = rsMatrixMultiply(&colorMat, blurredPixel);
- temp = (clamp(temp, 0.f, 255.f) - inBlack) * overInWMinInB;
- if (gamma.x != 1.0f)
- temp = pow(temp, (float3)gamma);
- temp = clamp(temp * outWMinOutB + outBlack, 0.f, 255.f);
-
+ temp = clamp(temp, 0.f, 255.f);
out->xyz = convert_uchar3(temp);
- //output->w = input->w;
+ out->w = 0xff;
}
diff --git a/tests/RenderScriptTests/tests/src/com/android/rs/test/UT_math_agree.java b/tests/RenderScriptTests/tests/src/com/android/rs/test/UT_math_agree.java
index 32a4bd7..9d94ba5 100644
--- a/tests/RenderScriptTests/tests/src/com/android/rs/test/UT_math_agree.java
+++ b/tests/RenderScriptTests/tests/src/com/android/rs/test/UT_math_agree.java
@@ -19,19 +19,267 @@
import android.content.Context;
import android.content.res.Resources;
import android.renderscript.*;
+import android.util.Log;
+import java.util.Arrays;
import java.util.Random;
public class UT_math_agree extends UnitTest {
private Resources mRes;
+ private Random rand;
protected UT_math_agree(RSTestCore rstc, Resources res, Context ctx) {
super(rstc, "Math Agreement", ctx);
mRes = res;
+ rand = new Random();
+ }
+
+ // packing functions
+ private Float2 pack_f2(float[] val) {
+ assert val.length == 2;
+ return new Float2(val[0], val[1]);
+ }
+ private Float3 pack_f3(float[] val) {
+ assert val.length == 3;
+ return new Float3(val[0], val[1], val[2]);
+ }
+ private Float4 pack_f4(float[] val) {
+ assert val.length == 4;
+ return new Float4(val[0], val[1], val[2], val[3]);
+ }
+ private Byte2 pack_b2(byte[] val) {
+ assert val.length == 2;
+ return new Byte2(val[0], val[1]);
+ }
+ private Byte3 pack_b3(byte[] val) {
+ assert val.length == 3;
+ return new Byte3(val[0], val[1], val[2]);
+ }
+ private Byte4 pack_b4(byte[] val) {
+ assert val.length == 4;
+ return new Byte4(val[0], val[1], val[2], val[3]);
+ }
+ private Short2 pack_s2(short[] val) {
+ assert val.length == 2;
+ return new Short2(val[0], val[1]);
+ }
+ private Short3 pack_s3(short[] val) {
+ assert val.length == 3;
+ return new Short3(val[0], val[1], val[2]);
+ }
+ private Short4 pack_s4(short[] val) {
+ assert val.length == 4;
+ return new Short4(val[0], val[1], val[2], val[3]);
+ }
+ private Int2 pack_i2(int[] val) {
+ assert val.length == 2;
+ return new Int2(val[0], val[1]);
+ }
+ private Int3 pack_i3(int[] val) {
+ assert val.length == 3;
+ return new Int3(val[0], val[1], val[2]);
+ }
+ private Int4 pack_i4(int[] val) {
+ assert val.length == 4;
+ return new Int4(val[0], val[1], val[2], val[3]);
+ }
+ private Long2 pack_l2(long[] val) {
+ assert val.length == 2;
+ return new Long2(val[0], val[1]);
+ }
+ private Long3 pack_l3(long[] val) {
+ assert val.length == 3;
+ return new Long3(val[0], val[1], val[2]);
+ }
+ private Long4 pack_l4(long[] val) {
+ assert val.length == 4;
+ return new Long4(val[0], val[1], val[2], val[3]);
+ }
+
+ // random vector generation functions
+ private float[] randvec_float(int dim) {
+ float[] fv = new float[dim];
+ for (int i = 0; i < dim; ++i)
+ fv[i] = rand.nextFloat();
+ return fv;
+ }
+ private byte[] randvec_char(int dim) {
+ byte[] cv = new byte[dim];
+ rand.nextBytes(cv);
+ return cv;
+ }
+ private short[] randvec_uchar(int dim) {
+ short[] ucv = new short[dim];
+ for (int i = 0; i < dim; ++i)
+ ucv[i] = (short)rand.nextInt(0x1 << 8);
+ return ucv;
+ }
+ private short[] randvec_short(int dim) {
+ short[] sv = new short[dim];
+ for (int i = 0; i < dim; ++i)
+ sv[i] = (short)rand.nextInt(0x1 << 16);
+ return sv;
+ }
+ private int[] randvec_ushort(int dim) {
+ int[] usv = new int[dim];
+ for (int i = 0; i < dim; ++i)
+ usv[i] = rand.nextInt(0x1 << 16);
+ return usv;
+ }
+ private int[] randvec_int(int dim) {
+ int[] iv = new int[dim];
+ for (int i = 0; i < dim; ++i)
+ iv[i] = rand.nextInt();
+ return iv;
+ }
+ private long[] randvec_uint(int dim) {
+ long[] uiv = new long[dim];
+ for (int i = 0; i < dim; ++i)
+ uiv[i] = (long)rand.nextInt() - (long)Integer.MIN_VALUE;
+ return uiv;
+ }
+ private long[] randvec_long(int dim) {
+ long[] lv = new long[dim];
+ for (int i = 0; i < dim; ++i)
+ lv[i] = rand.nextLong();
+ return lv;
+ }
+ // TODO: unsigned long generator
+
+ // min reference functions
+ private float min(float v1, float v2) {
+ return v1 < v2 ? v1 : v2;
+ }
+ private float[] min(float[] v1, float[] v2) {
+ assert v1.length == v2.length;
+ float[] rv = new float[v1.length];
+ for (int i = 0; i < v1.length; ++i)
+ rv[i] = min(v1[i], v2[i]);
+ return rv;
+ }
+ private byte min(byte v1, byte v2) {
+ return v1 < v2 ? v1 : v2;
+ }
+ private byte[] min(byte[] v1, byte[] v2) {
+ assert v1.length == v2.length;
+ byte[] rv = new byte[v1.length];
+ for (int i = 0; i < v1.length; ++i)
+ rv[i] = min(v1[i], v2[i]);
+ return rv;
+ }
+ private short min(short v1, short v2) {
+ return v1 < v2 ? v1 : v2;
+ }
+ private short[] min(short[] v1, short[] v2) {
+ assert v1.length == v2.length;
+ short[] rv = new short[v1.length];
+ for (int i = 0; i < v1.length; ++i)
+ rv[i] = min(v1[i], v2[i]);
+ return rv;
+ }
+ private int min(int v1, int v2) {
+ return v1 < v2 ? v1 : v2;
+ }
+ private int[] min(int[] v1, int[] v2) {
+ assert v1.length == v2.length;
+ int[] rv = new int[v1.length];
+ for (int i = 0; i < v1.length; ++i)
+ rv[i] = min(v1[i], v2[i]);
+ return rv;
+ }
+ private long min(long v1, long v2) {
+ return v1 < v2 ? v1 : v2;
+ }
+ private long[] min(long[] v1, long[] v2) {
+ assert v1.length == v2.length;
+ long[] rv = new long[v1.length];
+ for (int i = 0; i < v1.length; ++i)
+ rv[i] = min(v1[i], v2[i]);
+ return rv;
+ }
+ // TODO: unsigned long version of min
+
+ // max reference functions
+ private float max(float v1, float v2) {
+ return v1 > v2 ? v1 : v2;
+ }
+ private float[] max(float[] v1, float[] v2) {
+ assert v1.length == v2.length;
+ float[] rv = new float[v1.length];
+ for (int i = 0; i < v1.length; ++i)
+ rv[i] = max(v1[i], v2[i]);
+ return rv;
+ }
+ private byte max(byte v1, byte v2) {
+ return v1 > v2 ? v1 : v2;
+ }
+ private byte[] max(byte[] v1, byte[] v2) {
+ assert v1.length == v2.length;
+ byte[] rv = new byte[v1.length];
+ for (int i = 0; i < v1.length; ++i)
+ rv[i] = max(v1[i], v2[i]);
+ return rv;
+ }
+ private short max(short v1, short v2) {
+ return v1 > v2 ? v1 : v2;
+ }
+ private short[] max(short[] v1, short[] v2) {
+ assert v1.length == v2.length;
+ short[] rv = new short[v1.length];
+ for (int i = 0; i < v1.length; ++i)
+ rv[i] = max(v1[i], v2[i]);
+ return rv;
+ }
+ private int max(int v1, int v2) {
+ return v1 > v2 ? v1 : v2;
+ }
+ private int[] max(int[] v1, int[] v2) {
+ assert v1.length == v2.length;
+ int[] rv = new int[v1.length];
+ for (int i = 0; i < v1.length; ++i)
+ rv[i] = max(v1[i], v2[i]);
+ return rv;
+ }
+ private long max(long v1, long v2) {
+ return v1 > v2 ? v1 : v2;
+ }
+ private long[] max(long[] v1, long[] v2) {
+ assert v1.length == v2.length;
+ long[] rv = new long[v1.length];
+ for (int i = 0; i < v1.length; ++i)
+ rv[i] = max(v1[i], v2[i]);
+ return rv;
+ }
+ // TODO: unsigned long version of max
+
+ // fmin reference functions
+ private float fmin(float v1, float v2) {
+ return min(v1, v2);
+ }
+ private float[] fmin(float[] v1, float[] v2) {
+ return min(v1, v2);
+ }
+ private float[] fmin(float[] v1, float v2) {
+ float[] rv = new float[v1.length];
+ for (int i = 0; i < v1.length; ++i)
+ rv[i] = min(v1[i], v2);
+ return rv;
+ }
+
+ // fmax reference functions
+ private float fmax(float v1, float v2) {
+ return max(v1, v2);
+ }
+ private float[] fmax(float[] v1, float[] v2) {
+ return max(v1, v2);
+ }
+ private float[] fmax(float[] v1, float v2) {
+ float[] rv = new float[v1.length];
+ for (int i = 0; i < v1.length; ++i)
+ rv[i] = max(v1[i], v2);
+ return rv;
}
private void initializeValues(ScriptC_math_agree s) {
- Random rand = new Random();
-
float x = rand.nextFloat();
float y = rand.nextFloat();
@@ -41,6 +289,249 @@
s.set_result_sub(x - y);
s.set_result_mul(x * y);
s.set_result_div(x / y);
+
+ // Generate random vectors of all types
+ float rand_f1_0 = rand.nextFloat();
+ float[] rand_f2_0 = randvec_float(2);
+ float[] rand_f3_0 = randvec_float(3);
+ float[] rand_f4_0 = randvec_float(4);
+ float rand_f1_1 = rand.nextFloat();
+ float[] rand_f2_1 = randvec_float(2);
+ float[] rand_f3_1 = randvec_float(3);
+ float[] rand_f4_1 = randvec_float(4);
+ byte rand_sc1_0 = (byte)rand.nextInt(0x1 << 8);
+ byte[] rand_sc2_0 = randvec_char(2);
+ byte[] rand_sc3_0 = randvec_char(3);
+ byte[] rand_sc4_0 = randvec_char(4);
+ byte rand_sc1_1 = (byte)rand.nextInt(0x1 << 8);
+ byte[] rand_sc2_1 = randvec_char(2);
+ byte[] rand_sc3_1 = randvec_char(3);
+ byte[] rand_sc4_1 = randvec_char(4);
+ short rand_ss1_0 = (short)rand.nextInt(0x1 << 16);
+ short[] rand_ss2_0 = randvec_short(2);
+ short[] rand_ss3_0 = randvec_short(3);
+ short[] rand_ss4_0 = randvec_short(4);
+ short rand_ss1_1 = (short)rand.nextInt(0x1 << 16);
+ short[] rand_ss2_1 = randvec_short(2);
+ short[] rand_ss3_1 = randvec_short(3);
+ short[] rand_ss4_1 = randvec_short(4);
+ int rand_si1_0 = rand.nextInt();
+ int[] rand_si2_0 = randvec_int(2);
+ int[] rand_si3_0 = randvec_int(3);
+ int[] rand_si4_0 = randvec_int(4);
+ int rand_si1_1 = rand.nextInt();
+ int[] rand_si2_1 = randvec_int(2);
+ int[] rand_si3_1 = randvec_int(3);
+ int[] rand_si4_1 = randvec_int(4);
+ long rand_sl1_0 = rand.nextLong();
+ long[] rand_sl2_0 = randvec_long(2);
+ long[] rand_sl3_0 = randvec_long(3);
+ long[] rand_sl4_0 = randvec_long(4);
+ long rand_sl1_1 = rand.nextLong();
+ long[] rand_sl2_1 = randvec_long(2);
+ long[] rand_sl3_1 = randvec_long(3);
+ long[] rand_sl4_1 = randvec_long(4);
+ // FIXME: generate unsigned input vectors once bug 6764163 is fixed
+ /*
+ short rand_uc1_0 = (short)rand.nextInt(0x1 << 8);
+ short[] rand_uc2_0 = randvec_uchar(2);
+ short[] rand_uc3_0 = randvec_uchar(3);
+ short[] rand_uc4_0 = randvec_uchar(4);
+ short rand_uc1_1 = (short)rand.nextInt(0x1 << 8);
+ short[] rand_uc2_1 = randvec_uchar(2);
+ short[] rand_uc3_1 = randvec_uchar(3);
+ short[] rand_uc4_1 = randvec_uchar(4);
+ int rand_us1_0 = rand.nextInt(0x1 << 16);
+ int[] rand_us2_0 = randvec_ushort(2);
+ int[] rand_us3_0 = randvec_ushort(3);
+ int[] rand_us4_0 = randvec_ushort(4);
+ int rand_us1_1 = rand.nextInt(0x1 << 16);
+ int[] rand_us2_1 = randvec_ushort(2);
+ int[] rand_us3_1 = randvec_ushort(3);
+ int[] rand_us4_1 = randvec_ushort(4);
+ long rand_ui1_0 = (long)rand.nextInt() - (long)Integer.MIN_VALUE;
+ long[] rand_ui2_0 = randvec_uint(2);
+ long[] rand_ui3_0 = randvec_uint(3);
+ long[] rand_ui4_0 = randvec_uint(4);
+ long rand_ui1_1 = (long)rand.nextInt() - (long)Integer.MIN_VALUE;
+ long[] rand_ui2_1 = randvec_uint(2);
+ long[] rand_ui3_1 = randvec_uint(3);
+ long[] rand_ui4_1 = randvec_uint(4);
+ */
+ // TODO: generate unsigned long vectors
+
+ // Set random vectors in renderscript code
+ s.set_rand_f1_0(rand_f1_0);
+ s.set_rand_f2_0(pack_f2(rand_f2_0));
+ s.set_rand_f3_0(pack_f3(rand_f3_0));
+ s.set_rand_f4_0(pack_f4(rand_f4_0));
+ s.set_rand_f1_1(rand_f1_1);
+ s.set_rand_f2_1(pack_f2(rand_f2_1));
+ s.set_rand_f3_1(pack_f3(rand_f3_1));
+ s.set_rand_f4_1(pack_f4(rand_f4_1));
+ s.set_rand_sc1_1(rand_sc1_1);
+ s.set_rand_sc2_1(pack_b2(rand_sc2_1));
+ s.set_rand_sc3_1(pack_b3(rand_sc3_1));
+ s.set_rand_sc4_1(pack_b4(rand_sc4_1));
+ s.set_rand_ss1_0(rand_ss1_0);
+ s.set_rand_ss2_0(pack_s2(rand_ss2_0));
+ s.set_rand_ss3_0(pack_s3(rand_ss3_0));
+ s.set_rand_ss4_0(pack_s4(rand_ss4_0));
+ s.set_rand_ss1_1(rand_ss1_1);
+ s.set_rand_ss2_1(pack_s2(rand_ss2_1));
+ s.set_rand_ss3_1(pack_s3(rand_ss3_1));
+ s.set_rand_ss4_1(pack_s4(rand_ss4_1));
+ s.set_rand_si1_0(rand_si1_0);
+ s.set_rand_si2_0(pack_i2(rand_si2_0));
+ s.set_rand_si3_0(pack_i3(rand_si3_0));
+ s.set_rand_si4_0(pack_i4(rand_si4_0));
+ s.set_rand_si1_1(rand_si1_1);
+ s.set_rand_si2_1(pack_i2(rand_si2_1));
+ s.set_rand_si3_1(pack_i3(rand_si3_1));
+ s.set_rand_si4_1(pack_i4(rand_si4_1));
+ s.set_rand_sl1_0(rand_sl1_0);
+ s.set_rand_sl2_0(pack_l2(rand_sl2_0));
+ s.set_rand_sl3_0(pack_l3(rand_sl3_0));
+ s.set_rand_sl4_0(pack_l4(rand_sl4_0));
+ s.set_rand_sl1_1(rand_sl1_1);
+ s.set_rand_sl2_1(pack_l2(rand_sl2_1));
+ s.set_rand_sl3_1(pack_l3(rand_sl3_1));
+ s.set_rand_sl4_1(pack_l4(rand_sl4_1));
+ // FIXME: set signed char input vectors once bug is fixed
+ /*
+ s.set_rand_sc1_0(rand_sc1_0);
+ s.set_rand_sc2_0(pack_b2(rand_sc2_0));
+ s.set_rand_sc3_0(pack_b3(rand_sc3_0));
+ s.set_rand_sc4_0(pack_b4(rand_sc4_0));
+ */
+ // FIXME: set unsigned input vectors once bug 6764163 is fixed
+ /*
+ s.set_rand_us1_0(rand_us1_0);
+ s.set_rand_us2_0(pack_i2(rand_us2_0));
+ s.set_rand_us3_0(pack_i3(rand_us3_0));
+ s.set_rand_us4_0(pack_i4(rand_us4_0));
+ s.set_rand_us1_1(rand_us1_1);
+ s.set_rand_us2_1(pack_i2(rand_us2_1));
+ s.set_rand_us3_1(pack_i3(rand_us3_1));
+ s.set_rand_us4_1(pack_i4(rand_us4_1));
+ s.set_rand_uc1_0(rand_uc1_0);
+ s.set_rand_uc2_0(pack_s2(rand_uc2_0));
+ s.set_rand_uc3_0(pack_s3(rand_uc3_0));
+ s.set_rand_uc4_0(pack_s4(rand_uc4_0));
+ s.set_rand_uc1_1(rand_uc1_1);
+ s.set_rand_uc2_1(pack_s2(rand_uc2_1));
+ s.set_rand_uc3_1(pack_s3(rand_uc3_1));
+ s.set_rand_uc4_1(pack_s4(rand_uc4_1));
+ s.set_rand_ui1_0(rand_ui1_0);
+ s.set_rand_ui2_0(pack_l2(rand_ui2_0));
+ s.set_rand_ui3_0(pack_l3(rand_ui3_0));
+ s.set_rand_ui4_0(pack_l4(rand_ui4_0));
+ s.set_rand_ui1_1(rand_ui1_1);
+ s.set_rand_ui2_1(pack_l2(rand_ui2_1));
+ s.set_rand_ui3_1(pack_l3(rand_ui3_1));
+ s.set_rand_ui4_1(pack_l4(rand_ui4_1));
+ */
+ // TODO: set unsigned long vectors
+
+ // Set results for min
+ s.set_min_rand_f1_f1(min(rand_f1_0, rand_f1_1));
+ s.set_min_rand_f2_f2(pack_f2(min(rand_f2_0, rand_f2_1)));
+ s.set_min_rand_f3_f3(pack_f3(min(rand_f3_0, rand_f3_1)));
+ s.set_min_rand_f4_f4(pack_f4(min(rand_f4_0, rand_f4_1)));
+ s.set_min_rand_ss1_ss1(min(rand_ss1_0, rand_ss1_1));
+ s.set_min_rand_ss2_ss2(pack_s2(min(rand_ss2_0, rand_ss2_1)));
+ s.set_min_rand_ss3_ss3(pack_s3(min(rand_ss3_0, rand_ss3_1)));
+ s.set_min_rand_ss4_ss4(pack_s4(min(rand_ss4_0, rand_ss4_1)));
+ s.set_min_rand_si1_si1(min(rand_si1_0, rand_si1_1));
+ s.set_min_rand_si2_si2(pack_i2(min(rand_si2_0, rand_si2_1)));
+ s.set_min_rand_si3_si3(pack_i3(min(rand_si3_0, rand_si3_1)));
+ s.set_min_rand_si4_si4(pack_i4(min(rand_si4_0, rand_si4_1)));
+ s.set_min_rand_sl1_sl1(min(rand_sl1_0, rand_sl1_1));
+ s.set_min_rand_sl2_sl2(pack_l2(min(rand_sl2_0, rand_sl2_1)));
+ s.set_min_rand_sl3_sl3(pack_l3(min(rand_sl3_0, rand_sl3_1)));
+ s.set_min_rand_sl4_sl4(pack_l4(min(rand_sl4_0, rand_sl4_1)));
+ // FIXME: set signed char min reference vectors once bug is fixed
+ /*
+ s.set_min_rand_sc1_sc1(min(rand_sc1_0, rand_sc1_1));
+ s.set_min_rand_sc2_sc2(pack_b2(min(rand_sc2_0, rand_sc2_1)));
+ s.set_min_rand_sc3_sc3(pack_b3(min(rand_sc3_0, rand_sc3_1)));
+ s.set_min_rand_sc4_sc4(pack_b4(min(rand_sc4_0, rand_sc4_1)));
+ */
+ // FIXME: set unsigned min reference vectors once bug 6764163 is fixed
+ /*
+ s.set_min_rand_uc1_uc1(min(rand_uc1_0, rand_uc1_1));
+ s.set_min_rand_uc2_uc2(pack_s3(min(rand_uc2_0, rand_uc2_1)));
+ s.set_min_rand_uc3_uc3(pack_s3(min(rand_uc3_0, rand_uc3_1)));
+ s.set_min_rand_uc4_uc4(pack_s4(min(rand_uc4_0, rand_uc4_1)));
+ s.set_min_rand_us1_us1(min(rand_us1_0, rand_us1_1));
+ s.set_min_rand_us2_us2(pack_i2(min(rand_us2_0, rand_us2_1)));
+ s.set_min_rand_us3_us3(pack_i3(min(rand_us3_0, rand_us3_1)));
+ s.set_min_rand_us4_us4(pack_i4(min(rand_us4_0, rand_us4_1)));
+ s.set_min_rand_ui1_ui1(min(rand_ui1_0, rand_ui1_1));
+ s.set_min_rand_ui2_ui2(pack_l2(min(rand_ui2_0, rand_ui2_1)));
+ s.set_min_rand_ui3_ui3(pack_l3(min(rand_ui3_0, rand_ui3_1)));
+ s.set_min_rand_ui4_ui4(pack_l4(min(rand_ui4_0, rand_ui4_1)));
+ */
+ // TODO: set results for unsigned long min
+
+ // Set results for max
+ s.set_max_rand_f1_f1(max(rand_f1_0, rand_f1_1));
+ s.set_max_rand_f2_f2(pack_f2(max(rand_f2_0, rand_f2_1)));
+ s.set_max_rand_f3_f3(pack_f3(max(rand_f3_0, rand_f3_1)));
+ s.set_max_rand_f4_f4(pack_f4(max(rand_f4_0, rand_f4_1)));
+ s.set_max_rand_ss1_ss1(max(rand_ss1_0, rand_ss1_1));
+ s.set_max_rand_ss2_ss2(pack_s2(max(rand_ss2_0, rand_ss2_1)));
+ s.set_max_rand_ss3_ss3(pack_s3(max(rand_ss3_0, rand_ss3_1)));
+ s.set_max_rand_ss4_ss4(pack_s4(max(rand_ss4_0, rand_ss4_1)));
+ s.set_max_rand_si1_si1(max(rand_si1_0, rand_si1_1));
+ s.set_max_rand_si2_si2(pack_i2(max(rand_si2_0, rand_si2_1)));
+ s.set_max_rand_si3_si3(pack_i3(max(rand_si3_0, rand_si3_1)));
+ s.set_max_rand_si4_si4(pack_i4(max(rand_si4_0, rand_si4_1)));
+ s.set_max_rand_sl1_sl1(max(rand_sl1_0, rand_sl1_1));
+ s.set_max_rand_sl2_sl2(pack_l2(max(rand_sl2_0, rand_sl2_1)));
+ s.set_max_rand_sl3_sl3(pack_l3(max(rand_sl3_0, rand_sl3_1)));
+ s.set_max_rand_sl4_sl4(pack_l4(max(rand_sl4_0, rand_sl4_1)));
+ // FIXME: set signed char max reference vectors once bug is fixed
+ /*
+ s.set_max_rand_sc1_sc1(max(rand_sc1_0, rand_sc1_1));
+ s.set_max_rand_sc2_sc2(pack_b2(max(rand_sc2_0, rand_sc2_1)));
+ s.set_max_rand_sc3_sc3(pack_b3(max(rand_sc3_0, rand_sc3_1)));
+ s.set_max_rand_sc4_sc4(pack_b4(max(rand_sc4_0, rand_sc4_1)));
+ */
+ // FIXME: set unsigned max reference vectors once bug 6764163 is fixed
+ /*
+ s.set_max_rand_uc1_uc1(max(rand_uc1_0, rand_uc1_1));
+ s.set_max_rand_uc2_uc2(pack_s3(max(rand_uc2_0, rand_uc2_1)));
+ s.set_max_rand_uc3_uc3(pack_s3(max(rand_uc3_0, rand_uc3_1)));
+ s.set_max_rand_uc4_uc4(pack_s4(max(rand_uc4_0, rand_uc4_1)));
+ s.set_max_rand_us1_us1(max(rand_us1_0, rand_us1_1));
+ s.set_max_rand_us2_us2(pack_i2(max(rand_us2_0, rand_us2_1)));
+ s.set_max_rand_us3_us3(pack_i3(max(rand_us3_0, rand_us3_1)));
+ s.set_max_rand_us4_us4(pack_i4(max(rand_us4_0, rand_us4_1)));
+ s.set_max_rand_ui1_ui1(max(rand_ui1_0, rand_ui1_1));
+ s.set_max_rand_ui2_ui2(pack_l2(max(rand_ui2_0, rand_ui2_1)));
+ s.set_max_rand_ui3_ui3(pack_l3(max(rand_ui3_0, rand_ui3_1)));
+ s.set_max_rand_ui4_ui4(pack_l4(max(rand_ui4_0, rand_ui4_1)));
+ */
+ // TODO: set results for unsigned long max
+
+ // Set results for fmin
+ s.set_fmin_rand_f1_f1(fmin(rand_f1_0, rand_f1_1));
+ s.set_fmin_rand_f2_f2(pack_f2(fmin(rand_f2_0, rand_f2_1)));
+ s.set_fmin_rand_f3_f3(pack_f3(fmin(rand_f3_0, rand_f3_1)));
+ s.set_fmin_rand_f4_f4(pack_f4(fmin(rand_f4_0, rand_f4_1)));
+ s.set_fmin_rand_f2_f1(pack_f2(fmin(rand_f2_0, rand_f1_1)));
+ s.set_fmin_rand_f3_f1(pack_f3(fmin(rand_f3_0, rand_f1_1)));
+ s.set_fmin_rand_f4_f1(pack_f4(fmin(rand_f4_0, rand_f1_1)));
+
+ // Set results for fmax
+ s.set_fmax_rand_f1_f1(fmax(rand_f1_0, rand_f1_1));
+ s.set_fmax_rand_f2_f2(pack_f2(fmax(rand_f2_0, rand_f2_1)));
+ s.set_fmax_rand_f3_f3(pack_f3(fmax(rand_f3_0, rand_f3_1)));
+ s.set_fmax_rand_f4_f4(pack_f4(fmax(rand_f4_0, rand_f4_1)));
+ s.set_fmax_rand_f2_f1(pack_f2(fmax(rand_f2_0, rand_f1_1)));
+ s.set_fmax_rand_f3_f1(pack_f3(fmax(rand_f3_0, rand_f1_1)));
+ s.set_fmax_rand_f4_f1(pack_f4(fmax(rand_f4_0, rand_f1_1)));
}
public void run() {
diff --git a/tests/RenderScriptTests/tests/src/com/android/rs/test/math_agree.rs b/tests/RenderScriptTests/tests/src/com/android/rs/test/math_agree.rs
index 953b9de..ac3a3fa 100644
--- a/tests/RenderScriptTests/tests/src/com/android/rs/test/math_agree.rs
+++ b/tests/RenderScriptTests/tests/src/com/android/rs/test/math_agree.rs
@@ -1,34 +1,391 @@
#include "shared.rsh"
//#pragma rs_fp_relaxed
-float x = 0.0f;
-float y = 0.0f;
-float result_add = 0.0f;
-float result_sub = 0.0f;
-float result_mul = 0.0f;
-float result_div = 0.0f;
+volatile float x = 0.0f;
+volatile float y = 0.0f;
+volatile float result_add = 0.0f;
+volatile float result_sub = 0.0f;
+volatile float result_mul = 0.0f;
+volatile float result_div = 0.0f;
-#define TEST_OP(op, opName) \
-result = x op y; \
-if (! float_almost_equal(result, result_##opName)) { \
- rsDebug(#opName " did not match!", 0); \
- rsDebug("x = ", x); \
- rsDebug("y = ", y); \
- rsDebug("Result = ", result); \
- rsDebug("Expected = ", result_##opName); \
- rsDebug("Difference = ", result - result_##opName); \
- rsDebug("ULP Difference =", float_dist(result, result_##opName)); \
+#define DECLARE_INPUT_SET(type, abbrev) \
+volatile type rand_##abbrev##1_0, rand_##abbrev##1_1; \
+volatile type##2 rand_##abbrev##2_0, rand_##abbrev##2_1; \
+volatile type##3 rand_##abbrev##3_0, rand_##abbrev##3_1; \
+volatile type##4 rand_##abbrev##4_0, rand_##abbrev##4_1;
+
+#define DECLARE_ALL_INPUT_SETS() \
+DECLARE_INPUT_SET(float, f); \
+DECLARE_INPUT_SET(char, sc); \
+DECLARE_INPUT_SET(uchar, uc); \
+DECLARE_INPUT_SET(short, ss); \
+DECLARE_INPUT_SET(ushort, us); \
+DECLARE_INPUT_SET(int, si); \
+DECLARE_INPUT_SET(uint, ui); \
+DECLARE_INPUT_SET(long, sl); \
+DECLARE_INPUT_SET(ulong, ul);
+
+DECLARE_ALL_INPUT_SETS();
+
+#define DECLARE_REFERENCE_SET_VEC_VEC(type, abbrev, func) \
+volatile type func##_rand_##abbrev##1_##abbrev##1; \
+volatile type##2 func##_rand_##abbrev##2_##abbrev##2; \
+volatile type##3 func##_rand_##abbrev##3_##abbrev##3; \
+volatile type##4 func##_rand_##abbrev##4_##abbrev##4;
+#define DECLARE_REFERENCE_SET_VEC_SCL(type, abbrev, func) \
+volatile type##2 func##_rand_##abbrev##2_##abbrev##1; \
+volatile type##3 func##_rand_##abbrev##3_##abbrev##1; \
+volatile type##4 func##_rand_##abbrev##4_##abbrev##1;
+
+#define DECLARE_ALL_REFERENCE_SETS_VEC_VEC(func) \
+DECLARE_REFERENCE_SET_VEC_VEC(float, f, func); \
+DECLARE_REFERENCE_SET_VEC_VEC(char, sc, func); \
+DECLARE_REFERENCE_SET_VEC_VEC(uchar, uc, func); \
+DECLARE_REFERENCE_SET_VEC_VEC(short, ss, func); \
+DECLARE_REFERENCE_SET_VEC_VEC(ushort, us, func); \
+DECLARE_REFERENCE_SET_VEC_VEC(int, si, func); \
+DECLARE_REFERENCE_SET_VEC_VEC(uint, ui, func); \
+DECLARE_REFERENCE_SET_VEC_VEC(long, sl, func); \
+DECLARE_REFERENCE_SET_VEC_VEC(ulong, ul, func);
+
+DECLARE_ALL_REFERENCE_SETS_VEC_VEC(min);
+DECLARE_ALL_REFERENCE_SETS_VEC_VEC(max);
+DECLARE_REFERENCE_SET_VEC_VEC(float, f, fmin);
+DECLARE_REFERENCE_SET_VEC_SCL(float, f, fmin);
+DECLARE_REFERENCE_SET_VEC_VEC(float, f, fmax);
+DECLARE_REFERENCE_SET_VEC_SCL(float, f, fmax);
+
+static void fail_f1(float v1, float v2, float actual, float expected, char *op_name) {
+ int dist = float_dist(actual, expected);
+ rsDebug("float operation did not match!", op_name);
+ rsDebug("v1", v1);
+ rsDebug("v2", v2);
+ rsDebug("Dalvik result", expected);
+ rsDebug("Renderscript result", actual);
+ rsDebug("ULP difference", dist);
+}
+
+static void fail_f2(float2 v1, float2 v2, float2 actual, float2 expected, char *op_name) {
+ int2 dist;
+ dist.x = float_dist(actual.x, expected.x);
+ dist.y = float_dist(actual.y, expected.y);
+ rsDebug("float2 operation did not match!", op_name);
+ rsDebug("v1.x", v1.x);
+ rsDebug("v1.y", v1.y);
+ rsDebug("v2.x", v2.x);
+ rsDebug("v2.y", v2.y);
+ rsDebug("Dalvik result .x", expected.x);
+ rsDebug("Dalvik result .y", expected.y);
+ rsDebug("Renderscript result .x", actual.x);
+ rsDebug("Renderscript result .y", actual.y);
+ rsDebug("ULP difference .x", dist.x);
+ rsDebug("ULP difference .y", dist.y);
+}
+
+static void fail_f3(float3 v1, float3 v2, float3 actual, float3 expected, char *op_name) {
+ int3 dist;
+ dist.x = float_dist(actual.x, expected.x);
+ dist.y = float_dist(actual.y, expected.y);
+ dist.z = float_dist(actual.z, expected.z);
+ rsDebug("float3 operation did not match!", op_name);
+ rsDebug("v1.x", v1.x);
+ rsDebug("v1.y", v1.y);
+ rsDebug("v1.z", v1.z);
+ rsDebug("v2.x", v2.x);
+ rsDebug("v2.y", v2.y);
+ rsDebug("v2.z", v2.z);
+ rsDebug("Dalvik result .x", expected.x);
+ rsDebug("Dalvik result .y", expected.y);
+ rsDebug("Dalvik result .z", expected.z);
+ rsDebug("Renderscript result .x", actual.x);
+ rsDebug("Renderscript result .y", actual.y);
+ rsDebug("Renderscript result .z", actual.z);
+ rsDebug("ULP difference .x", dist.x);
+ rsDebug("ULP difference .y", dist.y);
+ rsDebug("ULP difference .z", dist.z);
+}
+
+static void fail_f4(float4 v1, float4 v2, float4 actual, float4 expected, char *op_name) {
+ int4 dist;
+ dist.x = float_dist(actual.x, expected.x);
+ dist.y = float_dist(actual.y, expected.y);
+ dist.z = float_dist(actual.z, expected.z);
+ dist.w = float_dist(actual.w, expected.w);
+ rsDebug("float4 operation did not match!", op_name);
+ rsDebug("v1.x", v1.x);
+ rsDebug("v1.y", v1.y);
+ rsDebug("v1.z", v1.z);
+ rsDebug("v1.w", v1.w);
+ rsDebug("v2.x", v2.x);
+ rsDebug("v2.y", v2.y);
+ rsDebug("v2.z", v2.z);
+ rsDebug("v2.w", v2.w);
+ rsDebug("Dalvik result .x", expected.x);
+ rsDebug("Dalvik result .y", expected.y);
+ rsDebug("Dalvik result .z", expected.z);
+ rsDebug("Dalvik result .w", expected.w);
+ rsDebug("Renderscript result .x", actual.x);
+ rsDebug("Renderscript result .y", actual.y);
+ rsDebug("Renderscript result .z", actual.z);
+ rsDebug("Renderscript result .w", actual.w);
+ rsDebug("ULP difference .x", dist.x);
+ rsDebug("ULP difference .y", dist.y);
+ rsDebug("ULP difference .z", dist.z);
+ rsDebug("ULP difference .w", dist.w);
+}
+
+static bool f1_almost_equal(float a, float b) {
+ return float_almost_equal(a, b);
+}
+
+static bool f2_almost_equal(float2 a, float2 b) {
+ return float_almost_equal(a.x, b.x) && float_almost_equal(a.y, b.y);
+}
+
+
+static bool f3_almost_equal(float3 a, float3 b) {
+ return float_almost_equal(a.x, b.x) && float_almost_equal(a.y, b.y)
+ && float_almost_equal(a.z, b.z);
+}
+
+static bool f4_almost_equal(float4 a, float4 b) {
+ return float_almost_equal(a.x, b.x) && float_almost_equal(a.y, b.y)
+ && float_almost_equal(a.z, b.z) && float_almost_equal(a.w, b.w);
+}
+
+#define TEST_BASIC_FLOAT_OP(op, opName) \
+temp_f1 = x op y; \
+if (! float_almost_equal(temp_f1, result_##opName)) { \
+ fail_f1(x, y , temp_f1, result_##opName, #opName); \
+ failed = true; \
+}
+
+#define TEST_FN_FN(func, size) \
+temp_f##size = func(rand_f##size##_0, rand_f##size##_1); \
+if (! f##size##_almost_equal(temp_f##size , func##_rand_f##size##_f##size)) { \
+ fail_f##size (x, y , temp_f##size, func##_rand_f##size##_f##size, #func); \
+ failed = true; \
+}
+#define TEST_FN_F(func, size) \
+temp_f##size = func(rand_f##size##_0, rand_f1_1); \
+if (! f##size##_almost_equal(temp_f##size , func##_rand_f##size##_f1)) { \
+ fail_f##size (x, y , temp_f##size, func##_rand_f##size##_f1 , #func); \
+ failed = true; \
+}
+
+#define TEST_FN_FN_ALL(func) \
+TEST_FN_FN(func, 1) \
+TEST_FN_FN(func, 2) \
+TEST_FN_FN(func, 3) \
+TEST_FN_FN(func, 4)
+#define TEST_FN_F_ALL(func) \
+TEST_FN_F(func, 2) \
+TEST_FN_F(func, 3) \
+TEST_FN_F(func, 4)
+
+#define TEST_VEC1_VEC1(func, type) \
+temp_##type##1 = func( rand_##type##1_0, rand_##type##1_1 ); \
+if (temp_##type##1 != func##_rand_##type##1_##type##1) { \
+ rsDebug(#func " " #type "1 operation did not match!", 0); \
+ rsDebug("v1", rand_##type##1_0); \
+ rsDebug("v2", rand_##type##1_1); \
+ rsDebug("Dalvik result", func##_rand_##type##1_##type##1); \
+ rsDebug("Renderscript result", temp_##type##1); \
+ failed = true; \
+}
+#define TEST_VEC2_VEC2(func, type) \
+temp_##type##2 = func( rand_##type##2_0, rand_##type##2_1 ); \
+if (temp_##type##2 .x != func##_rand_##type##2_##type##2 .x \
+ || temp_##type##2 .y != func##_rand_##type##2_##type##2 .y) { \
+ rsDebug(#func " " #type "2 operation did not match!", 0); \
+ rsDebug("v1.x", rand_##type##2_0 .x); \
+ rsDebug("v1.y", rand_##type##2_0 .y); \
+ rsDebug("v2.x", rand_##type##2_1 .x); \
+ rsDebug("v2.y", rand_##type##2_1 .y); \
+ rsDebug("Dalvik result .x", func##_rand_##type##2_##type##2 .x); \
+ rsDebug("Dalvik result .y", func##_rand_##type##2_##type##2 .y); \
+ rsDebug("Renderscript result .x", temp_##type##2 .x); \
+ rsDebug("Renderscript result .y", temp_##type##2 .y); \
+ failed = true; \
+}
+#define TEST_VEC3_VEC3(func, type) \
+temp_##type##3 = func( rand_##type##3_0, rand_##type##3_1 ); \
+if (temp_##type##3 .x != func##_rand_##type##3_##type##3 .x \
+ || temp_##type##3 .y != func##_rand_##type##3_##type##3 .y \
+ || temp_##type##3 .z != func##_rand_##type##3_##type##3 .z) { \
+ rsDebug(#func " " #type "3 operation did not match!", 0); \
+ rsDebug("v1.x", rand_##type##3_0 .x); \
+ rsDebug("v1.y", rand_##type##3_0 .y); \
+ rsDebug("v1.z", rand_##type##3_0 .z); \
+ rsDebug("v2.x", rand_##type##3_1 .x); \
+ rsDebug("v2.y", rand_##type##3_1 .y); \
+ rsDebug("v2.z", rand_##type##3_1 .z); \
+ rsDebug("Dalvik result .x", func##_rand_##type##3_##type##3 .x); \
+ rsDebug("Dalvik result .y", func##_rand_##type##3_##type##3 .y); \
+ rsDebug("Dalvik result .z", func##_rand_##type##3_##type##3 .z); \
+ rsDebug("Renderscript result .x", temp_##type##3 .x); \
+ rsDebug("Renderscript result .y", temp_##type##3 .y); \
+ rsDebug("Renderscript result .z", temp_##type##3 .z); \
+ failed = true; \
+}
+#define TEST_VEC4_VEC4(func, type) \
+temp_##type##4 = func( rand_##type##4_0, rand_##type##4_1 ); \
+if (temp_##type##4 .x != func##_rand_##type##4_##type##4 .x \
+ || temp_##type##4 .y != func##_rand_##type##4_##type##4 .y \
+ || temp_##type##4 .z != func##_rand_##type##4_##type##4 .z \
+ || temp_##type##4 .w != func##_rand_##type##4_##type##4 .w) { \
+ rsDebug(#func " " #type "4 operation did not match!", 0); \
+ rsDebug("v1.x", rand_##type##4_0 .x); \
+ rsDebug("v1.y", rand_##type##4_0 .y); \
+ rsDebug("v1.z", rand_##type##4_0 .z); \
+ rsDebug("v1.w", rand_##type##4_0 .w); \
+ rsDebug("v2.x", rand_##type##4_1 .x); \
+ rsDebug("v2.y", rand_##type##4_1 .y); \
+ rsDebug("v2.z", rand_##type##4_1 .z); \
+ rsDebug("v2.w", rand_##type##4_1 .w); \
+ rsDebug("Dalvik result .x", func##_rand_##type##4_##type##4 .x); \
+ rsDebug("Dalvik result .y", func##_rand_##type##4_##type##4 .y); \
+ rsDebug("Dalvik result .z", func##_rand_##type##4_##type##4 .z); \
+ rsDebug("Dalvik result .w", func##_rand_##type##4_##type##4 .w); \
+ rsDebug("Renderscript result .x", temp_##type##4 .x); \
+ rsDebug("Renderscript result .y", temp_##type##4 .y); \
+ rsDebug("Renderscript result .z", temp_##type##4 .z); \
+ rsDebug("Renderscript result .w", temp_##type##4 .w); \
failed = true; \
}
+#define TEST_SC1_SC1(func) TEST_VEC1_VEC1(func, sc)
+#define TEST_SC2_SC2(func) TEST_VEC2_VEC2(func, sc)
+#define TEST_SC3_SC3(func) TEST_VEC3_VEC3(func, sc)
+#define TEST_SC4_SC4(func) TEST_VEC4_VEC4(func, sc)
+
+#define TEST_UC1_UC1(func) TEST_VEC1_VEC1(func, uc)
+#define TEST_UC2_UC2(func) TEST_VEC2_VEC2(func, uc)
+#define TEST_UC3_UC3(func) TEST_VEC3_VEC3(func, uc)
+#define TEST_UC4_UC4(func) TEST_VEC4_VEC4(func, uc)
+
+#define TEST_SS1_SS1(func) TEST_VEC1_VEC1(func, ss)
+#define TEST_SS2_SS2(func) TEST_VEC2_VEC2(func, ss)
+#define TEST_SS3_SS3(func) TEST_VEC3_VEC3(func, ss)
+#define TEST_SS4_SS4(func) TEST_VEC4_VEC4(func, ss)
+
+#define TEST_US1_US1(func) TEST_VEC1_VEC1(func, us)
+#define TEST_US2_US2(func) TEST_VEC2_VEC2(func, us)
+#define TEST_US3_US3(func) TEST_VEC3_VEC3(func, us)
+#define TEST_US4_US4(func) TEST_VEC4_VEC4(func, us)
+
+#define TEST_SI1_SI1(func) TEST_VEC1_VEC1(func, si)
+#define TEST_SI2_SI2(func) TEST_VEC2_VEC2(func, si)
+#define TEST_SI3_SI3(func) TEST_VEC3_VEC3(func, si)
+#define TEST_SI4_SI4(func) TEST_VEC4_VEC4(func, si)
+
+#define TEST_UI1_UI1(func) TEST_VEC1_VEC1(func, ui)
+#define TEST_UI2_UI2(func) TEST_VEC2_VEC2(func, ui)
+#define TEST_UI3_UI3(func) TEST_VEC3_VEC3(func, ui)
+#define TEST_UI4_UI4(func) TEST_VEC4_VEC4(func, ui)
+
+#define TEST_SL1_SL1(func) TEST_VEC1_VEC1(func, sl)
+#define TEST_SL2_SL2(func) TEST_VEC2_VEC2(func, sl)
+#define TEST_SL3_SL3(func) TEST_VEC3_VEC3(func, sl)
+#define TEST_SL4_SL4(func) TEST_VEC4_VEC4(func, sl)
+
+#define TEST_UL1_UL1(func) TEST_VEC1_VEC1(func, ul)
+#define TEST_UL2_UL2(func) TEST_VEC2_VEC2(func, ul)
+#define TEST_UL3_UL3(func) TEST_VEC3_VEC3(func, ul)
+#define TEST_UL4_UL4(func) TEST_VEC4_VEC4(func, ul)
+
+#define TEST_SC_SC_ALL(func) \
+TEST_SC1_SC1(func) \
+TEST_SC2_SC2(func) \
+TEST_SC3_SC3(func) \
+TEST_SC4_SC4(func)
+#define TEST_UC_UC_ALL(func) \
+TEST_UC1_UC1(func) \
+TEST_UC2_UC2(func) \
+TEST_UC3_UC3(func) \
+TEST_UC4_UC4(func)
+
+#define TEST_SS_SS_ALL(func) \
+TEST_SS1_SS1(func) \
+TEST_SS2_SS2(func) \
+TEST_SS3_SS3(func) \
+TEST_SS4_SS4(func)
+#define TEST_US_US_ALL(func) \
+TEST_US1_US1(func) \
+TEST_US2_US2(func) \
+TEST_US3_US3(func) \
+TEST_US4_US4(func)
+#define TEST_SI_SI_ALL(func) \
+TEST_SI1_SI1(func) \
+TEST_SI2_SI2(func) \
+TEST_SI3_SI3(func) \
+TEST_SI4_SI4(func)
+#define TEST_UI_UI_ALL(func) \
+TEST_UI1_UI1(func) \
+TEST_UI2_UI2(func) \
+TEST_UI3_UI3(func) \
+TEST_UI4_UI4(func)
+#define TEST_SL_SL_ALL(func) \
+TEST_SL1_SL1(func) \
+TEST_SL2_SL2(func) \
+TEST_SL3_SL3(func) \
+TEST_SL4_SL4(func)
+#define TEST_UL_UL_ALL(func) \
+TEST_UL1_UL1(func) \
+TEST_UL2_UL2(func) \
+TEST_UL3_UL3(func) \
+TEST_UL4_UL4(func)
+
+#define TEST_VEC_VEC_ALL(func) \
+TEST_FN_FN_ALL(func) \
+TEST_SS_SS_ALL(func) \
+TEST_SI_SI_ALL(func)
+// FIXME: Add tests back in once bug 6764163 is fixed
+#if 0
+TEST_SC_SC_ALL(func) \
+TEST_US_US_ALL(func) \
+TEST_UC_UC_ALL(func) \
+TEST_UI_UI_ALL(func)
+#endif
+// TODO: add long types to ALL macro
+#if 0
+TEST_SL_SL_ALL(func) \
+TEST_UL_UL_ALL(func)
+#endif
+
+#define DECLARE_TEMP_SET(type, abbrev) \
+volatile type temp_##abbrev##1; \
+volatile type##2 temp_##abbrev##2; \
+volatile type##3 temp_##abbrev##3; \
+volatile type##4 temp_##abbrev##4;
+
+#define DECLARE_ALL_TEMP_SETS() \
+DECLARE_TEMP_SET(float, f); \
+DECLARE_TEMP_SET(char, sc); \
+DECLARE_TEMP_SET(uchar, uc); \
+DECLARE_TEMP_SET(short, ss); \
+DECLARE_TEMP_SET(ushort, us); \
+DECLARE_TEMP_SET(int, si); \
+DECLARE_TEMP_SET(uint, ui); \
+DECLARE_TEMP_SET(long, sl); \
+DECLARE_TEMP_SET(ulong, ul);
+
static bool test_math_agree() {
bool failed = false;
- float result = 0.0;
- TEST_OP(+, add);
- TEST_OP(-, sub);
- TEST_OP(*, mul);
- TEST_OP(/, div);
+ DECLARE_ALL_TEMP_SETS();
+
+ TEST_BASIC_FLOAT_OP(+, add);
+ TEST_BASIC_FLOAT_OP(-, sub);
+ TEST_BASIC_FLOAT_OP(*, mul);
+ TEST_BASIC_FLOAT_OP(/, div);
+
+ TEST_VEC_VEC_ALL(min);
+ TEST_VEC_VEC_ALL(max);
+ TEST_FN_FN_ALL(fmin);
+ TEST_FN_F_ALL(fmin);
+ TEST_FN_FN_ALL(fmax);
+ TEST_FN_F_ALL(fmax);
if (failed) {
rsDebug("test_math_agree FAILED", 0);
diff --git a/tools/aapt/Resource.cpp b/tools/aapt/Resource.cpp
index a69adc1..ee076e6 100644
--- a/tools/aapt/Resource.cpp
+++ b/tools/aapt/Resource.cpp
@@ -2210,7 +2210,7 @@
status_t
writeProguardForXml(ProguardKeepSet* keep, const sp<AaptFile>& layoutFile,
- const char* startTag, const KeyedVector<String8, NamespaceAttributePair>* tagAttrPairs)
+ const char* startTag, const KeyedVector<String8, Vector<NamespaceAttributePair> >* tagAttrPairs)
{
status_t err;
ResXMLTree tree;
@@ -2254,17 +2254,21 @@
} else if (tagAttrPairs != NULL) {
ssize_t tagIndex = tagAttrPairs->indexOfKey(tag);
if (tagIndex >= 0) {
- const NamespaceAttributePair& nsAttr = tagAttrPairs->valueAt(tagIndex);
- ssize_t attrIndex = tree.indexOfAttribute(nsAttr.ns, nsAttr.attr);
- if (attrIndex < 0) {
- // fprintf(stderr, "%s:%d: <%s> does not have attribute %s:%s.\n",
- // layoutFile->getPrintableSource().string(), tree.getLineNumber(),
- // tag.string(), nsAttr.ns, nsAttr.attr);
- } else {
- size_t len;
- addProguardKeepRule(keep,
- String8(tree.getAttributeStringValue(attrIndex, &len)), NULL,
- layoutFile->getPrintableSource(), tree.getLineNumber());
+ const Vector<NamespaceAttributePair>& nsAttrVector = tagAttrPairs->valueAt(tagIndex);
+ for (size_t i = 0; i < nsAttrVector.size(); i++) {
+ const NamespaceAttributePair& nsAttr = nsAttrVector[i];
+
+ ssize_t attrIndex = tree.indexOfAttribute(nsAttr.ns, nsAttr.attr);
+ if (attrIndex < 0) {
+ // fprintf(stderr, "%s:%d: <%s> does not have attribute %s:%s.\n",
+ // layoutFile->getPrintableSource().string(), tree.getLineNumber(),
+ // tag.string(), nsAttr.ns, nsAttr.attr);
+ } else {
+ size_t len;
+ addProguardKeepRule(keep,
+ String8(tree.getAttributeStringValue(attrIndex, &len)), NULL,
+ layoutFile->getPrintableSource(), tree.getLineNumber());
+ }
}
}
}
@@ -2280,9 +2284,18 @@
return NO_ERROR;
}
-static void addTagAttrPair(KeyedVector<String8, NamespaceAttributePair>* dest,
+static void addTagAttrPair(KeyedVector<String8, Vector<NamespaceAttributePair> >* dest,
const char* tag, const char* ns, const char* attr) {
- dest->add(String8(tag), NamespaceAttributePair(ns, attr));
+ String8 tagStr(tag);
+ ssize_t index = dest->indexOfKey(tagStr);
+
+ if (index < 0) {
+ Vector<NamespaceAttributePair> vector;
+ vector.add(NamespaceAttributePair(ns, attr));
+ dest->add(tagStr, vector);
+ } else {
+ dest->editValueAt(index).add(NamespaceAttributePair(ns, attr));
+ }
}
status_t
@@ -2291,13 +2304,13 @@
status_t err;
// tag:attribute pairs that should be checked in layout files.
- KeyedVector<String8, NamespaceAttributePair> kLayoutTagAttrPairs;
+ KeyedVector<String8, Vector<NamespaceAttributePair> > kLayoutTagAttrPairs;
addTagAttrPair(&kLayoutTagAttrPairs, "view", NULL, "class");
addTagAttrPair(&kLayoutTagAttrPairs, "fragment", NULL, "class");
addTagAttrPair(&kLayoutTagAttrPairs, "fragment", RESOURCES_ANDROID_NAMESPACE, "name");
// tag:attribute pairs that should be checked in xml files.
- KeyedVector<String8, NamespaceAttributePair> kXmlTagAttrPairs;
+ KeyedVector<String8, Vector<NamespaceAttributePair> > kXmlTagAttrPairs;
addTagAttrPair(&kXmlTagAttrPairs, "PreferenceScreen", RESOURCES_ANDROID_NAMESPACE, "fragment");
addTagAttrPair(&kXmlTagAttrPairs, "header", RESOURCES_ANDROID_NAMESPACE, "fragment");
@@ -2307,7 +2320,7 @@
const sp<AaptDir>& d = dirs.itemAt(k);
const String8& dirName = d->getLeaf();
const char* startTag = NULL;
- const KeyedVector<String8, NamespaceAttributePair>* tagAttrPairs = NULL;
+ const KeyedVector<String8, Vector<NamespaceAttributePair> >* tagAttrPairs = NULL;
if ((dirName == String8("layout")) || (strncmp(dirName.string(), "layout-", 7) == 0)) {
tagAttrPairs = &kLayoutTagAttrPairs;
} else if ((dirName == String8("xml")) || (strncmp(dirName.string(), "xml-", 4) == 0)) {
@@ -2339,6 +2352,7 @@
if (overlay.get()) {
return writeProguardForLayouts(keep, overlay);
}
+
return NO_ERROR;
}